2 * Copyright 2019 AT&T Intellectual Property
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 // Created by adi ENZEL on 12/10/19.
22 #include "E2Builder.h"
24 #include "asn1cFiles/ProtocolIE-Field.h"
27 X2SetupRequest_IEs_t *buildX2SetupIE(ProtocolIE_ID_t id,
28 Criticality_t criticality,
29 X2SetupRequest_IEs__value_PR present,
31 auto *x2SetupIE = (X2SetupRequest_IEs_t *)calloc(1, sizeof(X2SetupRequest_IEs_t));
33 x2SetupIE->criticality = criticality;
34 x2SetupIE->value.present = present;
37 case X2SetupRequest_IEs__value_PR_GlobalENB_ID: {
38 memcpy(&x2SetupIE->value.choice.GlobalENB_ID, value, sizeof(GlobalENB_ID_t));
41 case X2SetupRequest_IEs__value_PR_ServedCells: {
42 memcpy(&x2SetupIE->value.choice.ServedCells, value, sizeof(ServedCells_t));
45 case X2SetupRequest_IEs__value_PR_GUGroupIDList: {
46 memcpy(&x2SetupIE->value.choice.GUGroupIDList, value, sizeof(GUGroupIDList_t));
49 case X2SetupRequest_IEs__value_PR_LHN_ID: {
50 memcpy(&x2SetupIE->value.choice.LHN_ID, value, sizeof(LHN_ID_t));
53 case X2SetupRequest_IEs__value_PR_NOTHING:
67 void buildE2SetupRequest(X2SetupRequest_t *x2Setup, vector<X2SetupRequest_IEs_t> &member) {
68 for (auto v : member) {
69 ASN_SEQUENCE_ADD(&x2Setup->protocolIEs.list, &v);
75 mdclog_attr_init(&attr);
76 mdclog_attr_set_ident(attr, "setup Request");
78 mdclog_attr_destroy(attr);
81 int main(const int argc, char **argv) {
83 //mdclog_level_set(MDCLOG_WARN);
84 //mdclog_level_set(MDCLOG_INFO);
85 mdclog_level_set(MDCLOG_DEBUG);
87 // x2Setup X2AP-ELEMENTARY-PROCEDURE ::= {
88 // INITIATING MESSAGE X2SetupRequest
89 // SUCCESSFUL OUTCOME X2SetupResponse
90 // UNSUCCESSFUL OUTCOME X2SetupFailure
91 // PROCEDURE CODE id-x2Setup
97 // X2SetupRequest ::= SEQUENCE {
98 // protocolIEs ProtocolIE-Container {{X2SetupRequest-IEs}},
102 // X2SetupRequest-IEs X2AP-PROTOCOL-IES ::= {
103 // { ID id-GlobalENB-ID CRITICALITY reject TYPE GlobalENB-ID PRESENCE mandatory}|
104 // { ID id-ServedCells CRITICALITY reject TYPE ServedCells PRESENCE mandatory}|
105 // { ID id-GUGroupIDList CRITICALITY reject TYPE GUGroupIDList PRESENCE optional}|
106 // { ID id-LHN-ID CRITICALITY ignore TYPE LHN-ID PRESENCE optional},