Added Ranfunction OID for E2AP v1.01 31/7131/3
authornaman.gupta <naman.gupta@samsung.com>
Fri, 26 Nov 2021 14:46:56 +0000 (20:16 +0530)
committernaman.gupta <naman.gupta@samsung.com>
Fri, 26 Nov 2021 15:28:50 +0000 (20:58 +0530)
Added Ranfunction OID for E2AP v1.01

Issue-ID: RIC-640

Signed-off-by: naman.gupta <naman.gupta@samsung.com>
Change-Id: I37d7560d3b4178637376c21f3f6b931d73bf181e

e2sim/src/base/e2sim.cpp
e2sim/src/encoding/encode_e2apv1.cpp
e2sim/src/encoding/encode_e2apv1.hpp

index 485d338..5591e2a 100755 (executable)
@@ -29,6 +29,7 @@
 #include "e2sim_sctp.hpp"
 #include "e2ap_message_handler.hpp"
 #include "encode_e2apv1.hpp"
+#include "RANfunctionOID.h"
 
 using namespace std;
 
@@ -138,6 +139,11 @@ int E2Sim::run_loop(int argc, char* argv[]){
   printf("client_fd value is %d\n", client_fd);
   
   std::vector<encoding::ran_func_info> all_funcs;
+  RANfunctionOID_t *ranFunctionOIDe = (RANfunctionOID_t*)calloc(1,sizeof(RANfunctionOID_t));
+  uint8_t *buf = (uint8_t*)"OID123";
+  ranFunctionOIDe->buf = (uint8_t*)calloc(1,strlen((char*)buf)+1);
+  memcpy(ranFunctionOIDe->buf, buf, strlen((char*)buf)+1);
+  ranFunctionOIDe->size = strlen((char*)buf);
 
   //Loop through RAN function definitions that are registered
 
@@ -148,6 +154,8 @@ int E2Sim::run_loop(int argc, char* argv[]){
     next_func.ranFunctionId = elem.first;
     next_func.ranFunctionDesc = elem.second;
     next_func.ranFunctionRev = (long)2;
+    next_func.ranFunctionOId = ranFunctionOIDe;
+
     all_funcs.push_back(next_func);
   }
     
index b237d68..501faa5 100755 (executable)
@@ -225,7 +225,7 @@ void encoding::generate_e2apv1_setup_request_parameterized(E2AP_PDU_t *e2ap_pdu,
     itemIes->criticality = Criticality_reject;
     itemIes->value.present = RANfunction_ItemIEs__value_PR_RANfunction_Item;
     itemIes->value.choice.RANfunction_Item.ranFunctionID = nextRanFuncId;
-
+    itemIes->value.choice.RANfunction_Item.ranFunctionOID = nextRanFunc.ranFunctionOId;
     int ranFuncLength = strlen((char*)nextRanFuncDesc);
 
     itemIes->value.choice.RANfunction_Item.ranFunctionDefinition = *nextRanFuncDesc;
index 6bbbe56..233bb69 100644 (file)
@@ -28,7 +28,7 @@ extern "C" {
 
 #include "E2AP-PDU.h"
 #include "OCTET_STRING.h"
-
+#include "PrintableString.h"
 }
 
 namespace encoding {
@@ -37,6 +37,7 @@ namespace encoding {
     long ranFunctionId;
     OCTET_STRING_t *ranFunctionDesc;
     long ranFunctionRev;
+    PrintableString_t *ranFunctionOId;
   };
   
   long get_function_id_from_subscription(E2AP_PDU_t *e2ap_pdu);