Fix invocation to generate setup message
[sim/e2-interface.git] / e2sim / src / base / e2sim.cpp
index e28cbd4..3e17b76 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,11 +154,12 @@ 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);
   }
     
   printf("about to call setup request encode\n");
-  
   generate_e2apv1_setup_request_parameterized(pdu_setup, all_funcs);
 
   printf("After generating e2setup req\n");
@@ -167,7 +174,7 @@ int E2Sim::run_loop(int argc, char* argv[]){
   sctp_buffer_t data;
 
   char error_buf[300] = {0, };
-  size_t errlen;
+  size_t errlen = 0;
 
   asn_check_constraints(&asn_DEF_E2AP_PDU, pdu_setup, error_buf, &errlen);
   printf("error length %d\n", errlen);