Commit 756d9ab4 authored by Sreeshma Shiv's avatar Sreeshma Shiv

Add XNAP ASN.1 Definitions

 * New folder named  XNAP created inside openair2
 * Added ASN File(38423.asn) for XNAP  and .cmake(38423.cmake) for the same inside XNAP.
 * CMakeLists.txt files changed to support .C and .H file generation for XNAP
parent 392ef79b
......@@ -388,7 +388,6 @@ add_library(x2ap
target_link_libraries(x2ap PUBLIC asn1_x2ap)
target_link_libraries(x2ap PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
# F1AP
##############
set(F1AP_DIR ${OPENAIR2_DIR}/F1AP)
......
......@@ -6,3 +6,4 @@ add_subdirectory(F1AP)
add_subdirectory(M2AP)
add_subdirectory(X2AP)
add_subdirectory(RRC)
add_subdirectory(XNAP)
add_subdirectory(MESSAGES)
add_library(xnap xnap_common.c)
target_link_libraries(xnap
PUBLIC asn1_xnap
PRIVATE nr_rrc)
target_include_directories(xnap PUBLIC ${CMAKE_CURRENT_DIR})
This diff is collapsed.
This diff is collapsed.
set(XNAP_VERSION 16 2 0)
make_version(XNAP_cc ${XNAP_VERSION})
#add_definitions(-DXNAP_VERSION=${XNAP_cc})
string(REPLACE ";" "." XNAP_RELEASE "${XNAP_VERSION}")
if(XNAP_RELEASE VERSION_EQUAL "16.2.0")
include(ASN1/xnap_R16.2.0.cmake)
else()
message(FATAL_ERROR "unknown XNAP_RELEASE ${XNAP_RELEASE}")
endif()
add_custom_command(OUTPUT ${xnap_source} ${xnap_headers}
COMMAND ASN1C_PREFIX=XNAP_ ${ASN1C_EXEC} -pdu=all -gen-APER -no-gen-BER -no-gen-JER -no-gen-OER -gen-UPER -fcompound-names -no-gen-example -fno-include-deps -findirect-choice -D ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${XNAP_GRAMMAR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${XNAP_GRAMMAR}
COMMENT "Generating XNAP source files from ${CMAKE_CURRENT_SOURCE_DIR}/${XNAP_GRAMMAR}"
)
add_library(asn1_xnap ${xnap_source})
target_include_directories(asn1_xnap PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_options(asn1_xnap PRIVATE -DASN_DISABLE_OER_SUPPORT -w)
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdint.h>
#include "xnap_common.h"
#include "XNAP_XnAP-PDU.h"
ssize_t XNAP_generate_initiating_message(uint8_t **buffer,
uint32_t *length,
XNAP_ProcedureCode_t procedureCode,
XNAP_Criticality_t criticality,
asn_TYPE_descriptor_t *td,
void *sptr)
{
XNAP_XnAP_PDU_t pdu;
ssize_t encoded;
memset(&pdu, 0, sizeof(XNAP_XnAP_PDU_t));
pdu.present = XNAP_XnAP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage->procedureCode = procedureCode;
pdu.choice.initiatingMessage->criticality = criticality;
ANY_fromType_aper((ANY_t *)&pdu.choice.initiatingMessage->value, td, sptr);
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_XNAP_XnAP_PDU, 0, &pdu, (void **)buffer)) < 0) {
return -1;
}
*length = encoded;
return encoded;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Author and copyright: Laurent Thomas, open-cells.com
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef XNAP_COMMON_H_
#define XNAP_COMMON_H_
#include "XNAP_XnAP-PDU.h"
#include "intertask_interface.h"
#include "common/openairinterface5g_limits.h"
#include "oai_asn1.h"
#include "XNAP_ProtocolIE-Field.h"
#include "XNAP_InitiatingMessage.h"
#include "XNAP_ProtocolIE-ContainerPair.h"
#include "XNAP_ProtocolExtensionField.h"
#include "XNAP_ProtocolExtensionContainer.h"
#include "XNAP_asn_constant.h"
#ifndef XNAP_PORT
#define XNAP_PORT 38422
#endif
#define XNAP_FIND_PROTOCOLIE_BY_ID(IE_TYPE, ie, container, IE_ID, mandatory) \
do { \
IE_TYPE **ptr; \
ie = NULL; \
for (ptr = container->protocolIEs.list.array; ptr < &container->protocolIEs.list.array[container->protocolIEs.list.count]; \
ptr++) { \
if ((*ptr)->id == IE_ID) { \
ie = *ptr; \
break; \
} \
} \
if (mandatory) \
DevAssert(ie != NULL); \
} while (0)
ssize_t xnap_generate_initiating_message(uint8_t **buffer,
uint32_t *length,
XNAP_ProcedureCode_t procedureCode,
XNAP_Criticality_t criticality,
asn_TYPE_descriptor_t *td,
void *sptr);
#endif /* XNAP_COMMON_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment