jackson, HTTP codes and JSON responses, xICIC/RRMConfig fix
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ARFCNValue.java b/src/main/java/org.onosproject.xran/codecs/api/ARFCNValue.java
index cffdb07..acdd791 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ARFCNValue.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ARFCNValue.java
@@ -4,41 +4,40 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import java.math.BigInteger;
-import java.util.Arrays;
public class ARFCNValue extends BerInteger {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- public ARFCNValue() {
- }
+ public ARFCNValue() {
+ }
- public ARFCNValue(byte[] code) {
- super(code);
- }
+ public ARFCNValue(byte[] code) {
+ super(code);
+ }
- public ARFCNValue(BigInteger value) {
- super(value);
- }
+ public ARFCNValue(BigInteger value) {
+ super(value);
+ }
- public ARFCNValue(long value) {
- super(value);
- }
+ public ARFCNValue(long value) {
+ super(value);
+ }
- @Override
- public int hashCode() {
- return value.intValue();
- }
+ @Override
+ public int hashCode() {
+ return value.intValue();
+ }
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof ARFCNValue) {
- return value.intValue() == ((ARFCNValue) obj).value.intValue();
- }
- return super.equals(obj);
- }
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof ARFCNValue) {
+ return value.intValue() == ((ARFCNValue) obj).value.intValue();
+ }
+ return super.equals(obj);
+ }
}
diff --git a/src/main/java/org.onosproject.xran/codecs/api/AdmEstCause.java b/src/main/java/org.onosproject.xran/codecs/api/AdmEstCause.java
index e344fc5..7d1ffcf 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/AdmEstCause.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/AdmEstCause.java
@@ -4,7 +4,7 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
import java.math.BigInteger;
diff --git a/src/main/java/org.onosproject.xran/codecs/api/AdmEstResponse.java b/src/main/java/org.onosproject.xran/codecs/api/AdmEstResponse.java
index 388b64e..f594b70 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/AdmEstResponse.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/AdmEstResponse.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class AdmEstResponse extends BerEnum {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/AdmEstStatus.java b/src/main/java/org.onosproject.xran/codecs/api/AdmEstStatus.java
index 68680a6..039e5e3 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/AdmEstStatus.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/AdmEstStatus.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class AdmEstStatus extends BerEnum {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/BitRate.java b/src/main/java/org.onosproject.xran/codecs/api/BitRate.java
index 7b0b49d..9dd16ec 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/BitRate.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/BitRate.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class BitRate extends BerInteger {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/CACap.java b/src/main/java/org.onosproject.xran/codecs/api/CACap.java
index cd2ef5c..4642978 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/CACap.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/CACap.java
@@ -4,12 +4,13 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerBoolean;
-import org.openmuc.jasn1.ber.types.BerEnum;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerBoolean;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import java.io.IOException;
import java.io.InputStream;
@@ -22,6 +23,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private BerInteger band = null;
private BerEnum caclassdl = null;
@@ -193,7 +195,7 @@
sb.append("\t");
}
if (band != null) {
- sb.append("\"band\":").append(band);
+ sb.append("band:").append(band);
}
sb.append(",\n");
@@ -201,7 +203,7 @@
sb.append("\t");
}
if (caclassdl != null) {
- sb.append("\"caclassdl\":").append(caclassdl);
+ sb.append("caclassdl:").append(caclassdl);
}
sb.append(",\n");
@@ -209,7 +211,7 @@
sb.append("\t");
}
if (caclassul != null) {
- sb.append("\"caclassul\":").append(caclassul);
+ sb.append("caclassul:").append(caclassul);
}
sb.append(",\n");
@@ -217,7 +219,7 @@
sb.append("\t");
}
if (crossCarrierSched != null) {
- sb.append("\"crossCarrierSched\":").append(crossCarrierSched);
+ sb.append("crossCarrierSched:").append(crossCarrierSched);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/api/CRNTI.java b/src/main/java/org.onosproject.xran/codecs/api/CRNTI.java
index 69d5f48..38f893b 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/CRNTI.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/CRNTI.java
@@ -14,9 +14,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
import javax.xml.bind.DatatypeConverter;
@@ -51,6 +51,6 @@
@Override
public String toString() {
- return "\"" + DatatypeConverter.printHexBinary(value) + "\"";
+ return "" + DatatypeConverter.printHexBinary(value) + "";
}
}
diff --git a/src/main/java/org.onosproject.xran/codecs/api/CandScell.java b/src/main/java/org.onosproject.xran/codecs/api/CandScell.java
index 7b954d0..2113691 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/CandScell.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/CandScell.java
@@ -4,9 +4,10 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -19,6 +20,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private PhysCellId pci = null;
private ARFCNValue earfcnDl = null;
@@ -144,7 +146,7 @@
sb.append("\t");
}
if (pci != null) {
- sb.append("\"pci\": ").append(pci);
+ sb.append("pci: ").append(pci);
}
sb.append(",\n");
@@ -152,7 +154,7 @@
sb.append("\t");
}
if (earfcnDl != null) {
- sb.append("\"earfcnDl\": ").append(earfcnDl);
+ sb.append("earfcnDl: ").append(earfcnDl);
}
sb.append("\n");
for (int i = 0; i < indentLevel; i++) {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/DCCap.java b/src/main/java/org.onosproject.xran/codecs/api/DCCap.java
index f3f7c61..ea75cfb 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/DCCap.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/DCCap.java
@@ -4,10 +4,11 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerEnum;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
import java.io.IOException;
import java.io.InputStream;
@@ -20,6 +21,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private BerEnum drbTypeSplit = null;
@@ -122,7 +124,7 @@
sb.append("\t");
}
if (drbTypeSplit != null) {
- sb.append("\"drbTypeSplit\": ").append(drbTypeSplit);
+ sb.append("drbTypeSplit: ").append(drbTypeSplit);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/api/DuplexMode.java b/src/main/java/org.onosproject.xran/codecs/api/DuplexMode.java
index cfbd191..ae2d40c 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/DuplexMode.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/DuplexMode.java
@@ -4,7 +4,7 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
import java.math.BigInteger;
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ECGI.java b/src/main/java/org.onosproject.xran/codecs/api/ECGI.java
index 01789f2..c903fd6 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ECGI.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ECGI.java
@@ -4,9 +4,10 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -19,6 +20,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private PLMNIdentity pLMNIdentity = null;
private EUTRANCellIdentifier eUTRANcellIdentifier = null;
@@ -144,7 +146,7 @@
sb.append("\t");
}
if (pLMNIdentity != null) {
- sb.append("\"pLMNIdentity\": ").append(pLMNIdentity);
+ sb.append("pLMNIdentity: ").append(pLMNIdentity);
}
sb.append(",\n");
@@ -152,7 +154,7 @@
sb.append("\t");
}
if (eUTRANcellIdentifier != null) {
- sb.append("\"eUTRANcellIdentifier\": ").append(eUTRANcellIdentifier);
+ sb.append("eUTRANcellIdentifier: ").append(eUTRANcellIdentifier);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ENBUES1APID.java b/src/main/java/org.onosproject.xran/codecs/api/ENBUES1APID.java
index 2bb7c15..61a9aba 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ENBUES1APID.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ENBUES1APID.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class ENBUES1APID extends BerInteger {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ERABDecision.java b/src/main/java/org.onosproject.xran/codecs/api/ERABDecision.java
index 7d50dc7..fb70c38 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ERABDecision.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ERABDecision.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class ERABDecision extends BerEnum {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ERABDirection.java b/src/main/java/org.onosproject.xran/codecs/api/ERABDirection.java
index d29502c..332953a 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ERABDirection.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ERABDirection.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class ERABDirection extends BerEnum {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ERABID.java b/src/main/java/org.onosproject.xran/codecs/api/ERABID.java
index 92875c8..907243a 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ERABID.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ERABID.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class ERABID extends BerInteger {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ERABParams.java b/src/main/java/org.onosproject.xran/codecs/api/ERABParams.java
index 237c5d9..fafd02d 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ERABParams.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ERABParams.java
@@ -13,9 +13,12 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class ERABParams implements Serializable {
@@ -23,6 +26,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<ERABParamsItem> seqOf = null;
@@ -34,6 +38,7 @@
this.code = code;
}
+ @JsonValue
public List<ERABParamsItem> getERABParamsItem() {
if (seqOf == null) {
seqOf = new ArrayList<ERABParamsItem>();
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ERABParamsItem.java b/src/main/java/org.onosproject.xran/codecs/api/ERABParamsItem.java
index 9db7698..d36acb0 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ERABParamsItem.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ERABParamsItem.java
@@ -13,9 +13,11 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class ERABParamsItem implements Serializable {
@@ -24,6 +26,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private ERABID id = null;
private ERABDirection direction = null;
@@ -310,21 +313,21 @@
sb.append("\t");
}
if (id != null) {
- sb.append("\"id\": ").append(id);
+ sb.append("id: ").append(id);
}
sb.append(",\n");
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
if (direction != null) {
- sb.append("\"direction\": ").append(direction);
+ sb.append("direction: ").append(direction);
}
sb.append(",\n");
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
if (type != null) {
- sb.append("\"type\": ").append(type);
+ sb.append("type: ").append(type);
}
sb.append(",\n");
@@ -332,7 +335,7 @@
sb.append("\t");
}
if (qci != null) {
- sb.append("\"qci\": ").append(qci);
+ sb.append("qci: ").append(qci);
}
sb.append(",\n");
@@ -340,7 +343,7 @@
sb.append("\t");
}
if (arp != null) {
- sb.append("\"arp\": ").append(arp);
+ sb.append("arp: ").append(arp);
}
sb.append(",\n");
@@ -348,7 +351,7 @@
sb.append("\t");
}
if (gbrDl != null) {
- sb.append("\"gbrDl\": ").append(gbrDl);
+ sb.append("gbrDl: ").append(gbrDl);
}
sb.append(",\n");
@@ -356,7 +359,7 @@
sb.append("\t");
}
if (gbrUl != null) {
- sb.append("\"gbrUl\": ").append(gbrUl);
+ sb.append("gbrUl: ").append(gbrUl);
}
sb.append(",\n");
@@ -364,7 +367,7 @@
sb.append("\t");
}
if (mbrDl != null) {
- sb.append("\"mbrDl\": ").append(mbrDl);
+ sb.append("mbrDl: ").append(mbrDl);
}
sb.append(",\n");
@@ -372,7 +375,7 @@
sb.append("\t");
}
if (mbrUl != null) {
- sb.append("\"mbrUl\": ").append(mbrUl);
+ sb.append("mbrUl: ").append(mbrUl);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ERABResponse.java b/src/main/java/org.onosproject.xran/codecs/api/ERABResponse.java
index fdf66fa..eaff5a9 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ERABResponse.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ERABResponse.java
@@ -13,9 +13,12 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class ERABResponse implements Serializable {
@@ -23,6 +26,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<ERABResponseItem> seqOf = null;
@@ -34,6 +38,7 @@
this.code = code;
}
+ @JsonValue
public List<ERABResponseItem> getERABResponseItem() {
if (seqOf == null) {
seqOf = new ArrayList<ERABResponseItem>();
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ERABResponseItem.java b/src/main/java/org.onosproject.xran/codecs/api/ERABResponseItem.java
index 7608bed..db5181d 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ERABResponseItem.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ERABResponseItem.java
@@ -13,9 +13,11 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class ERABResponseItem implements Serializable {
@@ -24,6 +26,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private ERABID id = null;
private ERABDecision decision = null;
@@ -149,7 +152,7 @@
sb.append("\t");
}
if (id != null) {
- sb.append("\"id\": ").append(id);
+ sb.append("id: ").append(id);
}
sb.append(",\n");
@@ -157,7 +160,7 @@
sb.append("\t");
}
if (decision != null) {
- sb.append("\"decision\": ").append(decision);
+ sb.append("decision: ").append(decision);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ERABType.java b/src/main/java/org.onosproject.xran/codecs/api/ERABType.java
index 9f2449c..7d95c98 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ERABType.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ERABType.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class ERABType extends BerEnum {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/EUTRANCellIdentifier.java b/src/main/java/org.onosproject.xran/codecs/api/EUTRANCellIdentifier.java
index 7c7f2a2..8dd094d 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/EUTRANCellIdentifier.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/EUTRANCellIdentifier.java
@@ -4,7 +4,7 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.BerBitString;
import javax.xml.bind.DatatypeConverter;
import java.util.Arrays;
@@ -37,9 +37,4 @@
}
return super.equals(obj);
}
-
- @Override
- public String toString() {
- return "\"" + DatatypeConverter.printHexBinary(value) + "\"";
- }
}
diff --git a/src/main/java/org.onosproject.xran/codecs/api/HOFailureCause.java b/src/main/java/org.onosproject.xran/codecs/api/HOFailureCause.java
index 67be0de..5723e83 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/HOFailureCause.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/HOFailureCause.java
@@ -4,7 +4,7 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
import java.math.BigInteger;
diff --git a/src/main/java/org.onosproject.xran/codecs/api/MMEUES1APID.java b/src/main/java/org.onosproject.xran/codecs/api/MMEUES1APID.java
index 4967941..6edb788 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/MMEUES1APID.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/MMEUES1APID.java
@@ -15,9 +15,9 @@
import java.io.Serializable;
import java.util.Objects;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class MMEUES1APID extends BerInteger {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/PCIARFCN.java b/src/main/java/org.onosproject.xran/codecs/api/PCIARFCN.java
index e3bd88f..a02833d 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/PCIARFCN.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/PCIARFCN.java
@@ -4,9 +4,10 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -19,6 +20,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private PhysCellId pci = null;
private ARFCNValue earfcnDl = null;
@@ -144,7 +146,7 @@
sb.append("\t");
}
if (pci != null) {
- sb.append("\"pci\": ").append(pci);
+ sb.append("pci: ").append(pci);
}
sb.append(",\n");
@@ -152,7 +154,7 @@
sb.append("\t");
}
if (earfcnDl != null) {
- sb.append("\"earfcnDl\": ").append(earfcnDl);
+ sb.append("earfcnDl: ").append(earfcnDl);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/api/PLMNIdentity.java b/src/main/java/org.onosproject.xran/codecs/api/PLMNIdentity.java
index 5279ed6..39f0ec9 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/PLMNIdentity.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/PLMNIdentity.java
@@ -4,9 +4,8 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.types.BerOctetString;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
-import javax.xml.bind.DatatypeConverter;
import java.util.Arrays;
@@ -34,8 +33,4 @@
return super.equals(obj);
}
- @Override
- public String toString() {
- return "\"" + DatatypeConverter.printHexBinary(value) + "\"";
- }
}
diff --git a/src/main/java/org.onosproject.xran/codecs/api/PRBUsage.java b/src/main/java/org.onosproject.xran/codecs/api/PRBUsage.java
index a36141c..ebe133f 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/PRBUsage.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/PRBUsage.java
@@ -13,9 +13,12 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class PRBUsage implements Serializable {
@@ -27,6 +30,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<BerInteger> seqOf = null;
@@ -38,7 +42,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -156,7 +160,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public PrbUsageUl() {
@@ -167,7 +171,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -282,7 +286,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private PrbUsageDl prbUsageDl = null;
private PrbUsageUl prbUsageUl = null;
@@ -407,7 +411,7 @@
sb.append("\t");
}
if (prbUsageDl != null) {
- sb.append("\"prbUsageDl\": ");
+ sb.append("prbUsageDl: ");
prbUsageDl.appendAsString(sb, indentLevel + 1);
}
@@ -416,7 +420,7 @@
sb.append("\t");
}
if (prbUsageUl != null) {
- sb.append("\"prbUsageUl\": ");
+ sb.append("prbUsageUl: ");
prbUsageUl.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/api/PhysCellId.java b/src/main/java/org.onosproject.xran/codecs/api/PhysCellId.java
index e05df5b..0c7e330 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/PhysCellId.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/PhysCellId.java
@@ -4,7 +4,7 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import java.math.BigInteger;
diff --git a/src/main/java/org.onosproject.xran/codecs/api/PropScell.java b/src/main/java/org.onosproject.xran/codecs/api/PropScell.java
index 9d473be..2e9400b 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/PropScell.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/PropScell.java
@@ -4,12 +4,13 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerBoolean;
-import org.openmuc.jasn1.ber.types.BerEnum;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerBoolean;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import java.io.IOException;
import java.io.InputStream;
@@ -22,6 +23,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private PCIARFCN pciArfcn = null;
private BerBoolean crossCarrierSchedEnable = null;
diff --git a/src/main/java/org.onosproject.xran/codecs/api/QCI.java b/src/main/java/org.onosproject.xran/codecs/api/QCI.java
index adee94e..c8a4e69 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/QCI.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/QCI.java
@@ -4,7 +4,7 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import java.math.BigInteger;
diff --git a/src/main/java/org.onosproject.xran/codecs/api/RSRPRange.java b/src/main/java/org.onosproject.xran/codecs/api/RSRPRange.java
index 592f41e..c841f05 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/RSRPRange.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/RSRPRange.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class RSRPRange extends BerInteger {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/RSRQRange.java b/src/main/java/org.onosproject.xran/codecs/api/RSRQRange.java
index 4d74e85..c0115a3 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/RSRQRange.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/RSRQRange.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class RSRQRange extends BerInteger {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/RXSigMeasRepInterval.java b/src/main/java/org.onosproject.xran/codecs/api/RXSigMeasRepInterval.java
index 8ce29aa..55be762 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/RXSigMeasRepInterval.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/RXSigMeasRepInterval.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class RXSigMeasRepInterval extends BerEnum {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/RXSigRepQty.java b/src/main/java/org.onosproject.xran/codecs/api/RXSigRepQty.java
index 8794f09..1c7f3ad 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/RXSigRepQty.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/RXSigRepQty.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class RXSigRepQty extends BerEnum {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/RXSigReport.java b/src/main/java/org.onosproject.xran/codecs/api/RXSigReport.java
index f07dd09..d11dc34 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/RXSigReport.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/RXSigReport.java
@@ -13,9 +13,11 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class RXSigReport implements Serializable {
@@ -24,6 +26,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private PCIARFCN pciArfcn = null;
private RSRPRange rsrp = null;
@@ -172,7 +175,7 @@
sb.append("\t");
}
if (pciArfcn != null) {
- sb.append("\"pciArfcn\": ");
+ sb.append("pciArfcn: ");
pciArfcn.appendAsString(sb, indentLevel + 1);
}
@@ -181,14 +184,14 @@
sb.append("\t");
}
if (rsrp != null) {
- sb.append("\"rsrp\": ").append(rsrp);
+ sb.append("rsrp: ").append(rsrp);
}
sb.append(",\n");
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
if (rsrq != null) {
- sb.append("\"rsrq\": ").append(rsrq);
+ sb.append("rsrq: ").append(rsrq);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/api/RadioRepPerServCell.java b/src/main/java/org.onosproject.xran/codecs/api/RadioRepPerServCell.java
index 525fb0a..93d7dde 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/RadioRepPerServCell.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/RadioRepPerServCell.java
@@ -4,10 +4,12 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import java.io.IOException;
import java.io.InputStream;
@@ -26,6 +28,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<BerInteger> seqOf = null;
@@ -37,7 +40,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -156,7 +159,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public RiHist() {
@@ -167,7 +170,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -287,7 +290,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public PuschSinrHist() {
@@ -298,7 +301,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -418,7 +421,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public PucchSinrHist() {
@@ -429,6 +432,7 @@
this.code = code;
}
+ @JsonValue
public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
@@ -545,7 +549,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private PCIARFCN pciArfcn = null;
private CqiHist cqiHist = null;
private RiHist riHist = null;
@@ -739,7 +743,7 @@
sb.append("\t");
}
if (pciArfcn != null) {
- sb.append("\"pciArfcn\": ");
+ sb.append("pciArfcn: ");
pciArfcn.appendAsString(sb, indentLevel + 1);
}
@@ -748,7 +752,7 @@
sb.append("\t");
}
if (cqiHist != null) {
- sb.append("\"cqiHist\": ");
+ sb.append("cqiHist: ");
cqiHist.appendAsString(sb, indentLevel + 1);
}
@@ -757,7 +761,7 @@
sb.append("\t");
}
if (riHist != null) {
- sb.append("\"riHist\": ");
+ sb.append("riHist: ");
riHist.appendAsString(sb, indentLevel + 1);
}
@@ -766,7 +770,7 @@
sb.append("\t");
}
if (puschSinrHist != null) {
- sb.append("\"puschSinrHist\": ");
+ sb.append("puschSinrHist: ");
puschSinrHist.appendAsString(sb, indentLevel + 1);
}
@@ -775,7 +779,7 @@
sb.append("\t");
}
if (pucchSinrHist != null) {
- sb.append("\"pucchSinrHist\": ");
+ sb.append("pucchSinrHist: ");
pucchSinrHist.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/api/ReconfIndReason.java b/src/main/java/org.onosproject.xran/codecs/api/ReconfIndReason.java
index 6ab2221..3c08c48 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/ReconfIndReason.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/ReconfIndReason.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class ReconfIndReason extends BerEnum {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/RelCause.java b/src/main/java/org.onosproject.xran/codecs/api/RelCause.java
index c983d06..5d1191d 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/RelCause.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/RelCause.java
@@ -13,9 +13,9 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class RelCause extends BerEnum {
diff --git a/src/main/java/org.onosproject.xran/codecs/api/SchedMeasRepPerServCell.java b/src/main/java/org.onosproject.xran/codecs/api/SchedMeasRepPerServCell.java
index a2ed8fb..753fa5f 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/SchedMeasRepPerServCell.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/SchedMeasRepPerServCell.java
@@ -13,9 +13,12 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class SchedMeasRepPerServCell implements Serializable {
@@ -27,6 +30,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<QCI> seqOf = null;
@@ -38,6 +42,7 @@
this.code = code;
}
+ @JsonValue
public List<QCI> getQCI() {
if (seqOf == null) {
seqOf = new ArrayList<QCI>();
@@ -157,7 +162,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public McsDl() {
@@ -168,7 +173,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -287,7 +292,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public NumSchedTtisDl() {
@@ -298,7 +303,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -417,7 +422,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public McsUl() {
@@ -428,7 +433,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -547,7 +552,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public NumSchedTtisUl() {
@@ -558,7 +563,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -677,7 +682,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public RankDl1() {
@@ -688,7 +693,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -807,7 +812,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public RankDl2() {
@@ -818,6 +823,7 @@
this.code = code;
}
+ @JsonValue
public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
@@ -934,7 +940,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private PCIARFCN pciArfcn = null;
private QciVals qciVals = null;
private PRBUsage prbUsage = null;
@@ -1220,7 +1226,7 @@
sb.append("\t");
}
if (pciArfcn != null) {
- sb.append("\"pciArfcn\": ");
+ sb.append("pciArfcn: ");
pciArfcn.appendAsString(sb, indentLevel + 1);
}
@@ -1229,7 +1235,7 @@
sb.append("\t");
}
if (qciVals != null) {
- sb.append("\"qciVals\": ");
+ sb.append("qciVals: ");
qciVals.appendAsString(sb, indentLevel + 1);
}
@@ -1238,7 +1244,7 @@
sb.append("\t");
}
if (prbUsage != null) {
- sb.append("\"prbUsage\": ");
+ sb.append("prbUsage: ");
prbUsage.appendAsString(sb, indentLevel + 1);
}
@@ -1247,7 +1253,7 @@
sb.append("\t");
}
if (mcsDl != null) {
- sb.append("\"mcsDl\": ");
+ sb.append("mcsDl: ");
mcsDl.appendAsString(sb, indentLevel + 1);
}
@@ -1256,7 +1262,7 @@
sb.append("\t");
}
if (numSchedTtisDl != null) {
- sb.append("\"numSchedTtisDl\": ");
+ sb.append("numSchedTtisDl: ");
numSchedTtisDl.appendAsString(sb, indentLevel + 1);
}
@@ -1265,7 +1271,7 @@
sb.append("\t");
}
if (mcsUl != null) {
- sb.append("\"mcsUl\": ");
+ sb.append("mcsUl: ");
mcsUl.appendAsString(sb, indentLevel + 1);
}
@@ -1274,7 +1280,7 @@
sb.append("\t");
}
if (numSchedTtisUl != null) {
- sb.append("\"numSchedTtisUl\": ");
+ sb.append("numSchedTtisUl: ");
numSchedTtisUl.appendAsString(sb, indentLevel + 1);
}
@@ -1283,7 +1289,7 @@
sb.append("\t");
}
if (rankDl1 != null) {
- sb.append("\"rankDl1\": ");
+ sb.append("rankDl1: ");
rankDl1.appendAsString(sb, indentLevel + 1);
}
@@ -1292,7 +1298,7 @@
sb.append("\t");
}
if (rankDl2 != null) {
- sb.append("\"rankDl2\": ");
+ sb.append("rankDl2: ");
rankDl2.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/api/TrafficSplitPercentage.java b/src/main/java/org.onosproject.xran/codecs/api/TrafficSplitPercentage.java
index bf3031a..cf37663 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/TrafficSplitPercentage.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/TrafficSplitPercentage.java
@@ -13,9 +13,11 @@
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.io.Serializable;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
public class TrafficSplitPercentage implements Serializable {
@@ -24,6 +26,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private ECGI ecgi = null;
private BerInteger trafficPercentDl = null;
@@ -179,7 +182,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -188,7 +191,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"trafficPercentDl\": ").append(trafficPercentDl);
+ sb.append("trafficPercentDl: ").append(trafficPercentDl);
}
if (trafficPercentUl != null) {
@@ -196,7 +199,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"trafficPercentUl\": ").append(trafficPercentUl);
+ sb.append("trafficPercentUl: ").append(trafficPercentUl);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/api/UEAMBR.java b/src/main/java/org.onosproject.xran/codecs/api/UEAMBR.java
index eeadfa2..0fb8a7f 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/UEAMBR.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/UEAMBR.java
@@ -4,9 +4,10 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -19,6 +20,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private BitRate ambrDl = null;
private BitRate ambrUl = null;
@@ -144,7 +146,7 @@
sb.append("\t");
}
if (ambrDl != null) {
- sb.append("\"ambrDl\": ").append(ambrDl);
+ sb.append("ambrDl: ").append(ambrDl);
}
sb.append(",\n");
@@ -152,7 +154,7 @@
sb.append("\t");
}
if (ambrUl != null) {
- sb.append("\"ambrUl\": ").append(ambrUl);
+ sb.append("ambrUl: ").append(ambrUl);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/api/XICICPA.java b/src/main/java/org.onosproject.xran/codecs/api/XICICPA.java
index 4586eac..5c69cfa 100644
--- a/src/main/java/org.onosproject.xran/codecs/api/XICICPA.java
+++ b/src/main/java/org.onosproject.xran/codecs/api/XICICPA.java
@@ -4,7 +4,7 @@
package org.onosproject.xran.codecs.api;
-import org.openmuc.jasn1.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
import java.math.BigInteger;
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/BerByteArrayOutputStream.java b/src/main/java/org.onosproject.xran/codecs/ber/BerByteArrayOutputStream.java
new file mode 100644
index 0000000..e32f381
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/BerByteArrayOutputStream.java
@@ -0,0 +1,115 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+
+public class BerByteArrayOutputStream extends OutputStream {
+
+ private final boolean automaticResize;
+ public byte[] buffer;
+ public int index;
+
+ /**
+ * Creates a <code>BerByteArrayOutputStream</code> with a byte array of size <code>bufferSize</code>. The buffer
+ * will not be resized automatically. Use {@link #BerByteArrayOutputStream(int, boolean)} instead if you want the
+ * buffer to be dynamically resized.
+ *
+ * @param bufferSize the size of the underlying buffer
+ */
+ public BerByteArrayOutputStream(int bufferSize) {
+ this(new byte[bufferSize], bufferSize - 1, false);
+ }
+
+ public BerByteArrayOutputStream(int bufferSize, boolean automaticResize) {
+ this(new byte[bufferSize], bufferSize - 1, automaticResize);
+ }
+
+ public BerByteArrayOutputStream(byte[] buffer) {
+ this(buffer, buffer.length - 1, false);
+ }
+
+ public BerByteArrayOutputStream(byte[] buffer, int startingIndex) {
+ this(buffer, startingIndex, false);
+ }
+
+ public BerByteArrayOutputStream(byte[] buffer, int startingIndex, boolean automaticResize) {
+ if (buffer.length <= 0) {
+ throw new IllegalArgumentException("buffer size may not be <= 0");
+ }
+ this.buffer = buffer;
+ index = startingIndex;
+ this.automaticResize = automaticResize;
+ }
+
+ @Override
+ public void write(int arg0) throws IOException {
+ write((byte) arg0);
+ }
+
+ public void write(byte arg0) throws IOException {
+ try {
+ buffer[index] = arg0;
+ } catch (ArrayIndexOutOfBoundsException e) {
+ if (automaticResize) {
+ resize();
+ buffer[index] = arg0;
+ } else {
+ throw new ArrayIndexOutOfBoundsException("buffer.length = " + buffer.length);
+ }
+ }
+ index--;
+ }
+
+ private void resize() {
+ byte[] newBuffer = new byte[buffer.length * 2];
+ System.arraycopy(buffer, index + 1, newBuffer, buffer.length + index + 1, buffer.length - index - 1);
+ index += buffer.length;
+ buffer = newBuffer;
+
+ }
+
+ @Override
+ public void write(byte[] byteArray) throws IOException {
+ for (int i = byteArray.length - 1; i >= 0; i--) {
+ try {
+ buffer[index] = byteArray[i];
+ } catch (ArrayIndexOutOfBoundsException e) {
+ if (automaticResize) {
+ resize();
+ buffer[index] = byteArray[i];
+ } else {
+ throw new ArrayIndexOutOfBoundsException("buffer.length = " + buffer.length);
+ }
+ }
+ index--;
+ }
+ }
+
+ /**
+ * Returns a new array containing the subarray of the stream array that contains the coded content.
+ *
+ * @return a new array containing the subarray of the stream array
+ */
+ public byte[] getArray() {
+ if (index == -1) {
+ return buffer;
+ }
+ int subBufferLength = buffer.length - index - 1;
+ byte[] subBuffer = new byte[subBufferLength];
+ System.arraycopy(buffer, index + 1, subBuffer, 0, subBufferLength);
+ return subBuffer;
+
+ }
+
+ public ByteBuffer getByteBuffer() {
+ return ByteBuffer.wrap(buffer, index + 1, buffer.length - (index + 1));
+ }
+
+ public void reset() {
+ index = buffer.length - 1;
+ }
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/BerLength.java b/src/main/java/org.onosproject.xran/codecs/ber/BerLength.java
new file mode 100644
index 0000000..8057a58
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/BerLength.java
@@ -0,0 +1,115 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+
+public class BerLength implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public int val;
+
+ public BerLength() {
+ }
+
+ public static int skip(InputStream is) throws IOException {
+
+ int val = is.read();
+ if (val == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+
+ if ((val & 0x80) == 0) {
+ return 1;
+ }
+
+ int lengthLength = val & 0x7f;
+
+ // check for indefinite length
+ if (lengthLength == 0) {
+ val = -1;
+ return 1;
+ }
+
+ if (lengthLength > 4) {
+ throw new IOException("Length is out of bound!");
+ }
+
+ for (int i = 0; i < lengthLength; i++) {
+ int nextByte = is.read();
+ if (nextByte == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+ }
+
+ return lengthLength + 1;
+ }
+
+ public static int encodeLength(BerByteArrayOutputStream os, int length) throws IOException {
+ // the indefinite form is ignored for now
+
+ if (length <= 127) {
+ // this is the short form, it is coded differently than the long
+ // form for values > 127
+ os.write((byte) length);
+ return 1;
+ } else {
+ int numLengthBytes = 1;
+
+ while (((int) (Math.pow(2, 8 * numLengthBytes) - 1)) < length) {
+ numLengthBytes++;
+ }
+
+ for (int i = 0; i < numLengthBytes; i++) {
+ os.write((length >> 8 * i) & 0xff);
+ }
+
+ os.write(0x80 | numLengthBytes);
+
+ return 1 + numLengthBytes;
+ }
+
+ }
+
+ public int decode(InputStream is) throws IOException {
+
+ val = is.read();
+ if (val == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+
+ if ((val & 0x80) == 0) {
+ return 1;
+ }
+
+ int lengthLength = val & 0x7f;
+
+ // check for indefinite length
+ if (lengthLength == 0) {
+ val = -1;
+ return 1;
+ }
+
+ if (lengthLength > 4) {
+ throw new IOException("Length is out of bound!");
+ }
+
+ val = 0;
+
+ for (int i = 0; i < lengthLength; i++) {
+ int nextByte = is.read();
+ if (nextByte == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+ val |= nextByte << (8 * (lengthLength - i - 1));
+ }
+
+ return lengthLength + 1;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/BerTag.java b/src/main/java/org.onosproject.xran/codecs/ber/BerTag.java
new file mode 100644
index 0000000..5d5df85
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/BerTag.java
@@ -0,0 +1,186 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+
+public class BerTag implements Serializable {
+
+ public static final int UNIVERSAL_CLASS = 0x00;
+ public static final int APPLICATION_CLASS = 0x40;
+ public static final int CONTEXT_CLASS = 0x80;
+ public static final int PRIVATE_CLASS = 0xc0;
+ public static final int PRIMITIVE = 0x00;
+ public static final int CONSTRUCTED = 0x20;
+ public static final int BOOLEAN_TAG = 1;
+ public static final int INTEGER_TAG = 2;
+ public static final int BIT_STRING_TAG = 3;
+ public static final int OCTET_STRING_TAG = 4;
+ public static final int NULL_TAG = 5;
+ public static final int OBJECT_IDENTIFIER_TAG = 6;
+ public static final int OBJECT_DESCRIPTOR_TAG = 7;
+ public static final int REAL_TAG = 9;
+ public static final int ENUMERATED_TAG = 10;
+ public static final int EMBEDDED_PDV_TAG = 11;
+ public static final int UTF8_STRING_TAG = 12;
+ public static final int TIME_TAG = 14;
+ public static final int NUMERIC_STRING_TAG = 18;
+ public static final int PRINTABLE_STRING_TAG = 19;
+ public static final int TELETEX_STRING_TAG = 20;
+ public static final int VIDEOTEX_STRING_TAG = 21;
+ public static final int IA5_STRING_TAG = 22;
+ public static final int UTC_TIME_TAG = 23;
+ public static final int GENERALIZED_TIME_TAG = 24;
+ public static final int GRAPHIC_STRING_TAG = 25;
+ public static final int VISIBLE_STRING_TAG = 26;
+ public static final int GENERAL_STRING_TAG = 27;
+ public static final int UNIVERSAL_STRING_TAG = 28;
+ public static final int BMP_STRING_TAG = 30;
+ public static final int DATE_TAG = 31;
+ public static final int TIME_OF_DAY_TAG = 32;
+ public static final int DATE_TIME_TAG = 33;
+ public static final int DURATION_TAG = 34;
+ private static final long serialVersionUID = 1L;
+ public byte[] tagBytes = null;
+ public int tagClass;
+ public int primitive;
+ public int tagNumber;
+
+ public BerTag(int identifierClass, int primitive, int tagNumber) {
+ this.tagClass = identifierClass;
+ this.primitive = primitive;
+ this.tagNumber = tagNumber;
+ code();
+ }
+
+ public BerTag() {
+ }
+
+ private void code() {
+ if (tagNumber < 31) {
+ tagBytes = new byte[1];
+ tagBytes[0] = (byte) (tagClass | primitive | tagNumber);
+ } else {
+ int tagLength = 1;
+ while (tagNumber > (Math.pow(2, (7 * tagLength)) - 1)) {
+ tagLength++;
+ }
+
+ tagBytes = new byte[1 + tagLength];
+ tagBytes[0] = (byte) (tagClass | primitive | 31);
+
+ for (int j = 1; j <= (tagLength - 1); j++) {
+ tagBytes[j] = (byte) (((tagNumber >> (7 * (tagLength - j))) & 0xff) | 0x80);
+ }
+
+ tagBytes[tagLength] = (byte) (tagNumber & 0x7f);
+
+ }
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ if (tagBytes == null) {
+ code();
+ }
+ for (int i = (tagBytes.length - 1); i >= 0; i--) {
+ os.write(tagBytes[i]);
+ }
+ return tagBytes.length;
+ }
+
+ public int decode(InputStream is) throws IOException {
+ int nextByte = is.read();
+ if (nextByte == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+
+ tagClass = nextByte & 0xC0;
+ primitive = nextByte & 0x20;
+ tagNumber = nextByte & 0x1f;
+
+ int codeLength = 1;
+
+ if (tagNumber == 0x1f) {
+ tagNumber = 0;
+
+ int counter = 0;
+
+ do {
+ nextByte = is.read();
+ if (nextByte == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+
+ codeLength++;
+ if (counter >= 6) {
+ throw new IOException("Invalid Tag");
+ }
+ tagNumber = tagNumber << 7;
+ tagNumber |= (nextByte & 0x7f);
+ counter++;
+ } while ((nextByte & 0x80) == 0x80);
+
+ }
+
+ return codeLength;
+ }
+
+ /**
+ * Decodes the Identifier from the ByteArrayInputStream and throws an Exception if it is not equal to itself.
+ * Returns the number of bytes read from the InputStream.
+ *
+ * @param is the input stream to read the identifier from.
+ * @return the length of the identifier read.
+ * @throws IOException if an exception occurs reading the identifier from the stream.
+ */
+ public int decodeAndCheck(InputStream is) throws IOException {
+
+ for (Byte identifierByte : tagBytes) {
+ int nextByte = is.read();
+ if (nextByte == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+
+ if (nextByte != (identifierByte & 0xff)) {
+ throw new IOException("Identifier does not match!");
+ }
+ }
+ return tagBytes.length;
+ }
+
+ public boolean equals(int identifierClass, int primitive, int tagNumber) {
+ return (this.tagNumber == tagNumber && this.tagClass == identifierClass && this.primitive == primitive);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof BerTag)) {
+ return false;
+ }
+ if (obj == this) {
+ return true;
+ }
+ BerTag berIdentifier = (BerTag) obj;
+ return (tagNumber == berIdentifier.tagNumber && tagClass == berIdentifier.tagClass
+ && primitive == berIdentifier.primitive);
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 17;
+ hash = hash * 31 + tagNumber;
+ hash = hash * 31 + tagClass;
+ hash = hash * 31 + primitive;
+ return hash;
+ }
+
+ @Override
+ public String toString() {
+ return "identifier class: " + tagClass + ", primitive: " + primitive + ", tag number: " + tagNumber;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/internal/Util.java b/src/main/java/org.onosproject.xran/codecs/ber/internal/Util.java
new file mode 100644
index 0000000..c2d64cc
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/internal/Util.java
@@ -0,0 +1,28 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.internal;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+
+public class Util {
+
+ public static void readFully(InputStream is, byte[] buffer) throws IOException {
+ readFully(is, buffer, 0, buffer.length);
+ }
+
+ public static void readFully(InputStream is, byte[] buffer, int off, int len) throws IOException {
+ do {
+ int bytesRead = is.read(buffer, off, len);
+ if (bytesRead == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+
+ len -= bytesRead;
+ off += bytesRead;
+ } while (len > 0);
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerAny.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerAny.java
new file mode 100644
index 0000000..db5daee
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerAny.java
@@ -0,0 +1,75 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.internal.Util;
+import org.onosproject.xran.codecs.util.HexConverter;
+
+import javax.xml.bind.DatatypeConverter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+
+public class BerAny implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public byte[] value;
+
+ public BerAny() {
+ }
+
+ public BerAny(byte[] value) {
+ this.value = value;
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ os.write(value);
+ return value.length;
+ }
+
+ public int decode(InputStream is) throws IOException {
+
+ return decode(is, null);
+ }
+
+ public int decode(InputStream is, BerTag tag) throws IOException {
+
+ int decodedLength = 0;
+
+ int tagLength;
+
+ if (tag == null) {
+ tag = new BerTag();
+ tagLength = tag.decode(is);
+ decodedLength += tagLength;
+ } else {
+ tagLength = tag.encode(new BerByteArrayOutputStream(10));
+ }
+
+ BerLength lengthField = new BerLength();
+ int lengthLength = lengthField.decode(is);
+ decodedLength += lengthLength + lengthField.val;
+
+ value = new byte[tagLength + lengthLength + lengthField.val];
+
+ Util.readFully(is, value, tagLength + lengthLength, lengthField.val);
+ BerByteArrayOutputStream os = new BerByteArrayOutputStream(value, tagLength + lengthLength - 1);
+ BerLength.encodeLength(os, lengthField.val);
+ tag.encode(os);
+
+ return decodedLength;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return DatatypeConverter.printHexBinary(value);
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerBitString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerBitString.java
new file mode 100644
index 0000000..9ebfe14
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerBitString.java
@@ -0,0 +1,131 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.internal.Util;
+import org.onosproject.xran.codecs.util.HexConverter;
+
+import javax.xml.bind.DatatypeConverter;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+
+public class BerBitString implements Serializable {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.BIT_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+ @JsonIgnore
+ public byte[] code = null;
+
+ public byte[] value;
+ public int numBits;
+
+ public BerBitString() {
+ }
+
+ public BerBitString(byte[] value, int numBits) {
+
+ if (value == null) {
+ throw new NullPointerException("value cannot be null");
+ }
+ if (numBits < 0) {
+ throw new IllegalArgumentException("numBits cannot be negative.");
+ }
+ if (numBits > (value.length * 8)) {
+ throw new IllegalArgumentException("'value' is too short to hold all bits.");
+ }
+
+ this.value = value;
+ this.numBits = numBits;
+
+ }
+
+ public BerBitString(byte[] code) {
+ this.code = code;
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ if (code != null) {
+ for (int i = code.length - 1; i >= 0; i--) {
+ os.write(code[i]);
+ }
+ if (withTag) {
+ return tag.encode(os) + code.length;
+ }
+ return code.length;
+ }
+
+ for (int i = (value.length - 1); i >= 0; i--) {
+ os.write(value[i]);
+ }
+ os.write(value.length * 8 - numBits);
+
+ int codeLength = value.length + 1;
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+ // could be encoded in primitiv and constructed mode
+ // only primitiv mode is implemented
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ value = new byte[length.val - 1];
+
+ int unusedBits = is.read();
+ if (unusedBits == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+ if (unusedBits > 7) {
+ throw new IOException(
+ "Number of unused bits in bit string expected to be less than 8 but is: " + unusedBits);
+ }
+
+ numBits = (value.length * 8) - unusedBits;
+
+ if (value.length > 0) {
+ Util.readFully(is, value);
+ }
+
+ codeLength += value.length + 1;
+
+ return codeLength;
+
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return DatatypeConverter.printHexBinary(value);
+ }
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerBoolean.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerBoolean.java
new file mode 100644
index 0000000..14e4e5b
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerBoolean.java
@@ -0,0 +1,115 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+
+public class BerBoolean implements Serializable {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.BOOLEAN_TAG);
+ private static final long serialVersionUID = 1L;
+ @JsonIgnore
+ public byte[] code = null;
+
+ public boolean value;
+
+ public BerBoolean() {
+ }
+
+ public BerBoolean(byte[] code) {
+ this.code = code;
+ }
+
+ public BerBoolean(boolean value) {
+ this.value = value;
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ if (code != null) {
+ for (int i = code.length - 1; i >= 0; i--) {
+ os.write(code[i]);
+ }
+ if (withTag) {
+ return tag.encode(os) + code.length;
+ }
+ return code.length;
+ }
+
+ int codeLength = 1;
+
+ if (value) {
+ os.write(0xff);
+ } else {
+ os.write(0);
+ }
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ if (length.val != 1) {
+ throw new IOException("Decoded length of BerBoolean is not correct");
+ }
+
+ int nextByte = is.read();
+ if (nextByte == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+
+ codeLength++;
+ if (nextByte == 0) {
+ value = false;
+ } else {
+ value = true;
+ }
+
+ return codeLength;
+ }
+
+ public void encodeAndSave(int encodingSizeGuess) throws IOException {
+ BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
+ encode(os, false);
+ code = os.getArray();
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return "" + value;
+ }
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerDate.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerDate.java
new file mode 100644
index 0000000..e6c3362
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerDate.java
@@ -0,0 +1,55 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+public class BerDate extends BerTime {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.DATE_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerDate() {
+ }
+
+ public BerDate(byte[] value) {
+ super(value);
+ }
+
+ public BerDate(String valueAsString) throws UnsupportedEncodingException {
+ super(valueAsString);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerDateTime.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerDateTime.java
new file mode 100644
index 0000000..7196707
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerDateTime.java
@@ -0,0 +1,55 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+public class BerDateTime extends BerTime {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.DATE_TIME_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerDateTime() {
+ }
+
+ public BerDateTime(byte[] value) {
+ super(value);
+ }
+
+ public BerDateTime(String valueAsString) throws UnsupportedEncodingException {
+ super(valueAsString);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerDuration.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerDuration.java
new file mode 100644
index 0000000..6203472
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerDuration.java
@@ -0,0 +1,55 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+public class BerDuration extends BerTime {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.DURATION_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerDuration() {
+ }
+
+ public BerDuration(byte[] value) {
+ super(value);
+ }
+
+ public BerDuration(String valueAsString) throws UnsupportedEncodingException {
+ super(valueAsString);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerEmbeddedPdv.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerEmbeddedPdv.java
new file mode 100644
index 0000000..e9bc9af
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerEmbeddedPdv.java
@@ -0,0 +1,747 @@
+/**
+ * This class file was automatically generated by jASN1 v1.7.2-SNAPSHOT (http://www.openmuc.org)
+ */
+
+package org.onosproject.xran.codecs.ber.types;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.string.BerObjectDescriptor;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+
+public class BerEmbeddedPdv implements Serializable {
+
+ public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 11);
+ private static final long serialVersionUID = 1L;
+ @JsonIgnore public byte[] code = null;
+ private Identification identification = null;
+ private BerObjectDescriptor dataValueDescriptor = null;
+ private BerOctetString dataValue = null;
+ public BerEmbeddedPdv() {
+ }
+
+ public BerEmbeddedPdv(byte[] code) {
+ this.code = code;
+ }
+
+ public Identification getIdentification() {
+ return identification;
+ }
+
+ public void setIdentification(Identification identification) {
+ this.identification = identification;
+ }
+
+ public BerObjectDescriptor getDataValueDescriptor() {
+ return dataValueDescriptor;
+ }
+
+ public void setDataValueDescriptor(BerObjectDescriptor dataValueDescriptor) {
+ this.dataValueDescriptor = dataValueDescriptor;
+ }
+
+ public BerOctetString getDataValue() {
+ return dataValue;
+ }
+
+ public void setDataValue(BerOctetString dataValue) {
+ this.dataValue = dataValue;
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ if (code != null) {
+ for (int i = code.length - 1; i >= 0; i--) {
+ os.write(code[i]);
+ }
+ if (withTag) {
+ return tag.encode(os) + code.length;
+ }
+ return code.length;
+ }
+
+ int codeLength = 0;
+ int sublength;
+
+ codeLength += dataValue.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 2
+ os.write(0x82);
+ codeLength += 1;
+
+ if (dataValueDescriptor != null) {
+ codeLength += dataValueDescriptor.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 1
+ os.write(0x81);
+ codeLength += 1;
+ }
+
+ sublength = identification.encode(os);
+ codeLength += sublength;
+ codeLength += BerLength.encodeLength(os, sublength);
+ // write tag: CONTEXT_CLASS, CONSTRUCTED, 0
+ os.write(0xA0);
+ codeLength += 1;
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+ int codeLength = 0;
+ int subCodeLength = 0;
+ BerTag berTag = new BerTag();
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ int totalLength = length.val;
+ codeLength += totalLength;
+
+ subCodeLength += berTag.decode(is);
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
+ subCodeLength += length.decode(is);
+ identification = new Identification();
+ subCodeLength += identification.decode(is, null);
+ subCodeLength += berTag.decode(is);
+ } else {
+ throw new IOException("Tag does not match the mandatory sequence element tag.");
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
+ dataValueDescriptor = new BerObjectDescriptor();
+ subCodeLength += dataValueDescriptor.decode(is, false);
+ subCodeLength += berTag.decode(is);
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
+ dataValue = new BerOctetString();
+ subCodeLength += dataValue.decode(is, false);
+ if (subCodeLength == totalLength) {
+ return codeLength;
+ }
+ }
+ throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: "
+ + subCodeLength);
+
+ }
+
+ public void encodeAndSave(int encodingSizeGuess) throws IOException {
+ BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
+ encode(os, false);
+ code = os.getArray();
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ appendAsString(sb, 0);
+ return sb.toString();
+ }
+
+ public void appendAsString(StringBuilder sb, int indentLevel) {
+
+ sb.append("{");
+ sb.append("\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ if (identification != null) {
+ sb.append("identification: ");
+ identification.appendAsString(sb, indentLevel + 1);
+ } else {
+ sb.append("identification: <empty-required-field>");
+ }
+
+ if (dataValueDescriptor != null) {
+ sb.append(",\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ sb.append("dataValueDescriptor: ").append(dataValueDescriptor);
+ }
+
+ sb.append(",\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ if (dataValue != null) {
+ sb.append("dataValue: ").append(dataValue);
+ } else {
+ sb.append("dataValue: <empty-required-field>");
+ }
+
+ sb.append("\n");
+ for (int i = 0; i < indentLevel; i++) {
+ sb.append("\t");
+ }
+ sb.append("}");
+ }
+
+ public static class Identification implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @JsonIgnore
+ public byte[] code = null;
+ private Syntaxes syntaxes = null;
+ private BerObjectIdentifier syntax = null;
+ private BerInteger presentationContextId = null;
+ private ContextNegotiation contextNegotiation = null;
+ private BerObjectIdentifier transferSyntax = null;
+ private BerNull fixed = null;
+ public Identification() {
+ }
+ public Identification(byte[] code) {
+ this.code = code;
+ }
+
+ public Syntaxes getSyntaxes() {
+ return syntaxes;
+ }
+
+ public void setSyntaxes(Syntaxes syntaxes) {
+ this.syntaxes = syntaxes;
+ }
+
+ public BerObjectIdentifier getSyntax() {
+ return syntax;
+ }
+
+ public void setSyntax(BerObjectIdentifier syntax) {
+ this.syntax = syntax;
+ }
+
+ public BerInteger getPresentationContextId() {
+ return presentationContextId;
+ }
+
+ public void setPresentationContextId(BerInteger presentationContextId) {
+ this.presentationContextId = presentationContextId;
+ }
+
+ public ContextNegotiation getContextNegotiation() {
+ return contextNegotiation;
+ }
+
+ public void setContextNegotiation(ContextNegotiation contextNegotiation) {
+ this.contextNegotiation = contextNegotiation;
+ }
+
+ public BerObjectIdentifier getTransferSyntax() {
+ return transferSyntax;
+ }
+
+ public void setTransferSyntax(BerObjectIdentifier transferSyntax) {
+ this.transferSyntax = transferSyntax;
+ }
+
+ public BerNull getFixed() {
+ return fixed;
+ }
+
+ public void setFixed(BerNull fixed) {
+ this.fixed = fixed;
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+
+ if (code != null) {
+ for (int i = code.length - 1; i >= 0; i--) {
+ os.write(code[i]);
+ }
+ return code.length;
+ }
+
+ int codeLength = 0;
+ if (fixed != null) {
+ codeLength += fixed.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 5
+ os.write(0x85);
+ codeLength += 1;
+ return codeLength;
+ }
+
+ if (transferSyntax != null) {
+ codeLength += transferSyntax.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 4
+ os.write(0x84);
+ codeLength += 1;
+ return codeLength;
+ }
+
+ if (contextNegotiation != null) {
+ codeLength += contextNegotiation.encode(os, false);
+ // write tag: CONTEXT_CLASS, CONSTRUCTED, 3
+ os.write(0xA3);
+ codeLength += 1;
+ return codeLength;
+ }
+
+ if (presentationContextId != null) {
+ codeLength += presentationContextId.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 2
+ os.write(0x82);
+ codeLength += 1;
+ return codeLength;
+ }
+
+ if (syntax != null) {
+ codeLength += syntax.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 1
+ os.write(0x81);
+ codeLength += 1;
+ return codeLength;
+ }
+
+ if (syntaxes != null) {
+ codeLength += syntaxes.encode(os, false);
+ // write tag: CONTEXT_CLASS, CONSTRUCTED, 0
+ os.write(0xA0);
+ codeLength += 1;
+ return codeLength;
+ }
+
+ throw new IOException("Error encoding CHOICE: No element of CHOICE was selected.");
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, null);
+ }
+
+ public int decode(InputStream is, BerTag berTag) throws IOException {
+
+ int codeLength = 0;
+ BerTag passedTag = berTag;
+
+ if (berTag == null) {
+ berTag = new BerTag();
+ codeLength += berTag.decode(is);
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 0)) {
+ syntaxes = new Syntaxes();
+ codeLength += syntaxes.decode(is, false);
+ return codeLength;
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
+ syntax = new BerObjectIdentifier();
+ codeLength += syntax.decode(is, false);
+ return codeLength;
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
+ presentationContextId = new BerInteger();
+ codeLength += presentationContextId.decode(is, false);
+ return codeLength;
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 3)) {
+ contextNegotiation = new ContextNegotiation();
+ codeLength += contextNegotiation.decode(is, false);
+ return codeLength;
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) {
+ transferSyntax = new BerObjectIdentifier();
+ codeLength += transferSyntax.decode(is, false);
+ return codeLength;
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 5)) {
+ fixed = new BerNull();
+ codeLength += fixed.decode(is, false);
+ return codeLength;
+ }
+
+ if (passedTag != null) {
+ return 0;
+ }
+
+ throw new IOException("Error decoding CHOICE: Tag " + berTag + " matched to no item.");
+ }
+
+ public void encodeAndSave(int encodingSizeGuess) throws IOException {
+ BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
+ encode(os);
+ code = os.getArray();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ appendAsString(sb, 0);
+ return sb.toString();
+ }
+
+ public void appendAsString(StringBuilder sb, int indentLevel) {
+
+ if (syntaxes != null) {
+ sb.append("syntaxes: ");
+ syntaxes.appendAsString(sb, indentLevel + 1);
+ return;
+ }
+
+ if (syntax != null) {
+ sb.append("syntax: ").append(syntax);
+ return;
+ }
+
+ if (presentationContextId != null) {
+ sb.append("presentationContextId: ").append(presentationContextId);
+ return;
+ }
+
+ if (contextNegotiation != null) {
+ sb.append("contextNegotiation: ");
+ contextNegotiation.appendAsString(sb, indentLevel + 1);
+ return;
+ }
+
+ if (transferSyntax != null) {
+ sb.append("transferSyntax: ").append(transferSyntax);
+ return;
+ }
+
+ if (fixed != null) {
+ sb.append("fixed: ").append(fixed);
+ return;
+ }
+
+ sb.append("<none>");
+ }
+
+ public static class Syntaxes implements Serializable {
+
+ public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ private static final long serialVersionUID = 1L;
+ @JsonIgnore public byte[] code = null;
+ private BerObjectIdentifier abstract_ = null;
+ private BerObjectIdentifier transfer = null;
+
+ public Syntaxes() {
+ }
+
+ public Syntaxes(byte[] code) {
+ this.code = code;
+ }
+
+ public BerObjectIdentifier getAbstract() {
+ return abstract_;
+ }
+
+ public void setAbstract(BerObjectIdentifier abstract_) {
+ this.abstract_ = abstract_;
+ }
+
+ public BerObjectIdentifier getTransfer() {
+ return transfer;
+ }
+
+ public void setTransfer(BerObjectIdentifier transfer) {
+ this.transfer = transfer;
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ if (code != null) {
+ for (int i = code.length - 1; i >= 0; i--) {
+ os.write(code[i]);
+ }
+ if (withTag) {
+ return tag.encode(os) + code.length;
+ }
+ return code.length;
+ }
+
+ int codeLength = 0;
+ codeLength += transfer.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 1
+ os.write(0x81);
+ codeLength += 1;
+
+ codeLength += abstract_.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 0
+ os.write(0x80);
+ codeLength += 1;
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+ int codeLength = 0;
+ int subCodeLength = 0;
+ BerTag berTag = new BerTag();
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ int totalLength = length.val;
+ codeLength += totalLength;
+
+ subCodeLength += berTag.decode(is);
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
+ abstract_ = new BerObjectIdentifier();
+ subCodeLength += abstract_.decode(is, false);
+ subCodeLength += berTag.decode(is);
+ } else {
+ throw new IOException("Tag does not match the mandatory sequence element tag.");
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
+ transfer = new BerObjectIdentifier();
+ subCodeLength += transfer.decode(is, false);
+ if (subCodeLength == totalLength) {
+ return codeLength;
+ }
+ }
+ throw new IOException("Unexpected end of sequence, length tag: " + totalLength
+ + ", actual sequence length: " + subCodeLength);
+
+ }
+
+ public void encodeAndSave(int encodingSizeGuess) throws IOException {
+ BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
+ encode(os, false);
+ code = os.getArray();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ appendAsString(sb, 0);
+ return sb.toString();
+ }
+
+ public void appendAsString(StringBuilder sb, int indentLevel) {
+
+ sb.append("{");
+ sb.append("\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ if (abstract_ != null) {
+ sb.append("abstract_: ").append(abstract_);
+ } else {
+ sb.append("abstract_: <empty-required-field>");
+ }
+
+ sb.append(",\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ if (transfer != null) {
+ sb.append("transfer: ").append(transfer);
+ } else {
+ sb.append("transfer: <empty-required-field>");
+ }
+
+ sb.append("\n");
+ for (int i = 0; i < indentLevel; i++) {
+ sb.append("\t");
+ }
+ sb.append("}");
+ }
+
+ }
+
+ public static class ContextNegotiation implements Serializable {
+
+ public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ private static final long serialVersionUID = 1L;
+ @JsonIgnore public byte[] code = null;
+ private BerInteger presentationContextId = null;
+ private BerObjectIdentifier transferSyntax = null;
+
+ public ContextNegotiation() {
+ }
+
+ public ContextNegotiation(byte[] code) {
+ this.code = code;
+ }
+
+ public BerInteger getPresentationContextId() {
+ return presentationContextId;
+ }
+
+ public void setPresentationContextId(BerInteger presentationContextId) {
+ this.presentationContextId = presentationContextId;
+ }
+
+ public BerObjectIdentifier getTransferSyntax() {
+ return transferSyntax;
+ }
+
+ public void setTransferSyntax(BerObjectIdentifier transferSyntax) {
+ this.transferSyntax = transferSyntax;
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ if (code != null) {
+ for (int i = code.length - 1; i >= 0; i--) {
+ os.write(code[i]);
+ }
+ if (withTag) {
+ return tag.encode(os) + code.length;
+ }
+ return code.length;
+ }
+
+ int codeLength = 0;
+ codeLength += transferSyntax.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 1
+ os.write(0x81);
+ codeLength += 1;
+
+ codeLength += presentationContextId.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 0
+ os.write(0x80);
+ codeLength += 1;
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+ int codeLength = 0;
+ int subCodeLength = 0;
+ BerTag berTag = new BerTag();
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ int totalLength = length.val;
+ codeLength += totalLength;
+
+ subCodeLength += berTag.decode(is);
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
+ presentationContextId = new BerInteger();
+ subCodeLength += presentationContextId.decode(is, false);
+ subCodeLength += berTag.decode(is);
+ } else {
+ throw new IOException("Tag does not match the mandatory sequence element tag.");
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 1)) {
+ transferSyntax = new BerObjectIdentifier();
+ subCodeLength += transferSyntax.decode(is, false);
+ if (subCodeLength == totalLength) {
+ return codeLength;
+ }
+ }
+ throw new IOException("Unexpected end of sequence, length tag: " + totalLength
+ + ", actual sequence length: " + subCodeLength);
+
+ }
+
+ public void encodeAndSave(int encodingSizeGuess) throws IOException {
+ BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
+ encode(os, false);
+ code = os.getArray();
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ appendAsString(sb, 0);
+ return sb.toString();
+ }
+
+ public void appendAsString(StringBuilder sb, int indentLevel) {
+
+ sb.append("{");
+ sb.append("\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ if (presentationContextId != null) {
+ sb.append("presentationContextId: ").append(presentationContextId);
+ } else {
+ sb.append("presentationContextId: <empty-required-field>");
+ }
+
+ sb.append(",\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ if (transferSyntax != null) {
+ sb.append("transferSyntax: ").append(transferSyntax);
+ } else {
+ sb.append("transferSyntax: <empty-required-field>");
+ }
+
+ sb.append("\n");
+ for (int i = 0; i < indentLevel; i++) {
+ sb.append("\t");
+ }
+ sb.append("}");
+ }
+
+ }
+
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerEnum.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerEnum.java
new file mode 100644
index 0000000..ea97be5
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerEnum.java
@@ -0,0 +1,59 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.math.BigInteger;
+
+public class BerEnum extends BerInteger {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.ENUMERATED_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerEnum() {
+ }
+
+ public BerEnum(byte[] code) {
+ this.code = code;
+ }
+
+ public BerEnum(BigInteger val) {
+ this.value = val;
+ }
+
+ public BerEnum(long val) {
+ this.value = BigInteger.valueOf(val);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerGeneralizedTime.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerGeneralizedTime.java
new file mode 100644
index 0000000..00f3340
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerGeneralizedTime.java
@@ -0,0 +1,133 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.string.BerVisibleString;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class BerGeneralizedTime extends BerVisibleString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.GENERALIZED_TIME_TAG);
+ private static final long serialVersionUID = 1L;
+ /*
+ * Generalized time is one of the following (ITU-T X.680 08/2015): YYYYMMDDHH[MM[SS]][.fff] LocalTime
+ * YYYYMMDDHH[MM[SS]][.fff]Z UTC YYYYMMDDHH[MM[SS]][.fff]+-HH[MM] local time with time zone
+ *
+ * Regexp: ^ (?<year>\\d{4}) YYYY (?<month>\\d{2}) MM (?<day>\\d{2}) DD (?<hour>\\d{2}) HH ( [MM[SS]]
+ * (?<minute>\\d{2}) MM (?<second>\\d{2})? [SS] )? ([.,](?<frac>\\d+))? [.fff] (or [,fff]) (?<timezone> "" or "Z" or
+ * "+-HH[MM]" Z | ( "+-HH[MM]" [+-] "+-" \\d{2}(?<tzmin>\\d{2})? HH[MM] ) )? $
+ */
+ private final static String GENERALIZED_TIME_PATTERN = "^(?<year>\\d{4})(?<month>\\d{2})(?<day>\\d{2})(?<hour>\\d{2})((?<minute>\\d{2})(?<second>\\d{2})?)?([.,](?<frac>\\d+))?(?<timezone>Z|([+-]\\d{2}(?<tzmin>\\d{2})?))?$";
+ private final static Pattern generalizedTimePattern = Pattern.compile(GENERALIZED_TIME_PATTERN);
+
+ public BerGeneralizedTime() {
+ }
+
+ public BerGeneralizedTime(byte[] value) {
+ super(value);
+ }
+
+ public BerGeneralizedTime(String valueAsString) {
+ super(valueAsString);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+ Calendar asCalendar() throws ParseException {
+
+ Matcher matcher = generalizedTimePattern.matcher(toString());
+
+ if (!matcher.find()) {
+ throw new ParseException("", 0);
+ }
+
+ String mg, mgf;
+ int year = Integer.valueOf(matcher.group("year"));
+ int month = Integer.valueOf(matcher.group("month"));
+ month -= 1; // java.util.Calendar's month goes from 0 to 11
+ int day = Integer.valueOf(matcher.group("day"));
+ int hour = Integer.valueOf(matcher.group("hour"));
+
+ mg = matcher.group("minute");
+ mgf = matcher.group("frac");
+ int minute = 0, second = 0, millisec = 0;
+ double frac = mgf == null ? 0 : Double.valueOf("0." + mgf);
+ if (mg == null) {
+ // Missing minutes and seconds
+ if (mgf != null) {
+ // frac is a fraction of a hour
+ millisec = (int) Math.round(1000 * 60 * 60 * frac);
+ }
+ } else {
+ minute = Integer.valueOf(mg);
+ mg = matcher.group("second");
+ if (mg == null) {
+ // Missing seconds
+ if (mgf != null) {
+ // frac is a fraction of a minute
+ millisec = (int) Math.round(1000 * 60 * frac);
+ }
+ } else {
+ second = Integer.valueOf(mg);
+ if (mgf != null) {
+ // frac is a fraction of a second
+ millisec = (int) Math.round(1000 * frac);
+ }
+ }
+ }
+
+ mg = matcher.group("timezone");
+ String mgt = matcher.group("tzmin");
+ String timeZoneStr = mg == null ? TimeZone.getDefault().getID()
+ : (mg.equals("Z") ? "UTC" : (mgt == null ? "GMT" + mg + "00" : "GMT" + mg));
+ TimeZone timeZone = TimeZone.getTimeZone(timeZoneStr);
+
+ Calendar calendar = Calendar.getInstance();
+ calendar.setLenient(true); // accept millisec greater than 999
+ calendar.set(year, month, day, hour, minute, second);
+ calendar.set(Calendar.MILLISECOND, millisec);
+ calendar.setTimeZone(timeZone);
+
+ return calendar;
+ }
+
+ Date asDate() throws ParseException {
+ return asCalendar().getTime();
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerInteger.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerInteger.java
new file mode 100644
index 0000000..c22cd4d
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerInteger.java
@@ -0,0 +1,128 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.internal.Util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.math.BigInteger;
+
+public class BerInteger implements Serializable {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.INTEGER_TAG);
+ private static final long serialVersionUID = 1L;
+ @JsonIgnore
+ public byte[] code = null;
+
+ public BigInteger value;
+
+ public BerInteger() {
+ }
+
+ public BerInteger(byte[] code) {
+ this.code = code;
+ }
+
+ public BerInteger(BigInteger val) {
+ this.value = val;
+ }
+
+ public BerInteger(long val) {
+ this.value = BigInteger.valueOf(val);
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ if (code != null) {
+ for (int i = code.length - 1; i >= 0; i--) {
+ os.write(code[i]);
+ }
+ if (withTag) {
+ return tag.encode(os) + code.length;
+ }
+ return code.length;
+ }
+
+ byte[] encoded = value.toByteArray();
+ int codeLength = encoded.length;
+ os.write(encoded);
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ if (length.val < 1) {
+ throw new IOException("Decoded length of BerInteger is not correct");
+ }
+
+ byte[] byteCode = new byte[length.val];
+ Util.readFully(is, byteCode);
+
+ codeLength += length.val;
+
+ value = new BigInteger(byteCode);
+
+ return codeLength;
+ }
+
+ public void encodeAndSave(int encodingSizeGuess) throws IOException {
+ BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
+ encode(os, false);
+ code = os.getArray();
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return "" + value;
+ }
+
+ public byte byteValue() {
+ return value.byteValue();
+ }
+
+ public short shortValue() {
+ return value.shortValue();
+ }
+
+ public int intValue() {
+ return value.intValue();
+ }
+
+ public long longValue() {
+ return value.longValue();
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerNull.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerNull.java
new file mode 100644
index 0000000..6437d0b
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerNull.java
@@ -0,0 +1,72 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+
+public class BerNull implements Serializable {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.NULL_TAG);
+ private static final long serialVersionUID = 1L;
+ @JsonIgnore
+ public byte[] code = null;
+
+ public BerNull() {
+ }
+
+ public BerNull(byte[] code) {
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = BerLength.encodeLength(os, 0);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ if (length.val != 0) {
+ throw new IOException("Decoded length of BerNull is not correct");
+ }
+
+ return codeLength;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return "ASN1_NULL";
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerObjectIdentifier.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerObjectIdentifier.java
new file mode 100644
index 0000000..d1cf4ba
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerObjectIdentifier.java
@@ -0,0 +1,209 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.internal.Util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+public class BerObjectIdentifier implements Serializable {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.OBJECT_IDENTIFIER_TAG);
+ private static final long serialVersionUID = 1L;
+ @JsonIgnore
+ public byte[] code = null;
+
+ public int[] value;
+
+ public BerObjectIdentifier() {
+ }
+
+ public BerObjectIdentifier(byte[] code) {
+ this.code = code;
+ }
+
+ public BerObjectIdentifier(int[] value) {
+ if ((value.length < 2) || ((value[0] == 0 || value[0] == 1) && (value[1] > 39)) || value[0] > 2) {
+ throw new IllegalArgumentException("invalid object identifier components");
+ }
+ for (int objectIdentifierComponent : value) {
+ if (objectIdentifierComponent < 0) {
+ throw new IllegalArgumentException("invalid object identifier components");
+ }
+ }
+
+ this.value = value;
+
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ if (code != null) {
+ for (int i = code.length - 1; i >= 0; i--) {
+ os.write(code[i]);
+ }
+ if (withTag) {
+ return tag.encode(os) + code.length;
+ }
+ return code.length;
+ }
+
+ int firstSubidentifier = 40 * value[0] + value[1];
+
+ int subidentifier;
+
+ int codeLength = 0;
+
+ for (int i = (value.length - 1); i > 0; i--) {
+
+ if (i == 1) {
+ subidentifier = firstSubidentifier;
+ } else {
+ subidentifier = value[i];
+ }
+
+ // get length of subidentifier
+ int subIDLength = 1;
+ while (subidentifier > (Math.pow(2, (7 * subIDLength)) - 1)) {
+ subIDLength++;
+ }
+
+ os.write(subidentifier & 0x7f);
+
+ for (int j = 1; j <= (subIDLength - 1); j++) {
+ os.write(((subidentifier >> (7 * j)) & 0xff) | 0x80);
+ }
+
+ codeLength += subIDLength;
+ }
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ if (length.val == 0) {
+ value = new int[0];
+ return codeLength;
+ }
+
+ byte[] byteCode = new byte[length.val];
+ Util.readFully(is, byteCode);
+
+ codeLength += length.val;
+
+ List<Integer> objectIdentifierComponentsList = new ArrayList<>();
+
+ int subIDEndIndex = 0;
+ while ((byteCode[subIDEndIndex] & 0x80) == 0x80) {
+ if (subIDEndIndex >= (length.val - 1)) {
+ throw new IOException("Invalid Object Identifier");
+ }
+ subIDEndIndex++;
+ }
+
+ int subidentifier = 0;
+ for (int i = 0; i <= subIDEndIndex; i++) {
+ subidentifier |= (byteCode[i] << ((subIDEndIndex - i) * 7));
+ }
+
+ if (subidentifier < 40) {
+ objectIdentifierComponentsList.add(0);
+ objectIdentifierComponentsList.add(subidentifier);
+ } else if (subidentifier < 80) {
+ objectIdentifierComponentsList.add(1);
+ objectIdentifierComponentsList.add(subidentifier - 40);
+ } else {
+ objectIdentifierComponentsList.add(2);
+ objectIdentifierComponentsList.add(subidentifier - 80);
+ }
+
+ subIDEndIndex++;
+
+ while (subIDEndIndex < length.val) {
+ int subIDStartIndex = subIDEndIndex;
+
+ while ((byteCode[subIDEndIndex] & 0x80) == 0x80) {
+ if (subIDEndIndex == (length.val - 1)) {
+ throw new IOException("Invalid Object Identifier");
+ }
+ subIDEndIndex++;
+ }
+ subidentifier = 0;
+ for (int j = subIDStartIndex; j <= subIDEndIndex; j++) {
+ subidentifier |= ((byteCode[j] & 0x7f) << ((subIDEndIndex - j) * 7));
+ }
+ objectIdentifierComponentsList.add(subidentifier);
+ subIDEndIndex++;
+ }
+
+ value = new int[objectIdentifierComponentsList.size()];
+ for (int i = 0; i < objectIdentifierComponentsList.size(); i++) {
+ value[i] = objectIdentifierComponentsList.get(i);
+ }
+
+ return codeLength;
+
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ if (value == null || value.length == 0) {
+ return "";
+ }
+
+ String objIDString = "";
+ objIDString += value[0];
+ for (int i = 1; i < value.length; i++) {
+ objIDString += "." + value[i];
+ }
+ return objIDString;
+ }
+
+ public BerObjectIdentifier append(int value) {
+ if (this.value == null) {
+ return new BerObjectIdentifier(new int[]{value});
+ }
+ int[] values = new int[this.value.length + 1];
+ for (int i = 0; i < this.value.length; ++i) {
+ values[i] = this.value[i];
+ }
+ values[values.length - 1] = value;
+ return new BerObjectIdentifier(values);
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerOctetString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerOctetString.java
new file mode 100644
index 0000000..906e060
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerOctetString.java
@@ -0,0 +1,81 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.internal.Util;
+import org.onosproject.xran.codecs.util.HexConverter;
+
+import javax.xml.bind.DatatypeConverter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+
+public class BerOctetString implements Serializable {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.OCTET_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+ public byte[] value;
+
+ public BerOctetString() {
+ }
+
+ public BerOctetString(byte[] value) {
+ this.value = value;
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ os.write(value);
+ int codeLength = value.length;
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ value = new byte[length.val];
+
+ if (length.val != 0) {
+ Util.readFully(is, value);
+ codeLength += length.val;
+ }
+
+ return codeLength;
+
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return DatatypeConverter.printHexBinary(value);
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerReal.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerReal.java
new file mode 100644
index 0000000..08f8d06
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerReal.java
@@ -0,0 +1,233 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.internal.Util;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.math.BigInteger;
+
+public class BerReal implements Serializable {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.REAL_TAG);
+ private static final long serialVersionUID = 1L;
+ @JsonIgnore
+ public byte[] code = null;
+
+ public double value;
+
+ public BerReal() {
+ }
+
+ public BerReal(byte[] code) {
+ this.code = code;
+ }
+
+ public BerReal(double value) {
+ this.value = value;
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ if (code != null) {
+ for (int i = code.length - 1; i >= 0; i--) {
+ os.write(code[i]);
+ }
+ if (withTag) {
+ return tag.encode(os) + code.length;
+ }
+ return code.length;
+ }
+
+ int codeLength = encodeValue(os);
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ private int encodeValue(BerByteArrayOutputStream os) throws IOException {
+
+ // explained in Annex C and Ch. 8.5 of X.690
+
+ // we use binary encoding, with base 2 and F==0
+ // F is only needed when encoding with base 8 or 16
+
+ long longBits = Double.doubleToLongBits(value);
+
+ boolean isNegative = (longBits & 0x8000000000000000L) == 0x8000000000000000L;
+
+ int exponent = ((int) (longBits >> 52)) & 0x7ff;
+
+ long mantissa = (longBits & 0x000fffffffffffffL) | 0x0010000000000000L;
+
+ if (exponent == 0x7ff) {
+ if (mantissa == 0x0010000000000000L) {
+ if (isNegative) {
+ // - infinity
+ os.write(0x41);
+ } else {
+ // + infinity
+ os.write(0x40);
+ }
+ return 1;
+ } else {
+ throw new IOException("NAN not supported");
+ }
+ }
+
+ if ((exponent == 0 && mantissa == 0x0010000000000000L)) {
+ // zero
+ return 0;
+ }
+
+ // because IEEE double-precision format is (-1)^sign * 1.b51b50..b0 * 2^(e-1023) we need to subtract 1023 and 52
+ // from the exponent to get an exponent corresponding to an integer matissa as need here.
+ exponent -= 1075; // 1023 + 52 = 1075
+
+ // trailing zeros of the mantissa should be removed. Therefor find out how much the mantissa can be shifted and
+ // the exponent can be increased
+ int exponentIncr = 0;
+ while (((mantissa >> exponentIncr) & 0xff) == 0x00) {
+ exponentIncr += 8;
+ }
+ while (((mantissa >> exponentIncr) & 0x01) == 0x00) {
+ exponentIncr++;
+ }
+
+ exponent += exponentIncr;
+ mantissa >>= exponentIncr;
+
+ int mantissaLength = (Long.SIZE - Long.numberOfLeadingZeros(mantissa) + 7) / 8;
+
+ for (int i = 0; i < mantissaLength; i++) {
+ os.write((int) (mantissa >> (8 * i)));
+ }
+ int codeLength = mantissaLength;
+
+ byte[] exponentBytes = BigInteger.valueOf(exponent).toByteArray();
+ os.write(exponentBytes);
+ codeLength += exponentBytes.length;
+
+ byte exponentFormat = 0;
+ if (exponentBytes.length < 4) {
+ exponentFormat = (byte) (exponentBytes.length - 1);
+ } else {
+ os.write(exponentBytes.length);
+ codeLength++;
+ exponentFormat = 0x03;
+ }
+
+ if (isNegative) {
+ os.write(0x80 | 0x40 | exponentFormat);
+ } else {
+ os.write(0x80 | exponentFormat);
+ }
+
+ codeLength++;
+
+ return codeLength;
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ if (length.val == 0) {
+ value = 0;
+ return codeLength;
+ }
+
+ if (length.val == 1) {
+ int nextByte = is.read();
+ if (nextByte == -1) {
+ throw new EOFException("Unexpected end of input stream.");
+ }
+ if (nextByte == 0x40) {
+ value = Double.POSITIVE_INFINITY;
+ } else if (nextByte == 0x41) {
+ value = Double.NEGATIVE_INFINITY;
+ } else {
+ throw new IOException("invalid real encoding");
+ }
+ return codeLength + 1;
+ }
+
+ byte[] byteCode = new byte[length.val];
+ Util.readFully(is, byteCode);
+
+ if ((byteCode[0] & 0x80) != 0x80) {
+ throw new IOException("Only binary REAL encoding is supported");
+ }
+
+ codeLength += length.val;
+ int tempLength = 1;
+
+ int sign = 1;
+ if ((byteCode[0] & 0x40) == 0x40) {
+ sign = -1;
+ }
+
+ int exponentLength = (byteCode[0] & 0x03) + 1;
+ if (exponentLength == 4) {
+ exponentLength = byteCode[1];
+ tempLength++;
+ }
+
+ tempLength += exponentLength;
+
+ int exponent = 0;
+ for (int i = 0; i < exponentLength; i++) {
+ exponent |= byteCode[1 + i] << (8 * (exponentLength - i - 1));
+ }
+
+ long mantissa = 0;
+ for (int i = 0; i < length.val - tempLength; i++) {
+ mantissa |= (byteCode[i + tempLength] & 0xffL) << (8 * (length.val - tempLength - i - 1));
+ }
+
+ value = sign * mantissa * Math.pow(2, exponent);
+
+ return codeLength;
+ }
+
+ public void encodeAndSave(int encodingSizeGuess) throws IOException {
+ BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
+ encode(os, false);
+ code = os.getArray();
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return "" + value;
+ }
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerTime.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerTime.java
new file mode 100644
index 0000000..cfd8d65
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerTime.java
@@ -0,0 +1,56 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.string.BerVisibleString;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+public class BerTime extends BerVisibleString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.TIME_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerTime() {
+ }
+
+ public BerTime(byte[] value) {
+ super(value);
+ }
+
+ public BerTime(String valueAsString) throws UnsupportedEncodingException {
+ super(valueAsString);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerTimeOfDay.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerTimeOfDay.java
new file mode 100644
index 0000000..d592a72
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerTimeOfDay.java
@@ -0,0 +1,55 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+public class BerTimeOfDay extends BerTime {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.TIME_OF_DAY_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerTimeOfDay() {
+ }
+
+ public BerTimeOfDay(byte[] value) {
+ super(value);
+ }
+
+ public BerTimeOfDay(String valueAsString) throws UnsupportedEncodingException {
+ super(valueAsString);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/BerUtcTime.java b/src/main/java/org.onosproject.xran/codecs/ber/types/BerUtcTime.java
new file mode 100644
index 0000000..2cfc6b5
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/BerUtcTime.java
@@ -0,0 +1,107 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types;
+
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.string.BerVisibleString;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.TimeZone;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class BerUtcTime extends BerVisibleString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.UTC_TIME_TAG);
+ private static final long serialVersionUID = 1L;
+ /*
+ * UTC time is one of the following (ITU-T X.680 08/2015): YYMMDDhhmm[ss]Z YYMMDDhhmm[ss](+|-)hhmm Regexp: ^
+ * (?<year>\\d{2}) YY (?<month>\\d{2}) MM (?<day>\\d{2}) DD (?<hour>\\d{2}) hh (?<minute>\\d{2}) mm
+ * (?<second>\\d{2})? ss (?<timezone> Z | Z or (+|-)hhmm ( [+-]\\d{4} (+|-)hhmm ) ) $
+ */
+ private final static String UTC_TIME_PATTERN = "^(?<year>\\d{2})(?<month>\\d{2})(?<day>\\d{2})(?<hour>\\d{2})(?<minute>\\d{2})(?<second>\\d{2})?(?<timezone>Z|([+-]\\d{4}))$";
+ private final static Pattern utcTimePattern = Pattern.compile(UTC_TIME_PATTERN);
+
+ public BerUtcTime() {
+ }
+
+ public BerUtcTime(byte[] value) {
+ this.value = value;
+ }
+
+ public BerUtcTime(String valueAsString) {
+ super(valueAsString);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+ @SuppressWarnings("WeakerAccess")
+ Calendar asCalendar() throws ParseException {
+
+ Matcher matcher = utcTimePattern.matcher(toString());
+
+ if (!matcher.find())
+ throw new ParseException("", 0);
+
+ String mg;
+ int year = Integer.valueOf(matcher.group("year"));
+ int month = Integer.valueOf(matcher.group("month"));
+ month -= 1; // java.util.Calendar's month goes from 0 to 11
+ int day = Integer.valueOf(matcher.group("day"));
+ int hour = Integer.valueOf(matcher.group("hour"));
+ int minute = Integer.valueOf(matcher.group("minute"));
+ mg = matcher.group("second");
+ int second = mg == null ? 0 : Integer.valueOf(mg);
+
+ mg = matcher.group("timezone");
+ String timeZoneStr = mg.equals("Z") ? "UTC" : "GMT" + mg;
+ TimeZone timeZone = TimeZone.getTimeZone(timeZoneStr);
+
+ Calendar calendar = Calendar.getInstance(timeZone);
+
+ // Add 2000 to the year
+ int century = (calendar.get(Calendar.YEAR) / 100) * 100;
+ year += century;
+
+ // noinspection MagicConstant
+ calendar.set(year, month, day, hour, minute, second);
+ calendar.set(Calendar.MILLISECOND, 0);
+
+ return calendar;
+ }
+
+ Date asDate() throws ParseException {
+ return asCalendar().getTime();
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerBMPString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerBMPString.java
new file mode 100644
index 0000000..5f36c5a
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerBMPString.java
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class BerBMPString extends BerOctetString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.BMP_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerBMPString() {
+ }
+
+ public BerBMPString(byte[] value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return new String(value);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerGeneralString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerGeneralString.java
new file mode 100644
index 0000000..1c89db5
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerGeneralString.java
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class BerGeneralString extends BerOctetString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.GENERAL_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerGeneralString() {
+ }
+
+ public BerGeneralString(byte[] value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return new String(value);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerGraphicString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerGraphicString.java
new file mode 100644
index 0000000..ef70e72
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerGraphicString.java
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class BerGraphicString extends BerOctetString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.GRAPHIC_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerGraphicString() {
+ }
+
+ public BerGraphicString(byte[] value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return new String(value);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerIA5String.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerIA5String.java
new file mode 100644
index 0000000..a56240e
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerIA5String.java
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class BerIA5String extends BerOctetString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.IA5_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerIA5String() {
+ }
+
+ public BerIA5String(byte[] value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return new String(value);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerNumericString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerNumericString.java
new file mode 100644
index 0000000..944b66d
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerNumericString.java
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class BerNumericString extends BerOctetString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.NUMERIC_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerNumericString() {
+ }
+
+ public BerNumericString(byte[] value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return new String(value);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerObjectDescriptor.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerObjectDescriptor.java
new file mode 100644
index 0000000..2b80cb0
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerObjectDescriptor.java
@@ -0,0 +1,51 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class BerObjectDescriptor extends BerGraphicString {
+
+ public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.OBJECT_DESCRIPTOR_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerObjectDescriptor() {
+ }
+
+ public BerObjectDescriptor(byte[] value) {
+ super(value);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength;
+
+ codeLength = super.encode(os, false);
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerPrintableString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerPrintableString.java
new file mode 100644
index 0000000..d865dcb
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerPrintableString.java
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class BerPrintableString extends BerOctetString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.PRINTABLE_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerPrintableString() {
+ }
+
+ public BerPrintableString(byte[] value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return new String(value);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerTeletexString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerTeletexString.java
new file mode 100644
index 0000000..78e483b
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerTeletexString.java
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class BerTeletexString extends BerOctetString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.TELETEX_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerTeletexString() {
+ }
+
+ public BerTeletexString(byte[] value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return new String(value);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerUTF8String.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerUTF8String.java
new file mode 100644
index 0000000..7b107a4
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerUTF8String.java
@@ -0,0 +1,67 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
+public class BerUTF8String extends BerOctetString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.UTF8_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerUTF8String() {
+ }
+
+ public BerUTF8String(byte[] value) {
+ this.value = value;
+ }
+
+ public BerUTF8String(String valueAsString) throws UnsupportedEncodingException {
+ value = valueAsString.getBytes("UTF-8");
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ try {
+ return new String(value, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ return "Unsupported Encoding";
+ }
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerUniversalString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerUniversalString.java
new file mode 100644
index 0000000..06be21c
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerUniversalString.java
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class BerUniversalString extends BerOctetString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.UNIVERSAL_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerUniversalString() {
+ }
+
+ public BerUniversalString(byte[] value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return new String(value);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerVideotexString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerVideotexString.java
new file mode 100644
index 0000000..e67d8ca
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerVideotexString.java
@@ -0,0 +1,58 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerOctetString;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class BerVideotexString extends BerOctetString {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.VIDEOTEX_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+
+ public BerVideotexString() {
+ }
+
+ public BerVideotexString(byte[] value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return new String(value);
+ }
+
+ @Override
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ int codeLength = super.encode(os, false);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ @Override
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ codeLength += super.decode(is, false);
+
+ return codeLength;
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerVisibleString.java b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerVisibleString.java
new file mode 100644
index 0000000..ca7bfb3
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/ber/types/string/BerVisibleString.java
@@ -0,0 +1,83 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+package org.onosproject.xran.codecs.ber.types.string;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.internal.Util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+
+public class BerVisibleString implements Serializable {
+
+ public final static BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.PRIMITIVE, BerTag.VISIBLE_STRING_TAG);
+ private static final long serialVersionUID = 1L;
+ public byte[] value;
+
+ public BerVisibleString() {
+ }
+
+ public BerVisibleString(byte[] value) {
+ this.value = value;
+ }
+
+ public BerVisibleString(String valueAsString) {
+ value = valueAsString.getBytes();
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ os.write(value);
+ int codeLength = value.length;
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
+ if (withTag) {
+ codeLength += tag.encode(os);
+ }
+
+ return codeLength;
+ }
+
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
+ }
+
+ public int decode(InputStream is, boolean withTag) throws IOException {
+
+ int codeLength = 0;
+
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
+ }
+
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
+
+ value = new byte[length.val];
+
+ if (length.val != 0) {
+ Util.readFully(is, value);
+ codeLength += length.val;
+ }
+
+ return codeLength;
+
+ }
+
+ @JsonValue
+ @Override
+ public String toString() {
+ return new String(value);
+ }
+
+}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionRequest.java b/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionRequest.java
index 7f86f7c..7fa0f40 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionRequest.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionRequest.java
@@ -4,10 +4,11 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.ERABParams;
@@ -23,6 +24,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -217,7 +219,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -225,7 +227,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -234,7 +236,7 @@
sb.append("\t");
}
if (ueAmbr != null) {
- sb.append("\"ueAmbr\": ");
+ sb.append("ueAmbr: ");
ueAmbr.appendAsString(sb, indentLevel + 1);
}
@@ -243,7 +245,7 @@
sb.append("\t");
}
if (numErabs != null) {
- sb.append("\"numErabs\": ").append(numErabs);
+ sb.append("numErabs: ").append(numErabs);
}
sb.append(",\n");
@@ -251,7 +253,7 @@
sb.append("\t");
}
if (erabParams != null) {
- sb.append("\"erabParams\": ");
+ sb.append("erabParams: ");
erabParams.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionResponse.java b/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionResponse.java
index 15c84e6..a4dfeb0 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionResponse.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionResponse.java
@@ -4,12 +4,13 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.*;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -22,6 +23,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -193,7 +195,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -201,7 +203,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -210,7 +212,7 @@
sb.append("\t");
}
if (numErabList != null) {
- sb.append("\"numErabList\": ").append(numErabList);
+ sb.append("numErabList: ").append(numErabList);
}
sb.append(",\n");
@@ -218,7 +220,7 @@
sb.append("\t");
}
if (erabResponse != null) {
- sb.append("\"erabResponse\": ");
+ sb.append("erabResponse: ");
erabResponse.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionStatus.java b/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionStatus.java
index 16e85e1..f9c6476 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionStatus.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/BearerAdmissionStatus.java
@@ -4,10 +4,11 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.ERABResponse;
@@ -22,6 +23,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -193,7 +195,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -201,7 +203,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -210,7 +212,7 @@
sb.append("\t");
}
if (numErabs != null) {
- sb.append("\"numErabs\": ").append(numErabs);
+ sb.append("numErabs: ").append(numErabs);
}
sb.append(",\n");
@@ -218,7 +220,7 @@
sb.append("\t");
}
if (erabResponse != null) {
- sb.append("\"erabResponse\": ");
+ sb.append("erabResponse: ");
erabResponse.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/BearerReleaseInd.java b/src/main/java/org.onosproject.xran/codecs/pdu/BearerReleaseInd.java
index 89cfa2d..055c8be 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/BearerReleaseInd.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/BearerReleaseInd.java
@@ -4,10 +4,12 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.ERABID;
@@ -28,6 +30,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<ERABID> seqOf = null;
@@ -39,6 +42,7 @@
this.code = code;
}
+ @JsonValue
public List<ERABID> getERABID() {
if (seqOf == null) {
seqOf = new ArrayList<ERABID>();
@@ -151,7 +155,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
private BerInteger numErabs = null;
@@ -322,7 +326,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -330,7 +334,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -339,7 +343,7 @@
sb.append("\t");
}
if (numErabs != null) {
- sb.append("\"numErabs\": ").append(numErabs);
+ sb.append("numErabs: ").append(numErabs);
}
sb.append(",\n");
@@ -347,7 +351,7 @@
sb.append("\t");
}
if (erabIds != null) {
- sb.append("\"erabIds\": ");
+ sb.append("erabIds: ");
erabIds.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigReport.java b/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigReport.java
index c858d2e..c45760d 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigReport.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigReport.java
@@ -4,11 +4,13 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerBoolean;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerBoolean;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import org.onosproject.xran.codecs.api.*;
import java.io.IOException;
@@ -27,6 +29,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<CandScell> seqOf = null;
@@ -38,6 +41,7 @@
this.code = code;
}
+ @JsonValue
public List<CandScell> getCandScells() {
if (seqOf == null) {
seqOf = new ArrayList<CandScell>();
@@ -154,7 +158,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private ECGI ecgi = null;
private PhysCellId pci = null;
private CandScells candScells = null;
@@ -599,7 +603,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -608,7 +612,7 @@
sb.append("\t");
}
if (pci != null) {
- sb.append("\"pci\": ").append(pci);
+ sb.append("pci: ").append(pci);
}
sb.append(",\n");
@@ -616,7 +620,7 @@
sb.append("\t");
}
if (candScells != null) {
- sb.append("\"candScells\": ");
+ sb.append("candScells: ");
candScells.appendAsString(sb, indentLevel + 1);
}
@@ -625,7 +629,7 @@
sb.append("\t");
}
if (earfcnDl != null) {
- sb.append("\"earfcnDl\": ").append(earfcnDl);
+ sb.append("earfcnDl: ").append(earfcnDl);
}
sb.append(",\n");
@@ -633,7 +637,7 @@
sb.append("\t");
}
if (earfcnUl != null) {
- sb.append("\"earfcnUl\": ").append(earfcnUl);
+ sb.append("earfcnUl: ").append(earfcnUl);
}
sb.append(",\n");
@@ -641,7 +645,7 @@
sb.append("\t");
}
if (rbsPerTtiDl != null) {
- sb.append("\"rbsPerTtiDl\": ").append(rbsPerTtiDl);
+ sb.append("rbsPerTtiDl: ").append(rbsPerTtiDl);
}
sb.append(",\n");
@@ -649,7 +653,7 @@
sb.append("\t");
}
if (rbsPerTtiUl != null) {
- sb.append("\"rbsPerTtiUl\": ").append(rbsPerTtiUl);
+ sb.append("rbsPerTtiUl: ").append(rbsPerTtiUl);
}
sb.append(",\n");
@@ -657,7 +661,7 @@
sb.append("\t");
}
if (numTxAntenna != null) {
- sb.append("\"numTxAntenna\": ").append(numTxAntenna);
+ sb.append("numTxAntenna: ").append(numTxAntenna);
}
sb.append(",\n");
@@ -665,7 +669,7 @@
sb.append("\t");
}
if (duplexMode != null) {
- sb.append("\"duplexMode\": ").append(duplexMode);
+ sb.append("duplexMode: ").append(duplexMode);
}
if (tddConfig != null) {
@@ -673,7 +677,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"tddConfig\": ").append(tddConfig);
+ sb.append("tddConfig: ").append(tddConfig);
}
if (tddSplSfConfig != null) {
@@ -681,7 +685,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"tddSplSfConfig\": ").append(tddSplSfConfig);
+ sb.append("tddSplSfConfig: ").append(tddSplSfConfig);
}
sb.append(",\n");
@@ -689,7 +693,7 @@
sb.append("\t");
}
if (maxNumConnectedUes != null) {
- sb.append("\"maxNumConnectedUes\": ").append(maxNumConnectedUes);
+ sb.append("maxNumConnectedUes: ").append(maxNumConnectedUes);
}
sb.append(",\n");
@@ -697,7 +701,7 @@
sb.append("\t");
}
if (maxNumConnectedBearers != null) {
- sb.append("\"maxNumConnectedBearers\": ").append(maxNumConnectedBearers);
+ sb.append("maxNumConnectedBearers: ").append(maxNumConnectedBearers);
}
sb.append(",\n");
@@ -705,7 +709,7 @@
sb.append("\t");
}
if (maxNumUesSchedPerTtiDl != null) {
- sb.append("\"maxNumUesSchedPerTtiDl\": ").append(maxNumUesSchedPerTtiDl);
+ sb.append("maxNumUesSchedPerTtiDl: ").append(maxNumUesSchedPerTtiDl);
}
sb.append(",\n");
@@ -713,7 +717,7 @@
sb.append("\t");
}
if (maxNumUesSchedPerTtiUl != null) {
- sb.append("\"maxNumUesSchedPerTtiUl\": ").append(maxNumUesSchedPerTtiUl);
+ sb.append("maxNumUesSchedPerTtiUl: ").append(maxNumUesSchedPerTtiUl);
}
sb.append(",\n");
@@ -721,7 +725,7 @@
sb.append("\t");
}
if (dlfsSchedEnable != null) {
- sb.append("\"dlfsSchedEnable\": ").append(dlfsSchedEnable);
+ sb.append("dlfsSchedEnable: ").append(dlfsSchedEnable);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigRequest.java b/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigRequest.java
index d2a8b69..4f5e20b 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigRequest.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/CellConfigRequest.java
@@ -4,11 +4,12 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -21,6 +22,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private ECGI ecgi = null;
@@ -123,7 +125,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/HOComplete.java b/src/main/java/org.onosproject.xran/codecs/pdu/HOComplete.java
index 7a4290a..68ae5c1 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/HOComplete.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/HOComplete.java
@@ -4,11 +4,12 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -21,6 +22,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private ECGI ecgiT = null;
private ECGI ecgiS = null;
@@ -169,7 +171,7 @@
sb.append("\t");
}
if (ecgiT != null) {
- sb.append("\"ecgiT\": ");
+ sb.append("ecgiT: ");
ecgiT.appendAsString(sb, indentLevel + 1);
}
@@ -178,7 +180,7 @@
sb.append("\t");
}
if (ecgiS != null) {
- sb.append("\"ecgiS\": ");
+ sb.append("ecgiS: ");
ecgiS.appendAsString(sb, indentLevel + 1);
}
@@ -187,7 +189,7 @@
sb.append("\t");
}
if (crntiNew != null) {
- sb.append("\"crntiNew\": ").append(crntiNew);
+ sb.append("crntiNew: ").append(crntiNew);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/HOFailure.java b/src/main/java/org.onosproject.xran/codecs/pdu/HOFailure.java
index d0d2c90..ac42dcd 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/HOFailure.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/HOFailure.java
@@ -4,12 +4,13 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.HOFailureCause;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -21,6 +22,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -169,7 +171,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -177,7 +179,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -186,7 +188,7 @@
sb.append("\t");
}
if (cause != null) {
- sb.append("\"cause\": ").append(cause);
+ sb.append("cause: ").append(cause);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/HORequest.java b/src/main/java/org.onosproject.xran/codecs/pdu/HORequest.java
index f6a3076..38218d7 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/HORequest.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/HORequest.java
@@ -4,12 +4,13 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -22,6 +23,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgiS = null;
@@ -170,7 +172,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -178,7 +180,7 @@
sb.append("\t");
}
if (ecgiS != null) {
- sb.append("\"ecgiS\": ");
+ sb.append("ecgiS: ");
ecgiS.appendAsString(sb, indentLevel + 1);
}
@@ -187,7 +189,7 @@
sb.append("\t");
}
if (ecgiT != null) {
- sb.append("\"ecgiT\": ");
+ sb.append("ecgiT: ");
ecgiT.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/L2MeasConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/L2MeasConfig.java
index f0de6d1..4e1f958 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/L2MeasConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/L2MeasConfig.java
@@ -4,12 +4,13 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -22,6 +23,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private ECGI ecgi = null;
private BerInteger reportIntervalMs = null;
@@ -147,7 +149,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -156,7 +158,7 @@
sb.append("\t");
}
if (reportIntervalMs != null) {
- sb.append("\"reportIntervalMs\": ").append(reportIntervalMs);
+ sb.append("reportIntervalMs: ").append(reportIntervalMs);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/PDCPMeasReportPerUe.java b/src/main/java/org.onosproject.xran/codecs/pdu/PDCPMeasReportPerUe.java
index d272974..b2ed3a3 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/PDCPMeasReportPerUe.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/PDCPMeasReportPerUe.java
@@ -14,12 +14,14 @@
import java.math.BigInteger;
import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.QCI;
-import org.openmuc.jasn1.ber.*;
-import org.openmuc.jasn1.ber.types.*;
-import org.openmuc.jasn1.ber.types.string.*;
+import org.onosproject.xran.codecs.ber.*;
+import org.onosproject.xran.codecs.ber.types.*;
+import org.onosproject.xran.codecs.ber.types.string.*;
@@ -32,6 +34,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<QCI> seqOf = null;
@@ -43,6 +46,7 @@
this.code = code;
}
+ @JsonValue
public List<QCI> getQCI() {
if (seqOf == null) {
seqOf = new ArrayList<QCI>();
@@ -161,7 +165,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public DataVolDl() {
@@ -172,7 +176,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -290,7 +294,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public DataVolUl() {
@@ -301,7 +305,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -419,7 +423,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public PktDelayDl() {
@@ -430,7 +434,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -548,7 +552,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public PktDelayUl() {
@@ -559,7 +563,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -677,7 +681,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public PktDiscardRateDl() {
@@ -688,7 +692,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -806,7 +810,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public PktLossRateDl() {
@@ -817,7 +821,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -935,7 +939,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public PktLossRateUl() {
@@ -946,7 +950,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -1064,7 +1068,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public ThroughputDl() {
@@ -1075,7 +1079,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -1193,7 +1197,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public ThroughputUl() {
@@ -1204,6 +1208,7 @@
this.code = code;
}
+ @JsonValue
public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
@@ -1319,7 +1324,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private ECGI ecgi = null;
private CRNTI crnti = null;
private QciVals qciVals = null;
@@ -1674,7 +1679,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -1683,7 +1688,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -1691,7 +1696,7 @@
sb.append("\t");
}
if (qciVals != null) {
- sb.append("\"qciVals\": ");
+ sb.append("qciVals: ");
qciVals.appendAsString(sb, indentLevel + 1);
}
@@ -1700,7 +1705,7 @@
sb.append("\t");
}
if (dataVolDl != null) {
- sb.append("\"dataVolDl\": ");
+ sb.append("dataVolDl: ");
dataVolDl.appendAsString(sb, indentLevel + 1);
}
@@ -1709,7 +1714,7 @@
sb.append("\t");
}
if (dataVolUl != null) {
- sb.append("\"dataVolUl\": ");
+ sb.append("dataVolUl: ");
dataVolUl.appendAsString(sb, indentLevel + 1);
}
@@ -1718,7 +1723,7 @@
sb.append("\t");
}
if (pktDelayDl != null) {
- sb.append("\"pktDelayDl\": ");
+ sb.append("pktDelayDl: ");
pktDelayDl.appendAsString(sb, indentLevel + 1);
}
@@ -1727,7 +1732,7 @@
sb.append("\t");
}
if (pktDelayUl != null) {
- sb.append("\"pktDelayUl\": ");
+ sb.append("pktDelayUl: ");
pktDelayUl.appendAsString(sb, indentLevel + 1);
}
@@ -1736,7 +1741,7 @@
sb.append("\t");
}
if (pktDiscardRateDl != null) {
- sb.append("\"pktDiscardRateDl\": ");
+ sb.append("pktDiscardRateDl: ");
pktDiscardRateDl.appendAsString(sb, indentLevel + 1);
}
@@ -1745,7 +1750,7 @@
sb.append("\t");
}
if (pktLossRateDl != null) {
- sb.append("\"pktLossRateDl\": ");
+ sb.append("pktLossRateDl: ");
pktLossRateDl.appendAsString(sb, indentLevel + 1);
}
@@ -1754,7 +1759,7 @@
sb.append("\t");
}
if (pktLossRateUl != null) {
- sb.append("\"pktLossRateUl\": ");
+ sb.append("pktLossRateUl: ");
pktLossRateUl.appendAsString(sb, indentLevel + 1);
}
@@ -1763,7 +1768,7 @@
sb.append("\t");
}
if (throughputDl != null) {
- sb.append("\"throughputDl\": ");
+ sb.append("throughputDl: ");
throughputDl.appendAsString(sb, indentLevel + 1);
}
@@ -1772,7 +1777,7 @@
sb.append("\t");
}
if (throughputUl != null) {
- sb.append("\"throughputUl\": ");
+ sb.append("throughputUl: ");
throughputUl.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java
index 4c9bae7..c2164c3 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java
@@ -4,15 +4,17 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.XICICPA;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerBitString;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerBitString;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -26,6 +28,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
+ @JsonIgnore
public byte[] code = null;
private ECGI ecgi = null;
private Crnti crnti = null;
@@ -355,7 +358,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -364,7 +367,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"crnti\": ");
+ sb.append("crnti: ");
crnti.appendAsString(sb, indentLevel + 1);
}
@@ -373,7 +376,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"pa\": ");
+ sb.append("pa: ");
pa.appendAsString(sb, indentLevel + 1);
}
@@ -382,7 +385,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"startPrbDl\": ");
+ sb.append("startPrbDl: ");
startPrbDl.appendAsString(sb, indentLevel + 1);
}
@@ -391,7 +394,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"endPrbDl\": ");
+ sb.append("endPrbDl: ");
endPrbDl.appendAsString(sb, indentLevel + 1);
}
@@ -400,7 +403,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"subframeBitmaskDl\": ");
+ sb.append("subframeBitmaskDl: ");
subframeBitmaskDl.appendAsString(sb, indentLevel + 1);
}
@@ -409,7 +412,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"p0UePusch\": ");
+ sb.append("p0UePusch: ");
p0UePusch.appendAsString(sb, indentLevel + 1);
}
@@ -418,7 +421,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"startPrbUl\": ");
+ sb.append("startPrbUl: ");
startPrbUl.appendAsString(sb, indentLevel + 1);
}
@@ -427,7 +430,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"endPrbUl\": ");
+ sb.append("endPrbUl: ");
endPrbUl.appendAsString(sb, indentLevel + 1);
}
@@ -436,7 +439,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"subframeBitmaskUl\": ");
+ sb.append("subframeBitmaskUl: ");
subframeBitmaskUl.appendAsString(sb, indentLevel + 1);
}
@@ -451,7 +454,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<CRNTI> seqOf = null;
public Crnti() {
@@ -462,6 +465,7 @@
this.code = code;
}
+ @JsonValue
public List<CRNTI> getCRNTI() {
if (seqOf == null) {
seqOf = new ArrayList<CRNTI>();
@@ -579,7 +583,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<XICICPA> seqOf = null;
public Pa() {
@@ -590,6 +594,7 @@
this.code = code;
}
+ @JsonValue
public List<XICICPA> getXICICPA() {
if (seqOf == null) {
seqOf = new ArrayList<XICICPA>();
@@ -703,7 +708,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public StartPrbDl() {
@@ -722,7 +727,7 @@
this.seqOf = seqOf;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -838,7 +843,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public EndPrbDl() {
@@ -849,7 +854,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -973,7 +978,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerBitString> seqOf = null;
public SubframeBitmaskDl() {
@@ -984,6 +989,7 @@
this.code = code;
}
+ @JsonValue
public List<BerBitString> getBerBitString() {
if (seqOf == null) {
seqOf = new ArrayList<BerBitString>();
@@ -1077,13 +1083,13 @@
} else {
Iterator<BerBitString> it = seqOf.iterator();
if (it.hasNext()) {
- sb.append("\"" + it.next() + "\"");
+ sb.append("" + it.next() + "");
while (it.hasNext()) {
sb.append(",\n");
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"" + it.next() + "\"");
+ sb.append("" + it.next() + "");
}
}
}
@@ -1101,7 +1107,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public P0UePusch() {
@@ -1112,7 +1118,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -1225,7 +1231,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public StartPrbUl() {
@@ -1236,7 +1242,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -1360,7 +1366,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public EndPrbUl() {
@@ -1371,6 +1377,7 @@
this.code = code;
}
+ @JsonValue
public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
@@ -1495,7 +1502,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerBitString> seqOf = null;
public SubframeBitmaskUl() {
@@ -1506,6 +1513,7 @@
this.code = code;
}
+ @JsonValue
public List<BerBitString> getBerBitString() {
if (seqOf == null) {
seqOf = new ArrayList<BerBitString>();
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfigStatus.java b/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfigStatus.java
index ab88a6d..015e8fe 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfigStatus.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfigStatus.java
@@ -4,12 +4,14 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
import java.io.IOException;
import java.io.InputStream;
@@ -28,6 +30,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<CRNTI> seqOf = null;
@@ -39,6 +42,7 @@
this.code = code;
}
+ @JsonValue
public List<CRNTI> getCRNTI() {
if (seqOf == null) {
seqOf = new ArrayList<CRNTI>();
@@ -154,7 +158,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerEnum> seqOf = null;
public Status() {
@@ -165,6 +169,7 @@
this.code = code;
}
+ @JsonValue
public List<BerEnum> getBerEnum() {
if (seqOf == null) {
seqOf = new ArrayList<BerEnum>();
@@ -277,7 +282,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private ECGI ecgi = null;
private Crnti crnti = null;
private Status status = null;
@@ -424,7 +429,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -433,7 +438,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"crnti\": ");
+ sb.append("crnti: ");
crnti.appendAsString(sb, indentLevel + 1);
}
@@ -442,7 +447,7 @@
sb.append("\t");
}
if (status != null) {
- sb.append("\"status\": ");
+ sb.append("status: ");
status.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasConfig.java
index f8b5403..02b7cf3 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasConfig.java
@@ -4,11 +4,13 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.*;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -27,7 +29,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<PCIARFCN> seqOf = null;
public MeasCells() {
@@ -38,6 +40,7 @@
this.code = code;
}
+ @JsonValue
public List<PCIARFCN> getPCIARFCN() {
if (seqOf == null) {
seqOf = new ArrayList<PCIARFCN>();
@@ -153,6 +156,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private ECGI ecgi = null;
private CRNTI crnti = null;
@@ -347,7 +351,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -356,7 +360,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -364,7 +368,7 @@
sb.append("\t");
}
if (reportQty != null) {
- sb.append("\"reportQty\": ").append(reportQty);
+ sb.append("reportQty: ").append(reportQty);
}
sb.append(",\n");
@@ -372,7 +376,7 @@
sb.append("\t");
}
if (measCells != null) {
- sb.append("\"measCells\": ");
+ sb.append("measCells: ");
measCells.appendAsString(sb, indentLevel + 1);
}
@@ -381,7 +385,7 @@
sb.append("\t");
}
if (reportInterval != null) {
- sb.append("\"reportInterval\": ").append(reportInterval);
+ sb.append("reportInterval: ").append(reportInterval);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasReport.java b/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasReport.java
index bee7bdd..e6d735e 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasReport.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/RXSigMeasReport.java
@@ -4,12 +4,14 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.RXSigReport;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -27,6 +29,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<RXSigReport> seqOf = null;
@@ -38,6 +41,7 @@
this.code = code;
}
+ @JsonValue
public List<RXSigReport> getRXSigReport() {
if (seqOf == null) {
seqOf = new ArrayList<RXSigReport>();
@@ -153,7 +157,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
private CellMeasReports cellMeasReports = null;
@@ -301,7 +305,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -309,7 +313,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -318,7 +322,7 @@
sb.append("\t");
}
if (cellMeasReports != null) {
- sb.append("\"cellMeasReports\": ");
+ sb.append("cellMeasReports: ");
cellMeasReports.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/RadioMeasReportPerCell.java b/src/main/java/org.onosproject.xran/codecs/pdu/RadioMeasReportPerCell.java
index ac138c6..bb1c59a 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/RadioMeasReportPerCell.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/RadioMeasReportPerCell.java
@@ -4,11 +4,13 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerInteger;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
import java.io.IOException;
import java.io.InputStream;
@@ -27,6 +29,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<BerInteger> seqOf = null;
@@ -38,7 +41,7 @@
this.code = code;
}
- public List<BerInteger> getBerInteger() {
+ @JsonValue public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -157,7 +160,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerInteger> seqOf = null;
public PucchIntfPowerHist() {
@@ -168,6 +171,7 @@
this.code = code;
}
+ @JsonValue
public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
@@ -283,7 +287,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private ECGI ecgi = null;
private PuschIntfPowerHist puschIntfPowerHist = null;
private PucchIntfPowerHist pucchIntfPowerHist = null;
@@ -431,7 +435,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -440,7 +444,7 @@
sb.append("\t");
}
if (puschIntfPowerHist != null) {
- sb.append("\"puschIntfPowerHist\": ");
+ sb.append("puschIntfPowerHist: ");
puschIntfPowerHist.appendAsString(sb, indentLevel + 1);
}
@@ -449,7 +453,7 @@
sb.append("\t");
}
if (pucchIntfPowerHist != null) {
- sb.append("\"pucchIntfPowerHist\": ");
+ sb.append("pucchIntfPowerHist: ");
pucchIntfPowerHist.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/RadioMeasReportPerUE.java b/src/main/java/org.onosproject.xran/codecs/pdu/RadioMeasReportPerUE.java
index 15f1ea9..7b6b17c 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/RadioMeasReportPerUE.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/RadioMeasReportPerUE.java
@@ -4,12 +4,14 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.RadioRepPerServCell;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -27,6 +29,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<RadioRepPerServCell> seqOf = null;
@@ -38,6 +41,7 @@
this.code = code;
}
+ @JsonValue
public List<RadioRepPerServCell> getRadioRepPerServCell() {
if (seqOf == null) {
seqOf = new ArrayList<RadioRepPerServCell>();
@@ -153,7 +157,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private ECGI ecgi = null;
private CRNTI crnti = null;
private RadioReportServCells radioReportServCells = null;
@@ -301,7 +305,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -310,7 +314,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -318,7 +322,7 @@
sb.append("\t");
}
if (radioReportServCells != null) {
- sb.append("\"radioReportServCells\": ");
+ sb.append("radioReportServCells: ");
radioReportServCells.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/ScellAdd.java b/src/main/java/org.onosproject.xran/codecs/pdu/ScellAdd.java
index 3ee1f02..674b79d 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/ScellAdd.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/ScellAdd.java
@@ -4,16 +4,18 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.PropScell;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerBoolean;
-import org.openmuc.jasn1.ber.types.BerEnum;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerBoolean;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -28,6 +30,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -205,7 +208,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -213,7 +216,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -222,7 +225,7 @@
sb.append("\t");
}
if (scellsProp != null) {
- sb.append("\"scellsProp\": ");
+ sb.append("scellsProp: ");
scellsProp.appendAsString(sb, indentLevel + 1);
}
@@ -237,7 +240,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<PropScell> seqOf = null;
public ScellsProp() {
@@ -248,6 +251,7 @@
this.code = code;
}
+ @JsonValue
public List<PropScell> getPropScell() {
if (seqOf == null) {
seqOf = new ArrayList<PropScell>();
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/ScellAddStatus.java b/src/main/java/org.onosproject.xran/codecs/pdu/ScellAddStatus.java
index 99ddadd..1efc52f 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/ScellAddStatus.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/ScellAddStatus.java
@@ -4,13 +4,15 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.PCIARFCN;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
import java.io.IOException;
import java.io.InputStream;
@@ -28,6 +30,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<PCIARFCN> seqOf = null;
@@ -39,6 +42,7 @@
this.code = code;
}
+ @JsonValue
public List<PCIARFCN> getPCIARFCN() {
if (seqOf == null) {
seqOf = new ArrayList<PCIARFCN>();
@@ -154,7 +158,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<BerEnum> seqOf = null;
public Status() {
@@ -165,6 +169,7 @@
this.code = code;
}
+ @JsonValue
public List<BerEnum> getBerEnum() {
if (seqOf == null) {
seqOf = new ArrayList<BerEnum>();
@@ -277,7 +282,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
private ScellsInd scellsInd = null;
@@ -448,7 +453,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -456,7 +461,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -465,7 +470,7 @@
sb.append("\t");
}
if (scellsInd != null) {
- sb.append("\"scellsInd\": ");
+ sb.append("scellsInd: ");
scellsInd.appendAsString(sb, indentLevel + 1);
}
@@ -474,7 +479,7 @@
sb.append("\t");
}
if (status != null) {
- sb.append("\"status\": ");
+ sb.append("status: ");
status.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/ScellDelete.java b/src/main/java/org.onosproject.xran/codecs/pdu/ScellDelete.java
index 02dd7d2..6080f69 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/ScellDelete.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/ScellDelete.java
@@ -4,13 +4,15 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.PCIARFCN;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -24,6 +26,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -199,7 +202,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -207,7 +210,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -216,7 +219,7 @@
sb.append("\t");
}
if (scellsInd != null) {
- sb.append("\"scellsInd\": ");
+ sb.append("scellsInd: ");
scellsInd.appendAsString(sb, indentLevel + 1);
}
@@ -231,7 +234,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private List<PCIARFCN> seqOf = null;
public ScellsInd() {
@@ -242,6 +245,7 @@
this.code = code;
}
+ @JsonValue
public List<PCIARFCN> getPCIARFCN() {
if (seqOf == null) {
seqOf = new ArrayList<PCIARFCN>();
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/SchedMeasReportPerCell.java b/src/main/java/org.onosproject.xran/codecs/pdu/SchedMeasReportPerCell.java
index 1493c63..80821b8 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/SchedMeasReportPerCell.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/SchedMeasReportPerCell.java
@@ -2,12 +2,14 @@
* This class file was automatically generated by jASN1 v1.8.0 (http://www.openmuc.org)
*/
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.PRBUsage;
import org.onosproject.xran.codecs.api.QCI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -26,6 +28,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<QCI> seqOf = null;
@@ -37,6 +40,7 @@
this.code = code;
}
+ @JsonValue
public List<QCI> getQCI() {
if (seqOf == null) {
seqOf = new ArrayList<QCI>();
@@ -152,7 +156,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private ECGI ecgi = null;
private QciVals qciVals = null;
private PRBUsage prbUsagePcell = null;
@@ -323,7 +327,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -332,7 +336,7 @@
sb.append("\t");
}
if (qciVals != null) {
- sb.append("\"qciVals\": ");
+ sb.append("qciVals: ");
qciVals.appendAsString(sb, indentLevel + 1);
}
@@ -341,7 +345,7 @@
sb.append("\t");
}
if (prbUsagePcell != null) {
- sb.append("\"prbUsagePcell\": ");
+ sb.append("prbUsagePcell: ");
prbUsagePcell.appendAsString(sb, indentLevel + 1);
}
@@ -350,7 +354,7 @@
sb.append("\t");
}
if (prbUsageScell != null) {
- sb.append("\"prbUsageScell\": ");
+ sb.append("prbUsageScell: ");
prbUsageScell.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/SchedMeasReportPerUE.java b/src/main/java/org.onosproject.xran/codecs/pdu/SchedMeasReportPerUE.java
index 3205e88..61616f4 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/SchedMeasReportPerUE.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/SchedMeasReportPerUE.java
@@ -3,12 +3,14 @@
*/
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.SchedMeasRepPerServCell;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -26,6 +28,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<SchedMeasRepPerServCell> seqOf = null;
@@ -37,6 +40,7 @@
this.code = code;
}
+ @JsonValue
public List<SchedMeasRepPerServCell> getSchedMeasRepPerServCell() {
if (seqOf == null) {
seqOf = new ArrayList<SchedMeasRepPerServCell>();
@@ -152,7 +156,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private ECGI ecgi = null;
private CRNTI crnti = null;
private SchedReportServCells schedReportServCells = null;
@@ -300,7 +304,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -309,7 +313,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -317,7 +321,7 @@
sb.append("\t");
}
if (schedReportServCells != null) {
- sb.append("\"schedReportServCells\": ");
+ sb.append("schedReportServCells: ");
schedReportServCells.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/SeNBAdd.java b/src/main/java/org.onosproject.xran/codecs/pdu/SeNBAdd.java
index d86cf6d..5f1d1fa 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/SeNBAdd.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/SeNBAdd.java
@@ -3,11 +3,12 @@
*/
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
@@ -19,6 +20,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI mEcgi = null;
@@ -167,7 +169,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -175,7 +177,7 @@
sb.append("\t");
}
if (mEcgi != null) {
- sb.append("\"mEcgi\": ");
+ sb.append("mEcgi: ");
mEcgi.appendAsString(sb, indentLevel + 1);
}
@@ -184,7 +186,7 @@
sb.append("\t");
}
if (sEcgi != null) {
- sb.append("\"sEcgi\": ");
+ sb.append("sEcgi: ");
sEcgi.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/SeNBAddStatus.java b/src/main/java/org.onosproject.xran/codecs/pdu/SeNBAddStatus.java
index e09c110..1548c9f 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/SeNBAddStatus.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/SeNBAddStatus.java
@@ -3,12 +3,13 @@
*/
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
import java.io.IOException;
import java.io.InputStream;
@@ -21,6 +22,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -169,7 +171,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -177,7 +179,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -186,7 +188,7 @@
sb.append("\t");
}
if (status != null) {
- sb.append("\"status\": ").append(status);
+ sb.append("status: ").append(status);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/SeNBDelete.java b/src/main/java/org.onosproject.xran/codecs/pdu/SeNBDelete.java
index 8441c3f..14b9dc5 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/SeNBDelete.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/SeNBDelete.java
@@ -3,11 +3,12 @@
*/
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -20,6 +21,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI mEcgi = null;
@@ -168,7 +170,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -176,7 +178,7 @@
sb.append("\t");
}
if (mEcgi != null) {
- sb.append("\"mEcgi\": ");
+ sb.append("mEcgi: ");
mEcgi.appendAsString(sb, indentLevel + 1);
}
@@ -185,7 +187,7 @@
sb.append("\t");
}
if (sEcgi != null) {
- sb.append("\"sEcgi\": ");
+ sb.append("sEcgi: ");
sEcgi.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/TrafficSplitConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/TrafficSplitConfig.java
index 408b722..cd68d7f 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/TrafficSplitConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/TrafficSplitConfig.java
@@ -3,12 +3,14 @@
*/
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonValue;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.TrafficSplitPercentage;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -26,6 +28,7 @@
private static final long serialVersionUID = 1L;
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private List<TrafficSplitPercentage> seqOf = null;
@@ -37,6 +40,7 @@
this.code = code;
}
+ @JsonValue
public List<TrafficSplitPercentage> getTrafficSplitPercentage() {
if (seqOf == null) {
seqOf = new ArrayList<TrafficSplitPercentage>();
@@ -149,7 +153,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- public byte[] code = null;
+ @JsonIgnore public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
private TrafficSplitPercent trafficSplitPercent = null;
@@ -297,7 +301,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -305,7 +309,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -314,7 +318,7 @@
sb.append("\t");
}
if (trafficSplitPercent != null) {
- sb.append("\"trafficSplitPercent\": ");
+ sb.append("trafficSplitPercent: ");
trafficSplitPercent.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionRequest.java b/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionRequest.java
index 3eb4b9e..fd5148e 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionRequest.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionRequest.java
@@ -4,9 +4,10 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import org.onosproject.xran.codecs.api.AdmEstCause;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
@@ -21,6 +22,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -169,7 +171,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -177,7 +179,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -186,7 +188,7 @@
sb.append("\t");
}
if (admEstCause != null) {
- sb.append("\"admEstCause\": ").append(admEstCause);
+ sb.append("admEstCause: ").append(admEstCause);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionResponse.java b/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionResponse.java
index 5d323b7..8600ba3 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionResponse.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionResponse.java
@@ -4,13 +4,14 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import org.onosproject.xran.codecs.api.AdmEstResponse;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -23,6 +24,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -171,7 +173,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -179,7 +181,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -188,7 +190,7 @@
sb.append("\t");
}
if (admEstResponse != null) {
- sb.append("\"admEstResponse\": ").append(admEstResponse);
+ sb.append("admEstResponse: ").append(admEstResponse);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionStatus.java b/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionStatus.java
index edfd056..5a06a8a 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionStatus.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UEAdmissionStatus.java
@@ -4,9 +4,10 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import org.onosproject.xran.codecs.api.AdmEstStatus;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
@@ -21,6 +22,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -169,7 +171,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -177,7 +179,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -186,7 +188,7 @@
sb.append("\t");
}
if (admEstStatus != null) {
- sb.append("\"admEstStatus\": ").append(admEstStatus);
+ sb.append("admEstStatus: ").append(admEstStatus);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityEnquiry.java b/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityEnquiry.java
index db212e5..01fa001 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityEnquiry.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityEnquiry.java
@@ -4,12 +4,13 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -23,6 +24,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -148,7 +150,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -156,7 +158,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityInfo.java b/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityInfo.java
index a2c017e..732b717 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityInfo.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UECapabilityInfo.java
@@ -3,13 +3,14 @@
*/
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.CACap;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.DCCap;
import org.onosproject.xran.codecs.api.ECGI;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -22,6 +23,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -200,7 +202,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -208,7 +210,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -217,7 +219,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"caCap\": ");
+ sb.append("caCap: ");
caCap.appendAsString(sb, indentLevel + 1);
}
@@ -226,7 +228,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"dcCap\": ");
+ sb.append("dcCap: ");
dcCap.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java b/src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java
index d9d6066..287316a 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java
@@ -4,13 +4,14 @@
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.ENBUES1APID;
import org.onosproject.xran.codecs.api.MMEUES1APID;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -22,6 +23,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -193,7 +195,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -201,7 +203,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -210,7 +212,7 @@
sb.append("\t");
}
if (mMEUES1APID != null) {
- sb.append("\"mMEUES1APID\": ").append(mMEUES1APID);
+ sb.append("mMEUES1APID: ").append(mMEUES1APID);
}
sb.append(",\n");
@@ -218,7 +220,7 @@
sb.append("\t");
}
if (eNBUES1APID != null) {
- sb.append("\"eNBUES1APID\": ").append(eNBUES1APID);
+ sb.append("eNBUES1APID: ").append(eNBUES1APID);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UEReconfigInd.java b/src/main/java/org.onosproject.xran/codecs/pdu/UEReconfigInd.java
index 4a5fd3d..6aa03ed 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UEReconfigInd.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UEReconfigInd.java
@@ -4,9 +4,10 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.ReconfIndReason;
@@ -21,6 +22,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crntiOld = null;
private ECGI ecgi = null;
@@ -192,7 +194,7 @@
sb.append("\t");
}
if (crntiOld != null) {
- sb.append("\"crntiOld\": ").append(crntiOld);
+ sb.append("crntiOld: ").append(crntiOld);
}
sb.append(",\n");
@@ -200,7 +202,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -209,7 +211,7 @@
sb.append("\t");
}
if (crntiNew != null) {
- sb.append("\"crntiNew\": ").append(crntiNew);
+ sb.append("crntiNew: ").append(crntiNew);
}
sb.append(",\n");
@@ -217,7 +219,7 @@
sb.append("\t");
}
if (reconfigCause != null) {
- sb.append("\"reconfigCause\": ").append(reconfigCause);
+ sb.append("reconfigCause: ").append(reconfigCause);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UEReleaseInd.java b/src/main/java/org.onosproject.xran/codecs/pdu/UEReleaseInd.java
index 9b601ad..fef213f 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UEReleaseInd.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UEReleaseInd.java
@@ -3,9 +3,10 @@
*/
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.RelCause;
@@ -20,6 +21,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private CRNTI crnti = null;
private ECGI ecgi = null;
@@ -168,7 +170,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti\": ").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
sb.append(",\n");
@@ -176,7 +178,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi\": ");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -185,7 +187,7 @@
sb.append("\t");
}
if (releaseCause != null) {
- sb.append("\"releaseCause\": ").append(releaseCause);
+ sb.append("releaseCause: ").append(releaseCause);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
index 2d1bc70..7d841c9 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
@@ -3,16 +3,17 @@
*/
package org.onosproject.xran.codecs.pdu;
+import com.fasterxml.jackson.annotation.JsonIgnore;
import org.onosproject.xran.codecs.api.CRNTI;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.PCIARFCN;
import org.onosproject.xran.codecs.api.XICICPA;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.BerBitString;
-import org.openmuc.jasn1.ber.types.BerInteger;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.BerBitString;
+import org.onosproject.xran.codecs.ber.types.BerInteger;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -25,6 +26,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private ECGI ecgi = null;
private PCIARFCN pciArfcn = null;
@@ -374,7 +376,7 @@
sb.append("\t");
}
if (ecgi != null) {
- sb.append("\"ecgi: \"");
+ sb.append("ecgi: ");
ecgi.appendAsString(sb, indentLevel + 1);
}
@@ -383,7 +385,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"pciArfcn: \"");
+ sb.append("pciArfcn: ");
pciArfcn.appendAsString(sb, indentLevel + 1);
}
@@ -392,7 +394,7 @@
sb.append("\t");
}
if (crnti != null) {
- sb.append("\"crnti: \"").append(crnti);
+ sb.append("crnti: ").append(crnti);
}
if (pa != null) {
@@ -400,7 +402,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"pa: \"").append(pa);
+ sb.append("pa: ").append(pa);
}
if (startPrbDl != null) {
@@ -408,7 +410,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"startPrbDl: \"").append(startPrbDl);
+ sb.append("startPrbDl: ").append(startPrbDl);
}
if (endPrbDl != null) {
@@ -416,7 +418,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"endPrbDl: \"").append(endPrbDl);
+ sb.append("endPrbDl: ").append(endPrbDl);
}
if (subframeBitmaskDl != null) {
@@ -424,7 +426,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"subframeBitmaskDl: \"").append(subframeBitmaskDl);
+ sb.append("subframeBitmaskDl: ").append(subframeBitmaskDl);
}
if (p0UePusch != null) {
@@ -432,7 +434,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"p0UePusch: \"").append(p0UePusch);
+ sb.append("p0UePusch: ").append(p0UePusch);
}
if (startPrbUl != null) {
@@ -440,7 +442,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"startPrbUl: \"").append(startPrbUl);
+ sb.append("startPrbUl: ").append(startPrbUl);
}
if (endPrbUl != null) {
@@ -448,7 +450,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"endPrbUl: \"").append(endPrbUl);
+ sb.append("endPrbUl: ").append(endPrbUl);
}
if (subframeBitmaskUl != null) {
@@ -456,7 +458,7 @@
for (int i = 0; i < indentLevel + 1; i++) {
sb.append("\t");
}
- sb.append("\"subframeBitmaskUl: \"").append(subframeBitmaskUl);
+ sb.append("subframeBitmaskUl: ").append(subframeBitmaskUl);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/XrancApiID.java b/src/main/java/org.onosproject.xran/codecs/pdu/XrancApiID.java
index 341b70f..fa902f8 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/XrancApiID.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/XrancApiID.java
@@ -4,7 +4,7 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.types.BerEnum;
+import org.onosproject.xran.codecs.ber.types.BerEnum;
import java.math.BigInteger;
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/XrancPdu.java b/src/main/java/org.onosproject.xran/codecs/pdu/XrancPdu.java
index d365a39..d983713 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/XrancPdu.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/XrancPdu.java
@@ -4,9 +4,10 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -18,6 +19,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private XrancPduHdr hdr = null;
private XrancPduBody body = null;
@@ -148,7 +150,7 @@
sb.append("\t");
}
if (hdr != null) {
- sb.append("\"hdr\": ");
+ sb.append("hdr: ");
hdr.appendAsString(sb, indentLevel + 1);
}
@@ -157,7 +159,7 @@
sb.append("\t");
}
if (body != null) {
- sb.append("\"body\": ");
+ sb.append("body: ");
body.appendAsString(sb, indentLevel + 1);
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduBody.java b/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduBody.java
index 2770211..29bef78 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduBody.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduBody.java
@@ -4,8 +4,9 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerTag;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerTag;
import java.io.IOException;
import java.io.InputStream;
@@ -15,6 +16,7 @@
private static final long serialVersionUID = 1L;
+ @JsonIgnore
public byte[] code = null;
private CellConfigRequest cellConfigRequest = null;
private CellConfigReport cellConfigReport = null;
@@ -882,211 +884,211 @@
public void appendAsString(StringBuilder sb, int indentLevel) {
if (cellConfigRequest != null) {
- sb.append("\"cellConfigRequest\": ");
+ sb.append("cellConfigRequest: ");
cellConfigRequest.appendAsString(sb, indentLevel + 1);
return;
}
if (cellConfigReport != null) {
- sb.append("\"cellConfigReport\": ");
+ sb.append("cellConfigReport: ");
cellConfigReport.appendAsString(sb, indentLevel + 1);
return;
}
if (uEAdmissionRequest != null) {
- sb.append("\"uEAdmissionRequest\": ");
+ sb.append("uEAdmissionRequest: ");
uEAdmissionRequest.appendAsString(sb, indentLevel + 1);
return;
}
if (uEAdmissionResponse != null) {
- sb.append("\"uEAdmissionResponse\": ");
+ sb.append("uEAdmissionResponse: ");
uEAdmissionResponse.appendAsString(sb, indentLevel + 1);
return;
}
if (uEContextUpdate != null) {
- sb.append("\"uEContextUpdate\": ");
+ sb.append("uEContextUpdate: ");
uEContextUpdate.appendAsString(sb, indentLevel + 1);
return;
}
if (uEAdmissionStatus != null) {
- sb.append("\"uEAdmissionStatus\": ");
+ sb.append("uEAdmissionStatus: ");
uEAdmissionStatus.appendAsString(sb, indentLevel + 1);
return;
}
if (uEReconfigInd != null) {
- sb.append("\"uEReconfigInd\": ");
+ sb.append("uEReconfigInd: ");
uEReconfigInd.appendAsString(sb, indentLevel + 1);
return;
}
if (uEReleaseInd != null) {
- sb.append("\"uEReleaseInd\": ");
+ sb.append("uEReleaseInd: ");
uEReleaseInd.appendAsString(sb, indentLevel + 1);
return;
}
if (bearerAdmissionRequest != null) {
- sb.append("\"bearerAdmissionRequest\": ");
+ sb.append("bearerAdmissionRequest: ");
bearerAdmissionRequest.appendAsString(sb, indentLevel + 1);
return;
}
if (bearerAdmissionResponse != null) {
- sb.append("\"bearerAdmissionResponse\": ");
+ sb.append("bearerAdmissionResponse: ");
bearerAdmissionResponse.appendAsString(sb, indentLevel + 1);
return;
}
if (bearerAdmissionStatus != null) {
- sb.append("\"bearerAdmissionStatus\": ");
+ sb.append("bearerAdmissionStatus: ");
bearerAdmissionStatus.appendAsString(sb, indentLevel + 1);
return;
}
if (bearerReleaseInd != null) {
- sb.append("\"bearerReleaseInd\": ");
+ sb.append("bearerReleaseInd: ");
bearerReleaseInd.appendAsString(sb, indentLevel + 1);
return;
}
if (uECapabilityEnquiry != null) {
- sb.append("\"uECapabilityEnquiry\": ");
+ sb.append("uECapabilityEnquiry: ");
uECapabilityEnquiry.appendAsString(sb, indentLevel + 1);
return;
}
if (uECapabilityInfo != null) {
- sb.append("\"uECapabilityInfo\": ");
+ sb.append("uECapabilityInfo: ");
uECapabilityInfo.appendAsString(sb, indentLevel + 1);
return;
}
if (hORequest != null) {
- sb.append("\"hORequest\": ");
+ sb.append("hORequest: ");
hORequest.appendAsString(sb, indentLevel + 1);
return;
}
if (hOFailure != null) {
- sb.append("\"hOFailure\": ");
+ sb.append("hOFailure: ");
hOFailure.appendAsString(sb, indentLevel + 1);
return;
}
if (hOComplete != null) {
- sb.append("\"hOComplete\": ");
+ sb.append("hOComplete: ");
hOComplete.appendAsString(sb, indentLevel + 1);
return;
}
if (rXSigMeasConfig != null) {
- sb.append("\"rXSigMeasConfig\": ");
+ sb.append("rXSigMeasConfig: ");
rXSigMeasConfig.appendAsString(sb, indentLevel + 1);
return;
}
if (rXSigMeasReport != null) {
- sb.append("\"rXSigMeasReport\": ");
+ sb.append("rXSigMeasReport: ");
rXSigMeasReport.appendAsString(sb, indentLevel + 1);
return;
}
if (l2MeasConfig != null) {
- sb.append("\"l2MeasConfig\": ");
+ sb.append("l2MeasConfig: ");
l2MeasConfig.appendAsString(sb, indentLevel + 1);
return;
}
if (radioMeasReportPerUE != null) {
- sb.append("\"radioMeasReportPerUE\": ");
+ sb.append("radioMeasReportPerUE: ");
radioMeasReportPerUE.appendAsString(sb, indentLevel + 1);
return;
}
if (radioMeasReportPerCell != null) {
- sb.append("\"radioMeasReportPerCell\": ");
+ sb.append("radioMeasReportPerCell: ");
radioMeasReportPerCell.appendAsString(sb, indentLevel + 1);
return;
}
if (schedMeasReportPerUE != null) {
- sb.append("\"schedMeasReportPerUE\": ");
+ sb.append("schedMeasReportPerUE: ");
schedMeasReportPerUE.appendAsString(sb, indentLevel + 1);
return;
}
if (schedMeasReportPerCell != null) {
- sb.append("\"schedMeasReportPerCell\": ");
+ sb.append("schedMeasReportPerCell: ");
schedMeasReportPerCell.appendAsString(sb, indentLevel + 1);
return;
}
if (pDCPMeasReportPerUe != null) {
- sb.append("\"pDCPMeasReportPerUe\": ");
+ sb.append("pDCPMeasReportPerUe: ");
pDCPMeasReportPerUe.appendAsString(sb, indentLevel + 1);
return;
}
if (xICICConfig != null) {
- sb.append("\"xICICConfig\": ");
+ sb.append("xICICConfig: ");
xICICConfig.appendAsString(sb, indentLevel + 1);
return;
}
if (rRMConfig != null) {
- sb.append("\"rRMConfig\": ");
+ sb.append("rRMConfig: ");
rRMConfig.appendAsString(sb, indentLevel + 1);
return;
}
if (rRMConfigStatus != null) {
- sb.append("\"rRMConfigStatus\": ");
+ sb.append("rRMConfigStatus: ");
rRMConfigStatus.appendAsString(sb, indentLevel + 1);
return;
}
if (scellAdd != null) {
- sb.append("\"scellAdd\": ");
+ sb.append("scellAdd: ");
scellAdd.appendAsString(sb, indentLevel + 1);
return;
}
if (scellAddStatus != null) {
- sb.append("\"scellAddStatus\": ");
+ sb.append("scellAddStatus: ");
scellAddStatus.appendAsString(sb, indentLevel + 1);
return;
}
if (scellDelete != null) {
- sb.append("\"scellDelete\": ");
+ sb.append("scellDelete: ");
scellDelete.appendAsString(sb, indentLevel + 1);
return;
}
if (seNBAdd != null) {
- sb.append("\"seNBAdd\": ");
+ sb.append("seNBAdd: ");
seNBAdd.appendAsString(sb, indentLevel + 1);
return;
}
if (seNBAddStatus != null) {
- sb.append("\"seNBAddStatus\": ");
+ sb.append("seNBAddStatus: ");
seNBAddStatus.appendAsString(sb, indentLevel + 1);
return;
}
if (seNBDelete != null) {
- sb.append("\"seNBDelete\": ");
+ sb.append("seNBDelete: ");
seNBDelete.appendAsString(sb, indentLevel + 1);
return;
}
if (trafficSplitConfig != null) {
- sb.append("\"trafficSplitConfig\": ");
+ sb.append("trafficSplitConfig: ");
trafficSplitConfig.appendAsString(sb, indentLevel + 1);
return;
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduHdr.java b/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduHdr.java
index 63480d4..124e692 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduHdr.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/XrancPduHdr.java
@@ -4,10 +4,11 @@
package org.onosproject.xran.codecs.pdu;
-import org.openmuc.jasn1.ber.BerByteArrayOutputStream;
-import org.openmuc.jasn1.ber.BerLength;
-import org.openmuc.jasn1.ber.BerTag;
-import org.openmuc.jasn1.ber.types.string.BerUTF8String;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.BerLength;
+import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -19,6 +20,7 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ @JsonIgnore
public byte[] code = null;
private BerUTF8String ver = null;
private XrancApiID apiId = null;
@@ -144,7 +146,7 @@
sb.append("\t");
}
if (ver != null) {
- sb.append("\"ver\": ").append(ver);
+ sb.append("ver: ").append(ver);
}
sb.append(",\n");
@@ -152,7 +154,7 @@
sb.append("\t");
}
if (apiId != null) {
- sb.append("\"apiId\": ").append(apiId);
+ sb.append("apiId: ").append(apiId);
}
sb.append("\n");
diff --git a/src/main/java/org.onosproject.xran/codecs/util/HexConverter.java b/src/main/java/org.onosproject.xran/codecs/util/HexConverter.java
new file mode 100644
index 0000000..2ffddb7
--- /dev/null
+++ b/src/main/java/org.onosproject.xran/codecs/util/HexConverter.java
@@ -0,0 +1,155 @@
+package org.onosproject.xran.codecs.util;
+
+public class HexConverter {
+
+ public static String toHexString(byte b) {
+ StringBuilder builder = new StringBuilder();
+ appendHexString(b, builder);
+ return builder.toString();
+ }
+
+ public static String toHexString(byte[] bytes) {
+ return toHexString(bytes, 0, bytes.length);
+ }
+
+ public static String toHexString(byte[] bytes, int offset, int length) {
+ StringBuilder builder = new StringBuilder();
+
+ int l = 1;
+ for (int i = offset; i < (offset + length); i++) {
+ if ((l != 1) && ((l - 1) % 8 == 0)) {
+ builder.append(' ');
+ }
+ if ((l != 1) && ((l - 1) % 16 == 0)) {
+ builder.append('\n');
+ }
+ l++;
+ appendHexString(bytes[i], builder);
+ if (i != offset + length - 1) {
+ builder.append(' ');
+ }
+ }
+
+ return builder.toString();
+ }
+
+ /**
+ * Returns the integer value as hex string filled with leading zeros. If you do not want leading zeros use
+ * Integer.toHexString(int i) instead.
+ *
+ * @param i
+ * the integer value to be converted
+ * @return the hex string
+ */
+ public static String toShortHexString(int i) {
+ byte[] bytes = new byte[] { (byte) (i >> 24), (byte) (i >> 16), (byte) (i >> 8), (byte) (i) };
+ return toShortHexString(bytes);
+ }
+
+ /**
+ * Returns the long value as hex string filled with leading zeros. If you do not want leading zeros use
+ * Long.toHexString(long i) instead.
+ *
+ * @param l
+ * the long value to be converted
+ * @return the hex string
+ */
+ public static String toShortHexString(long l) {
+ byte[] bytes = new byte[] { (byte) (l >> 56), (byte) (l >> 48), (byte) (l >> 40), (byte) (l >> 32),
+ (byte) (l >> 24), (byte) (l >> 16), (byte) (l >> 8), (byte) (l) };
+ return toShortHexString(bytes);
+ }
+
+ /**
+ * Returns the byte as a hex string. If b is less than 16 the hex string returned contains a leading zero.
+ *
+ * @param b
+ * the byte to be converted
+ * @return the byte as a hex string.
+ */
+ public static String toShortHexString(byte b) {
+ return toShortHexString(new byte[] { b });
+ }
+
+ private final static char[] hexArray = "0123456789ABCDEF".toCharArray();
+
+ public static String toShortHexString(byte[] bytes) {
+ return toShortHexString(bytes, 0, bytes.length);
+ }
+
+ public static String toShortHexString(byte[] bytes, int offset, int length) {
+ char[] hexChars = new char[length * 2];
+ for (int j = offset; j < (offset + length); j++) {
+ int v = bytes[j] & 0xff;
+ hexChars[j * 2] = hexArray[v >>> 4];
+ hexChars[j * 2 + 1] = hexArray[v & 0x0f];
+ }
+ return new String(hexChars);
+ }
+
+ public static byte[] fromShortHexString(String shortHexString) throws NumberFormatException {
+
+ validate(shortHexString);
+
+ int length = shortHexString.length();
+
+ byte[] data = new byte[length / 2];
+ for (int i = 0; i < length; i += 2) {
+ int firstCharacter = Character.digit(shortHexString.charAt(i), 16);
+ int secondCharacter = Character.digit(shortHexString.charAt(i + 1), 16);
+
+ if (firstCharacter == -1 || secondCharacter == -1) {
+ throw new NumberFormatException("string is not a legal hex string.");
+ }
+
+ data[i / 2] = (byte) ((firstCharacter << 4) + secondCharacter);
+ }
+ return data;
+ }
+
+ public static void appendShortHexString(byte b, StringBuilder builder) {
+ builder.append(toShortHexString(b));
+ }
+
+ public static void appendShortHexString(StringBuilder builder, byte[] bytes, int offset, int length) {
+ builder.append(toShortHexString(bytes, offset, length));
+ }
+
+ public static void appendHexString(byte b, StringBuilder builder) {
+ builder.append("0x");
+ appendShortHexString(b, builder);
+ }
+
+ public static void appendHexString(StringBuilder builder, byte[] byteArray, int offset, int length) {
+ int l = 1;
+ for (int i = offset; i < (offset + length); i++) {
+ if ((l != 1) && ((l - 1) % 8 == 0)) {
+ builder.append(' ');
+ }
+ if ((l != 1) && ((l - 1) % 16 == 0)) {
+ builder.append('\n');
+ }
+ l++;
+ appendHexString(byteArray[i], builder);
+ if (i != offset + length - 1) {
+ builder.append(' ');
+ }
+ }
+ }
+
+ private static void validate(String s) {
+ if (s == null) {
+ throw new IllegalArgumentException("string s may not be null");
+ }
+
+ if ((s.length() == 0) || ((s.length() % 2) != 0)) {
+ throw new NumberFormatException("string is not a legal hex string.");
+ }
+ }
+
+ /**
+ * Don't let anyone instantiate this class.
+ */
+ private HexConverter() {
+ }
+}