From: aa7133@att.com Date: Tue, 31 Mar 2020 10:35:06 +0000 (+0300) Subject: version 4.0.6 X-Git-Tag: 5.4.8~66 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=c41673dc62caa034b6d0066ef739d0135dd791e4;p=ric-plt%2Fe2.git version 4.0.6 added routing to docker router and added E2SM paramters to the setupRequest testing Add fix to thedocker file Change-Id: Icbab3ef73094ceed5cb3bbec4cf4d88b8409e71e Signed-off-by: aa7133@att.com --- diff --git a/RIC-E2-TERMINATION/Dockerfile b/RIC-E2-TERMINATION/Dockerfile index f341268..46d9c29 100644 --- a/RIC-E2-TERMINATION/Dockerfile +++ b/RIC-E2-TERMINATION/Dockerfile @@ -76,14 +76,7 @@ RUN if [$BUILD_TYPE == "Debug"] ; then make e2_coverage ; fi # && find / -type f -name "libopentracing.a" -exec cp {} libopentracing.a \; && cd /opt/e2/RIC-E2-TERMINATION && ls nlohmann \ FROM ubuntu:18.04 - -RUN apt-get update && apt-get install -y \ - net-tools \ - iputils-ping \ - curl \ - tcpdump - -RUN mkdir -p /opt/e2/config +RUN apt-get update && apt-get install -y net-tools iputils-ping curl tcpdump && mkdir -p /opt/e2/config COPY --from=ubuntu /opt/e2/e2 /opt/e2/e2 COPY --from=ubuntu /opt/e2/rmr.verbose /tmp/rmr.verbose @@ -154,4 +147,3 @@ ENV E2TERM_POD_NAME=e2term RUN chmod +x /opt/e2/startup.sh EXPOSE 38000 CMD ["sh", "-c", "./startup.sh"] - diff --git a/RIC-E2-TERMINATION/TEST/T1/E2Builder.h b/RIC-E2-TERMINATION/TEST/T1/E2Builder.h index c8f6f39..039f7c5 100644 --- a/RIC-E2-TERMINATION/TEST/T1/E2Builder.h +++ b/RIC-E2-TERMINATION/TEST/T1/E2Builder.h @@ -29,6 +29,9 @@ #include #include #include +#include <3rdparty/oranE2SM/E2SM-gNB-NRT-RANfunction-Definition.h> +#include <3rdparty/oranE2SM/RIC-InsertStyle-List.h> +#include <3rdparty/oranE2SM/RANparameterDef-Item.h> //#include @@ -527,16 +530,80 @@ void buildSetupRequestWithFunc(E2AP_PDU_t *pdu, int mcc, int mnc) { auto *itemIes = (RANfunction_ItemIEs_t *)calloc(1, sizeof(RANfunction_ItemIEs_t)); ASN_STRUCT_RESET(asn_DEF_RANfunction_ItemIEs, itemIes); - uint8_t buf[3] = {0x33, 0x44, 0x55}; + + E2SM_gNB_NRT_RANfunction_Definition_t ranFunDef; + uint8_t funcDes[] = "asdfghjklpoiuytrewq\0"; + ranFunDef.ranFunction_Name.ranFunction_Description.buf = (uint8_t *)calloc(1, strlen((char *)funcDes)); + ranFunDef.ranFunction_Name.ranFunction_Description.size = strlen((char *)funcDes); + memcpy(ranFunDef.ranFunction_Name.ranFunction_Description.buf, funcDes, strlen((char *)funcDes)); + + uint8_t funcOID[] = "ABCDEFGHIJ1234567890\0"; + ranFunDef.ranFunction_Name.ranFunction_E2SM_OID.buf = (uint8_t *)calloc(1, strlen((char *)funcOID)); + ranFunDef.ranFunction_Name.ranFunction_E2SM_OID.size = strlen((char *)funcOID); + memcpy(ranFunDef.ranFunction_Name.ranFunction_E2SM_OID.buf, funcOID, strlen((char *)funcOID)); + + uint8_t shortName[] = "Nothing to declare\0"; + ranFunDef.ranFunction_Name.ranFunction_ShortName.buf = (uint8_t *)calloc(1, strlen((char *)shortName)); + ranFunDef.ranFunction_Name.ranFunction_ShortName.size = strlen((char *)shortName); + memcpy(ranFunDef.ranFunction_Name.ranFunction_ShortName.buf, shortName, strlen((char *)shortName)); + + + RIC_InsertStyle_List_t insertStyleList; + insertStyleList.ric_CallProcessIDFormat_Type = 28l; + insertStyleList.ric_IndicationHeaderFormat_Type = 29; + insertStyleList.ric_IndicationMessageFormat_Type = 30; + insertStyleList.ric_InsertActionFormat_Type = 31l; + + uint8_t styleName[] = "What a style\0"; + + insertStyleList.ric_InsertStyle_Name.buf = (uint8_t *)calloc(1, strlen((char *)styleName)); + insertStyleList.ric_InsertStyle_Name.size = strlen((char *)styleName); + memcpy(insertStyleList.ric_InsertStyle_Name.buf, styleName, strlen((char *)styleName)); + + + insertStyleList.ric_InsertStyle_Type = 23; + + RANparameterDef_Item_t raNparameterDefItem; + raNparameterDefItem.ranParameter_ID = 8; + raNparameterDefItem.ranParameter_Type = 12; + + uint8_t ItemName[] = "What a style\0"; + raNparameterDefItem.ranParameter_Name.buf = (uint8_t *)calloc(1, strlen((char *)ItemName)); + raNparameterDefItem.ranParameter_Name.size = strlen((char *)ItemName); + memcpy(raNparameterDefItem.ranParameter_Name.buf, ItemName, strlen((char *)ItemName)); + + ASN_SEQUENCE_ADD(&insertStyleList.ric_InsertRanParameterDef_List.list, &raNparameterDefItem); + + ASN_SEQUENCE_ADD(&ranFunDef.ric_InsertStyle_List->list, &insertStyleList); + //ranFunDef.ric_InsertStyle_List. + + uint8_t buffer[8192]; + size_t buffer_size = 8192; + auto *ranDef = &itemIes->value.choice.RANfunction_Item.ranFunctionDefinition; + + auto er = asn_encode_to_buffer(nullptr, ATS_ALIGNED_BASIC_PER, &asn_DEF_E2SM_gNB_NRT_RANfunction_Definition, &ranFunDef, buffer, buffer_size); + if (er.encoded == -1) { + cerr << "encoding of " << asn_DEF_E2SM_gNB_NRT_RANfunction_Definition.name << " failed, " << strerror(errno) << endl; + exit(-1); + } else if (er.encoded > (ssize_t) buffer_size) { + cerr << "Buffer of size " << buffer_size << " is to small for " << asn_DEF_E2SM_gNB_NRT_RANfunction_Definition.name << endl; + exit(-1); + } else { + ranDef->buf = (uint8_t *)calloc(1, er.encoded); + ranDef->size = er.encoded; + memcpy(ranDef->buf, buffer, ranDef->size); + } + + itemIes->id = ProtocolIE_ID_id_RANfunction_Item; itemIes->criticality = Criticality_reject; itemIes->value.present = RANfunction_ItemIEs__value_PR_RANfunction_Item; itemIes->value.choice.RANfunction_Item.ranFunctionID = 1; - auto *ranDef = &itemIes->value.choice.RANfunction_Item.ranFunctionDefinition; - ranDef->size = 3; - ranDef->buf = (uint8_t *)calloc(1, ranDef->size); - memcpy(ranDef->buf, buf, ranDef->size); +// auto *ranDef = &itemIes->value.choice.RANfunction_Item.ranFunctionDefinition; +// ranDef->size = 3; +// ranDef->buf = (uint8_t *)calloc(1, ranDef->size); +// memcpy(ranDef->buf, buf, ranDef->size); ASN_SEQUENCE_ADD(&ranFlistIEs->value.choice.RANfunctions_List.list, itemIes); @@ -547,9 +614,11 @@ void buildSetupRequestWithFunc(E2AP_PDU_t *pdu, int mcc, int mnc) { itemIes1->value.present = RANfunction_ItemIEs__value_PR_RANfunction_Item; itemIes1->value.choice.RANfunction_Item.ranFunctionID = 7; ranDef = &itemIes1->value.choice.RANfunction_Item.ranFunctionDefinition; - ranDef->size = 3; - ranDef->buf = (uint8_t *)calloc(1, ranDef->size); - memcpy(ranDef->buf, buf, ranDef->size); + + ranDef->buf = (uint8_t *)calloc(1, er.encoded); + ranDef->size = er.encoded; + memcpy(ranDef->buf, buffer, ranDef->size); + ASN_SEQUENCE_ADD(&ranFlistIEs->value.choice.RANfunctions_List.list, itemIes1); diff --git a/RIC-E2-TERMINATION/TEST/testAsn/setUpMessages/SetUpMessages.cpp b/RIC-E2-TERMINATION/TEST/testAsn/setUpMessages/SetUpMessages.cpp index 542e16f..7137401 100644 --- a/RIC-E2-TERMINATION/TEST/testAsn/setUpMessages/SetUpMessages.cpp +++ b/RIC-E2-TERMINATION/TEST/testAsn/setUpMessages/SetUpMessages.cpp @@ -68,41 +68,76 @@ void extractPdu(E2AP_PDU_t *pdu, unsigned char *buffer, int buffer_size) { } else { cout << "XML result = " << buffer << endl; } - } -unsigned char setupBuffer[309] = { - 0x00, 0x01, 0x00, 0x82, 0x64, 0x00, 0x00, 0x02, 0x00, 0x03, - 0x00, 0x08, 0x00, 0x02, 0xf8, 0x21, 0x03, 0x03, 0x03, 0x00, - 0x00, 0xa0, 0x08, 0x25, 0x00, 0x00, 0x30, 0x00, 0x84, 0x08, - 0x0d, 0xf0, 0x00, 0x00, 0x18, 0x0d, 0x87, 0x90, 0x28, 0x06, - 0x74, 0xe4, 0x22, 0xd5, 0x83, 0x20, 0x00, 0x02, 0x03, 0x12, - 0xe3, 0x32, 0xe3, 0x62, 0xe3, 0x12, 0xe3, 0x42, 0xe3, 0x12, - 0xe3, 0x23, 0x83, 0x43, 0x53, 0x82, 0xe3, 0x93, 0x92, 0xe3, - 0x02, 0xe3, 0x23, 0x12, 0xe3, 0x32, 0xe3, 0x32, 0xe3, 0x12, - 0xe3, 0x20, 0xb8, 0x06, 0x74, 0xe4, 0x22, 0x05, 0x83, 0x22, - 0x04, 0xe6, 0x57, 0x47, 0x76, 0xf7, 0x26, 0xb2, 0x04, 0x96, - 0xe7, 0x46, 0x57, 0x26, 0x66, 0x16, 0x36, 0x50, 0x10, 0x00, - 0x00, 0x10, 0x10, 0x80, 0x04, 0xd6, 0x57, 0x37, 0x36, 0x16, - 0x76, 0x52, 0x05, 0x47, 0x97, 0x06, 0x52, 0x06, 0xf6, 0xe6, - 0xc7, 0x90, 0x10, 0x10, 0x00, 0x10, 0x10, 0x78, 0x04, 0x36, - 0xf6, 0xd7, 0x06, 0xc6, 0x57, 0x46, 0x52, 0x06, 0xd6, 0x57, - 0x37, 0x36, 0x16, 0x76, 0x50, 0x10, 0x10, 0x00, 0x00, 0x10, - 0x58, 0x04, 0x16, 0x46, 0x45, 0x46, 0x96, 0xd6, 0x57, 0x37, - 0x46, 0x16, 0xd7, 0x02, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, - 0x10, 0x10, 0x78, 0x04, 0x36, 0xf6, 0xd7, 0x06, 0xc6, 0x57, - 0x46, 0x52, 0x06, 0xd6, 0x57, 0x37, 0x36, 0x16, 0x76, 0x50, - 0x10, 0x10, 0x00, 0x00, 0x10, 0x58, 0x04, 0x16, 0x46, 0x45, - 0x46, 0x96, 0xd6, 0x57, 0x37, 0x46, 0x16, 0xd7, 0x02, 0x00, - 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x10, 0x78, - 0x04, 0x36, 0xf6, 0xd7, 0x06, 0xc6, 0x57, 0x46, 0x52, 0x06, - 0xd6, 0x57, 0x37, 0x36, 0x16, 0x76, 0x50, 0x10, 0x10, 0x10, - 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x84, 0x08, 0x0a, 0xc0, - 0x00, 0x00, 0x28, 0x0a, 0x56, 0x80, 0x30, 0x06, 0x74, 0xe4, - 0x22, 0xd4, 0xe5, 0x25, 0x40, 0x00, 0x02, 0x03, 0x12, 0xe3, - 0x32, 0xe3, 0x62, 0xe3, 0x12, 0xe3, 0x42, 0xe3, 0x12, 0xe3, - 0x23, 0x83, 0x43, 0x53, 0x82, 0xe3, 0x93, 0x92, 0xe3, 0x02, - 0xe3, 0x23, 0x12, 0xe3, 0x32, 0xe3, 0x32, 0xe3, 0}; + +std::string otherXml = "\n" + " \n" + " 1\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " 4\n" + " \n" + " \n" + " \n" + " 13 10 14\n" + " \n" + " 10011001101010101011" + " \n" + " \n" + " \n" + " \n" + " \n" + " 9\n" + " \n" + " \n" + " \n" + " \n" + " 6\n" + " \n" + " \n" + " \n" + " 1\n" + " 1\n" + " \n" + " \n" + " \n" + " \n" + " 6\n" + " \n" + " \n" + " \n" + " 2\n" + " 1\n" + " \n" + " \n" + " \n" + " \n" + " 6\n" + " \n" + " \n" + " \n" + " 3\n" + " 1\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + "\n"; + + + +std::string newXml = + "1413 10 14101010101100110011109611621631"; auto main(const int argc, char **argv) -> int { E2AP_PDU_t pdu; @@ -112,6 +147,19 @@ auto main(const int argc, char **argv) -> int { auto buffer_size = 8192; unsigned char buffer[8192] = {}; + E2AP_PDU_t *XERpdu = nullptr; + auto rval = asn_decode(nullptr, ATS_BASIC_XER, &asn_DEF_E2AP_PDU, (void **) &XERpdu, + newXml.c_str(), newXml.length()); + if (rval.code != RC_OK) { + cout << "Error " << rval.code << " (unpack) setup response " << endl; + //return -1; + } + + asn_fprint(stream, &asn_DEF_E2AP_PDU, XERpdu); + cout << "Encoding E2AP PDU of size " << size << endl << printBuffer << endl; + fseek(stream,0,SEEK_SET); + +// cout << "=========================" << endl << otherXml << endl << "========================" << endl; buildSetupRequest(&pdu, 311, 410); asn_fprint(stream, &asn_DEF_E2AP_PDU, &pdu); @@ -144,6 +192,7 @@ auto main(const int argc, char **argv) -> int { extractPdu(&pdu, buffer, buffer_size); + cout << "Failure outcome" << endl; ASN_STRUCT_RESET(asn_DEF_E2AP_PDU, &pdu); memset(buffer, 0, buffer_size); diff --git a/RIC-E2-TERMINATION/dockerRouter.txt b/RIC-E2-TERMINATION/dockerRouter.txt index 46f5b05..f14a197 100644 --- a/RIC-E2-TERMINATION/dockerRouter.txt +++ b/RIC-E2-TERMINATION/dockerRouter.txt @@ -22,7 +22,5 @@ rte|10091|10.0.2.15:4801 rte|10092|10.0.2.15:4801 rte|1101|10.0.2.15:38000 rte|1102|10.0.2.15:3801 -rte|12001|10.0.2.15:3801 +rte|12001|10.0.2.15:3801 newrt|end - -