xicic fix
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 f3cf262..2d1bc70 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
@@ -468,7 +468,29 @@
public static XrancPdu constructPacket(RRMConfig config) {
XrancPduBody body = new XrancPduBody();
- body.setRRMConfig(config);
+
+ XICICConfig xicicConfig = new XICICConfig();
+
+ xicicConfig.setCrnti(config.getCrnti().getCRNTI().get(0));
+ xicicConfig.setEcgi(config.getEcgi());
+
+ try {
+ xicicConfig.setEndPrbDl(config.getEndPrbDl().getSeqOf().get(0));
+ } catch (Exception ignored) {}
+
+ try {
+ xicicConfig.setEndPrbUl(config.getEndPrbUl().getSeqOf().get(0));
+ } catch (Exception ignored) {}
+
+ try {
+ xicicConfig.setStartPrbDl(config.getStartPrbDl().getSeqOf().get(0));
+ } catch (Exception ignored) {}
+
+ try {
+ xicicConfig.setEndPrbUl(config.getStartPrbUl().getSeqOf().get(0));
+ } catch (Exception ignored) {}
+
+ body.setXICICConfig(xicicConfig);
BerUTF8String ver = null;
try {
diff --git a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
index 1d9653d..ed7b0d2 100644
--- a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
+++ b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
@@ -107,6 +107,7 @@
private LinkMap linkMap;
/* MAPS */
private ConcurrentMap<String, ECGI> legitCells = new ConcurrentHashMap<>();
+ private ConcurrentMap<CRNTI, UEContextUpdate> hoContextUpdateMap = new ConcurrentHashMap<>();
private ConcurrentMap<CRNTI, SynchronousQueue<String>> hoQueue = new ConcurrentHashMap<>();
private ConcurrentMap<ECGI, SynchronousQueue<String>> RRMCellQueue = new ConcurrentHashMap<>();
private ConcurrentMap<CRNTI, SynchronousQueue<String>> scellAddQueue = new ConcurrentHashMap<>();
@@ -595,18 +596,23 @@
// Decode UE Admission Context Update.
UEContextUpdate ueContextUpdate = recv_pdu.getBody().getUEContextUpdate();
- RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
-
RnibUe ue = ueMap.get(ueContextUpdate.getMMEUES1APID());
- if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
- ue = new RnibUe();
+ if (hoQueue.keySet().contains(ue.getRanId())) {
+ CRNTI crnti = ueContextUpdate.getCrnti();
+ hoContextUpdateMap.put(crnti, ueContextUpdate);
+ hoQueue.remove(ue.getRanId());
+ } else {
+ RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
+ if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
+ ue = new RnibUe();
+ }
+
+ ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
+ ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
+ ue.setRanId(ueContextUpdate.getCrnti());
+
+ hostAgent.addConnectedHost(ue, cell, ctx);
}
-
- ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
- ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
- ue.setRanId(ueContextUpdate.getCrnti());
-
- hostAgent.addConnectedHost(ue, cell, ctx);
break;
}
case 6: {
@@ -714,6 +720,20 @@
e.printStackTrace();
} finally {
hoQueue.remove(hoComplete.getCrntiNew());
+
+ UEContextUpdate ueContextUpdate = hoContextUpdateMap.get(hoComplete.getCrntiNew());
+
+ RnibUe ue = ueMap.get(ueContextUpdate.getMMEUES1APID());
+ RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
+ if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
+ ue = new RnibUe();
+ }
+
+ ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
+ ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
+ ue.setRanId(ueContextUpdate.getCrnti());
+
+ hostAgent.addConnectedHost(ue, cell, ctx);
}
break;
}