Commit a247907d authored by Bi-Ruei, Chiu's avatar Bi-Ruei, Chiu

Use an un-official community collaboration version of asn1c

1. It's no need to modify LTE-RRC's ASN.1 file for enabling option group
   feature in generate_asn1.
2. It's no need to patch the C header files generated from
   LTE-RRC/S1AP/X2AP's ASN.1 in fix_asn1.
3. It's no need to pre-process S1AP/X2AP's ASN.1 for enabling information
   object class feature by asn1tostruct.py.

This commit requires an un-official version of asn1c which are
collaboration of asn1c community members and `build_helper` is modified
in this commit accordingly :

  https://github.com/brchiu/asn1c/tree/velichkov_s1ap_plus_option_group

This asn1c can also convert ASN.1 of 5G NR RRC (38.331, v15.1.0) and
generate C files with -findirect-choice command line option without
tweaking ASN.1 file.

Examples for how to use this asn1c for S1AP are in S1AP files, e.g.
s1ap_eNB_nas_procedures.c and s1ap_eNB_handler.c.

There is an modified openair-cn (based on tag 0.5.0) with this new asn1c at :

  https://github.com/brchiu/openair-cn/tree/new-asn1c

Basic S1AP interaction and data transfer operation between OAI eNB and
this modified openair-cn has been tested.

Note: Community version of asn1c is keeping evolved to provide better usage.
parent df1e5b21
This diff is collapsed.
......@@ -678,8 +678,10 @@ install_asn1c_from_source(){
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
(
$SUDO rm -rf /tmp/asn1c
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
# GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
git clone https://github.com/brchiu/asn1c /tmp/asn1c
cd /tmp/asn1c
git checkout velichkov_s1ap_plus_option_group
./configure
make -j`nproc`
$SUDO make install
......
......@@ -22,7 +22,7 @@
#ifndef GTPV1_U_MESSAGES_TYPES_H_
#define GTPV1_U_MESSAGES_TYPES_H_
#include "asn1_constants.h"
#include "asn_constant.h"
#define GTPV1U_MAX_BEARERS_PER_UE max_val_DRB_Identity
......
......@@ -29,7 +29,7 @@
***************************************************************************/
#ifdef CMAKER
#include "asn1_constants.h"
#include "asn_constant.h"
#else
#include "RRC/LTE/MESSAGES/asn1_constants.h"
#endif
......
......@@ -21,7 +21,7 @@
#ifndef RAL_MESSAGES_TYPES_H_
#define RAL_MESSAGES_TYPES_H_
#include "asn1_constants.h"
#include "asn_constant.h"
#include "platform_types.h"
#include "commonDef.h"
/* 802.21 mappings with the RRC protocol :
......
......@@ -38,7 +38,7 @@ MESSAGE_DEF(S1AP_E_RAB_MODIFY_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgTex
MESSAGE_DEF(S1AP_PAGING_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_paging_log)
MESSAGE_DEF(S1AP_E_RAB_RELEASE_REQUEST_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_release_request_log)
MESSAGE_DEF(S1AP_E_RAB_RELEASE_RESPONSE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_e_rab_release_response_log)
MESSAGE_DEF(S1AP_E_RAB_ERROR_INDICATION_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_error_indication_log)
MESSAGE_DEF(S1AP_ERROR_INDICATION_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_error_indication_log)
/* eNB application layer -> S1AP messages */
MESSAGE_DEF(S1AP_REGISTER_ENB_REQ , MESSAGE_PRIORITY_MED, s1ap_register_enb_req_t , s1ap_register_enb_req)
......
......@@ -44,7 +44,7 @@
# include "rlc_am_structs.h"
# include "rlc_tm_structs.h"
# include "rlc_um_structs.h"
# include "asn1_constants.h"
# include "asn_constant.h"
# include "UTIL/LOG/log.h"
# include "mem_block.h"
//# include "PHY/defs.h"
......
......@@ -99,15 +99,29 @@ void *ue_ip_interrupt(void)
}
#endif //NETLINK
//---------------------------------------------------------------------------
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
void ue_ip_timer(struct timer_list *t)
#else
void ue_ip_timer(unsigned long dataP)
#endif
{
//---------------------------------------------------------------------------
ue_ip_priv_t *priv_p=(ue_ip_priv_t *)dataP;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
ue_ip_priv_t *priv_p = from_timer(priv_p, t, timer);
#else
ue_ip_priv_t *priv_p = (ue_ip_priv_t *)dataP;
#endif
spin_lock(&priv_p->lock);
(priv_p->timer).function=ue_ip_timer;
(priv_p->timer).expires=jiffies+UE_IP_TIMER_TICK;
(priv_p->timer).data=dataP;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
mod_timer(&priv_p->timer, jiffies + UE_IP_TIMER_TICK);
#else
(priv_p->timer).function = ue_ip_timer;
(priv_p->timer).expires = jiffies + UE_IP_TIMER_TICK;
(priv_p->timer).data = dataP;
add_timer(&priv_p->timer);
#endif
spin_unlock(&priv_p->lock);
return;
// add_timer(&gpriv->timer);
......@@ -137,10 +151,15 @@ int ue_ip_open(struct net_device *dev_pP)
netif_wake_queue(dev_pP);
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
timer_setup(&(priv_p->timer), ue_ip_timer, 0);
(priv_p->timer).expires = jiffies+UE_IP_TIMER_TICK;
#else
init_timer(&priv_p->timer);
(priv_p->timer).expires = jiffies+UE_IP_TIMER_TICK;
(priv_p->timer).data = (unsigned long)priv_p;
(priv_p->timer).function = ue_ip_timer;
#endif
//add_timer(&priv_p->timer);
printk("[UE_IP_DRV][%s] name = %s\n", __FUNCTION__, dev_pP->name);
......
......@@ -131,6 +131,7 @@ mac_rrc_data_req(
mib->message.systemFrameNumber.buf = &sfn;
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message,
NULL,
(void*)mib,
carrier->MIB,
24);
......
......@@ -241,6 +241,7 @@ uint8_t do_MIB(rrc_eNB_carrier_data_t *carrier, uint32_t N_RB_DL, uint32_t phich
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message,
NULL,
(void*)mib,
carrier->MIB,
24);
......@@ -320,6 +321,7 @@ uint8_t do_MIB_SL(const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,
enc_rval = uper_encode_to_buffer(&asn_DEF_SBCCH_SL_BCH_Message,
NULL,
(void*)mib_sl,
UE_rrc_inst[ctxt_pP->module_id].MIB,
24);
......@@ -509,6 +511,7 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier,
xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message, (void*)bcch_message);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message,
NULL,
(void*)bcch_message,
buffer,
100);
......@@ -1354,6 +1357,7 @@ uint8_t do_SIB23(uint8_t Mod_id,
xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message, (void*)bcch_message);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message,
NULL,
(void*)bcch_message,
buffer,
900);
......@@ -1442,6 +1446,7 @@ uint8_t do_RRCConnectionRequest(uint8_t Mod_id, uint8_t *buffer,uint8_t *rv)
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_CCCH_Message,
NULL,
(void*)&ul_ccch_msg,
buffer,
100);
......@@ -1609,6 +1614,7 @@ uint8_t do_SidelinkUEInformation(uint8_t Mod_id, uint8_t *buffer, SL_Destinatio
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
NULL,
(void*)&ul_dcch_msg,
buffer,
100);
......@@ -1693,6 +1699,7 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uin
*/
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
NULL,
(void*)&ul_dcch_msg,
buffer,
100);
......@@ -1753,6 +1760,7 @@ do_RRCConnectionReconfigurationComplete(
rrcConnectionReconfigurationComplete->criticalExtensions.choice.rrcConnectionReconfigurationComplete_r8.nonCriticalExtension=NULL;
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
NULL,
(void*)&ul_dcch_msg,
buffer,
100);
......@@ -2163,6 +2171,7 @@ do_RRCConnectionSetup(
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message,
NULL,
(void*)&dl_ccch_msg,
buffer,
100);
......@@ -2237,6 +2246,7 @@ do_SecurityModeCommand(
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message, (void*)&dl_dcch_msg);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message,
NULL,
(void*)&dl_dcch_msg,
buffer,
100);
......@@ -2316,6 +2326,7 @@ do_UECapabilityEnquiry(
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message, (void*)&dl_dcch_msg);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message,
NULL,
(void*)&dl_dcch_msg,
buffer,
100);
......@@ -2520,6 +2531,7 @@ do_RRCConnectionReconfiguration(
}
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message,
NULL,
(void*)&dl_dcch_msg,
buffer,
RRC_BUF_SIZE);
......@@ -2736,6 +2748,7 @@ do_RRCConnectionReestablishment(
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message,
NULL,
(void*)&dl_ccch_msg,
buffer,
100);
......@@ -2797,6 +2810,7 @@ do_RRCConnectionReestablishmentReject(
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message,
NULL,
(void*)&dl_ccch_msg,
buffer,
100);
......@@ -2859,6 +2873,7 @@ do_RRCConnectionReject(
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message,
NULL,
(void*)&dl_ccch_msg,
buffer,
100);
......@@ -2924,6 +2939,7 @@ uint8_t do_RRCConnectionRelease(
sizeof(*rrcConnectionRelease->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r8.nonCriticalExtension));
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message,
NULL,
(void*)&dl_dcch_msg,
buffer,
RRC_BUF_SIZE);
......@@ -3051,6 +3067,7 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id,
xer_fprint(stdout,&asn_DEF_MCCH_Message,(void*)mcch_message);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_MCCH_Message,
NULL,
(void*)mcch_message,
buffer,
100);
......@@ -3183,6 +3200,7 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA=*(measResultListEUTRA2);
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
NULL,
(void*)&ul_dcch_msg,
buffer,
100);
......@@ -3316,7 +3334,7 @@ uint8_t do_Paging(uint8_t Mod_id, uint8_t *buffer, ue_paging_identity_t ue_pagin
LOG_D(RRC, "[eNB %d] do_Paging paging_record: cn_Domain %ld, ue_paging_identity.presenceMask %d, PagingRecordList.count %d\n",
Mod_id, paging_record_p->cn_Domain, ue_paging_identity.presenceMask, pcch_msg.message.choice.c1.choice.paging.pagingRecordList->list.count);
enc_rval = uper_encode_to_buffer(&asn_DEF_PCCH_Message, (void*)&pcch_msg, buffer, RRC_BUF_SIZE);
enc_rval = uper_encode_to_buffer(&asn_DEF_PCCH_Message, NULL, (void*)&pcch_msg, buffer, RRC_BUF_SIZE);
if(enc_rval.encoded == -1)
{
LOG_I(RRC, "[eNB AssertFatal]ASN1 message encoding failed (%s, %lu)!\n",
......@@ -3492,6 +3510,7 @@ OAI_UECapability_t *fill_ue_capability(char *UE_EUTRA_Capability_xer_fname)
xer_fprint(stdout,&asn_DEF_UE_EUTRA_Capability,(void *)UE_EUTRA_Capability);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_UE_EUTRA_Capability,
NULL,
(void*)UE_EUTRA_Capability,
&UECapability.sdu[0],
MAX_UE_CAPABILITY_SIZE);
......
......@@ -131,6 +131,7 @@ uint8_t do_MIB_NB_IoT(
(uint32_t)hsfn_LSB);
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_BCH_Message_NB,
NULL,
(void*)mib_NB_IoT,
carrier->MIB_NB_IoT,
100);
......@@ -387,6 +388,7 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message_NB,
NULL,
(void*)bcch_message,
carrier->SIB1_NB_IoT,
100);
......@@ -669,6 +671,7 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id,
xer_fprint(stdout, &asn_DEF_BCCH_DL_SCH_Message_NB, (void*)bcch_message);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_BCCH_DL_SCH_Message_NB,
NULL,
(void*)bcch_message,
carrier->SIB23_NB_IoT,
900);
......@@ -888,6 +891,7 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB,
NULL,
(void*)&dl_ccch_msg_NB_IoT,
buffer,
100);
......@@ -939,6 +943,7 @@ uint8_t do_SecurityModeCommand_NB_IoT(
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message_NB, (void*)&dl_dcch_msg_NB_IoT);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
NULL,
(void*)&dl_dcch_msg_NB_IoT,
buffer,
100);
......@@ -1000,6 +1005,7 @@ uint8_t do_UECapabilityEnquiry_NB_IoT(
xer_fprint(stdout, &asn_DEF_DL_DCCH_Message_NB, (void*)&dl_dcch_msg_NB_IoT);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
NULL,
(void*)&dl_dcch_msg_NB_IoT,
buffer,
100);
......@@ -1094,6 +1100,7 @@ uint16_t do_RRCConnectionReconfiguration_NB_IoT(
rrcConnectionReconfiguration_NB->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r13.fullConfig_r13 = NULL;
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
NULL,
(void*)&dl_dcch_msg_NB_IoT,
buffer,
RRC_BUF_SIZE);
......@@ -1140,6 +1147,7 @@ uint8_t do_RRCConnectionReestablishmentReject_NB_IoT(
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message_NB, (void*)&dl_ccch_msg_NB_IoT);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB,
NULL,
(void*)&dl_ccch_msg_NB_IoT,
buffer,
100);
......@@ -1210,6 +1218,7 @@ uint8_t do_RRCConnectionReject_NB_IoT(
xer_fprint(stdout, &asn_DEF_DL_CCCH_Message_NB, (void*)&dl_ccch_msg);
#endif
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB,
NULL,
(void*)&dl_ccch_msg_NB_IoT,
buffer,
100);
......@@ -1336,6 +1345,7 @@ uint8_t do_RRCConnectionReestablishment_NB_IoT(
rrcConnectionReestablishment_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionReestablishment_r13.nextHopChainingCount_r13=0;
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message_NB,
NULL,
(void*)&dl_ccch_msg_NB_IoT,
buffer,
RRC_BUF_SIZE);
......@@ -1405,6 +1415,7 @@ uint8_t do_RRCConnectionRelease_NB_IoT(
sizeof(*rrcConnectionRelease_NB_IoT->criticalExtensions.choice.c1.choice.rrcConnectionRelease_r13.nonCriticalExtension));
enc_rval = uper_encode_to_buffer(&asn_DEF_DL_DCCH_Message_NB,
NULL,
(void*)&dl_dcch_msg_NB_IoT,
buffer,
RRC_BUF_SIZE);//check
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1926,6 +1926,7 @@ rrc_ue_process_securityModeCommand(
ctxt_pP->module_id,ctxt_pP->frame, ctxt_pP->subframe, eNB_index, securityModeCommand->rrc_TransactionIdentifier);
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message,
NULL,
(void*)&ul_dcch_msg,
buffer,
100);
......@@ -2039,7 +2040,7 @@ rrc_ue_process_ueCapabilityEnquiry(
&ul_dcch_msg.message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list,
&ue_CapabilityRAT_Container);
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, (void*) &ul_dcch_msg, buffer, 100);
enc_rval = uper_encode_to_buffer(&asn_DEF_UL_DCCH_Message, NULL, (void*) &ul_dcch_msg, buffer, 100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %jd)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
......
......@@ -7142,8 +7142,8 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) {
LOG_I(RRC, "got UE capabilities for UE %x\n", ctxt_pP->rnti);
if (ue_context_p->ue_context.UE_Capability) {
LOG_I(RRC, "freeing old UE capabilities for UE %x\n", ctxt_pP->rnti);
asn_DEF_UE_EUTRA_Capability.free_struct(&asn_DEF_UE_EUTRA_Capability,
ue_context_p->ue_context.UE_Capability, 0);
ASN_STRUCT_FREE(asn_DEF_UE_EUTRA_Capability,
ue_context_p->ue_context.UE_Capability);
ue_context_p->ue_context.UE_Capability = 0;
}
dec_rval = uper_decode(NULL,
......@@ -7163,8 +7163,8 @@ if (ue_context_p->ue_context.nb_of_modify_e_rabs > 0) {
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Failed to decode UE capabilities (%zu bytes)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
dec_rval.consumed);
asn_DEF_UE_EUTRA_Capability.free_struct(&asn_DEF_UE_EUTRA_Capability,
ue_context_p->ue_context.UE_Capability, 0);
ASN_STRUCT_FREE(asn_DEF_UE_EUTRA_Capability,
ue_context_p->ue_context.UE_Capability);
ue_context_p->ue_context.UE_Capability = 0;
}
......
......@@ -58,7 +58,7 @@
#include "RRC/LTE/rrc_eNB_GTPV1U.h"
#include "TLVDecoder.h"
#include "S1ap-NAS-PDU.h"
#include "S1AP_NAS-PDU.h"
#include "flexran_agent_common_internal.h"
extern RAN_CONTEXT_t RC;
......@@ -678,7 +678,8 @@ void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(
return;
}
asn_enc_rval_t ret = uper_encode_to_buffer(&asn_DEF_UECapabilityInformation, ueCapabilityInformation, buf, 4096);
asn_enc_rval_t ret = uper_encode_to_buffer(&asn_DEF_UECapabilityInformation, NULL, ueCapabilityInformation, buf, 4096);
if (ret.encoded == -1) abort();
memset(&rac, 0, sizeof(UERadioAccessCapabilityInformation_t));
......@@ -692,7 +693,9 @@ void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(
/* 8192 is arbitrary, should be big enough */
buf2 = malloc16(8192);
if (buf2 == NULL) abort();
ret = uper_encode_to_buffer(&asn_DEF_UERadioAccessCapabilityInformation, &rac, buf2, 8192);
ret = uper_encode_to_buffer(&asn_DEF_UERadioAccessCapabilityInformation, NULL, &rac, buf2, 8192);
if (ret.encoded == -1) abort();
MessageDef *msg_p;
......
include Makefile.inc
OBJS=$(addprefix MESSAGES/,${ASN_MODULE_SOURCES:.c=.o})
CFLAGS += -DEMIT_ASN_DEBUG=1
CFLAGS += -Wall
CFLAGS += -g
OBJS += x2ap_decoder.o
OBJS += x2ap_encoder.o
OBJS += x2ap_common.o
#X2AP_SERVER_SRC = sctp_primitives_server.c
#X2AP_SERVER_SRC += x2ap_server_main.c
#X2AP_SERVER_OBJS = $(X2AP_SERVER_SRC:.c=.o)
X2AP_CLIENT_SRC = sctp_primitives_client.c
X2AP_CLIENT_SRC += x2ap_client_main.c
X2AP_CLIENT_OBJS = $(X2AP_CLIENT_SRC:.c=.o)
libx2ap_messages.a:$(OBJS)
$(AR) rcsv libx2ap_messages.a $(OBJS)
asn1fromtool:
asn1c -gen-PER -fnative-types -fskeletons-copy X2AP-CommonDataTypes.asn X2AP-Constants.asn X2AP-IEs.asn \
X2AP-PDU.asn
asn1fromscript:
python ../asn1tostruct.py -f X2AP-PDU-Contents.asn -d
all: server x2ap_client_main
server: server.o libx2ap_messages.a generating_messages.o sctp_primitives_client.o x2ap_pdu_decoder.o
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o $@ $^ -lsctp -lpthread libx2ap_messages.a
$(OBJS): %.o : %.c
$(CC) $(CFLAGS) -I. -o $@ -c $<
$(X2AP_SERVER_OBJS): %.o : %.c
$(CC) -c $(CFLAGS) -I. $< -o $@
$(X2AP_CLIENT_OBJS): %.o : %.c
$(CC) -c $(CFLAGS) $< -o $@
x2ap_server_main.o: x2ap_server_main.c
$(CC) $(CFLAGS) -I. $^ -o $@ -lsctp \
-lpthread
x2ap_client_main: $(X2AP_CLIENT_OBJS)
$(CC) $(CFLAGS) $^ -o $@ -lsctp \
-lpthread
server.o: server.c
$(CC) $(CFLAGS) -I. $^ -o $@ -lsctp \
-lpthread
x2ap_pdu_decoder.o: x2ap_pdu_decoder.c
$(CC) $(CFLAGS) -I. -o $@ -c $<
x2ap_pdu_encoder.o: x2ap_pdu_encoder.c
$(CC) $(CFLAGS) -I. -o $@ -c $<
sctp_primitives_server.o: sctp_primitives_server.c
$(CC) $(CFLAGS) -o $@ -c $<
generating_messages.o: generating_messages.c
$(CC) $(CFLAGS) -I. -o $@ -c $<
clean:
rm -f $(OBJS)
This diff is collapsed.
-- **************************************************************
--
-- Common definitions
--
-- **************************************************************
X2AP-CommonDataTypes {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
eps-Access (21) modules (3) x2ap (2) version1 (1) x2ap-CommonDataTypes (3) }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- **************************************************************
--
-- Extension constants
--
-- **************************************************************
maxPrivateIEs INTEGER ::= 65535
maxProtocolExtensions INTEGER ::= 65535
maxProtocolIEs INTEGER ::= 65535
-- **************************************************************
--
-- Common Data Types
--
-- **************************************************************
Criticality ::= ENUMERATED { reject, ignore, notify }
Presence ::= ENUMERATED { optional, conditional, mandatory }
PrivateIE-ID ::= CHOICE {
local INTEGER (0.. maxPrivateIEs),
global OBJECT IDENTIFIER
}
ProcedureCode ::= INTEGER {
id-handoverPreparation (0),
id-handoverCancel (1),
id-loadIndication (2),
id-errorIndication (3),
id-snStatusTransfer (4),
id-uEContextRelease (5),
id-x2Setup (6),
id-reset (7),
id-eNBConfigurationUpdate (8),
id-resourceStatusReportingInitiation (9),
id-resourceStatusReporting (10),
id-privateMessage (11),
id-mobilitySettingsChange (12),
id-rLFIndication (13),
id-handoverReport (14),
id-cellActivation (15)
} (0..255)
ProtocolIE-ID ::= INTEGER {
id-E-RABs-Admitted-Item (0),
id-E-RABs-Admitted-List (1),
id-E-RAB-Item (2),
id-E-RABs-NotAdmitted-List (3),
id-E-RABs-ToBeSetup-Item (4),
id-Cause (5),
id-CellInformation (6),
id-CellInformation-Item (7),
id-New-eNB-UE-X2AP-ID (9),
id-Old-eNB-UE-X2AP-ID (10),
id-TargetCell-ID (11),
id-TargeteNBtoSource-eNBTransparentContainer (12),
id-TraceActivation (13),
id-UE-ContextInformation (14),
id-UE-HistoryInformation (15),
id-UE-X2AP-ID (16),
id-CriticalityDiagnostics (17),
id-E-RABs-SubjectToStatusTransfer-List (18),
id-E-RABs-SubjectToStatusTransfer-Item (19),
id-ServedCells (20),
id-GlobalENB-ID (21),
id-TimeToWait (22),
id-GUMMEI-ID (23),
id-GUGroupIDList (24),
id-ServedCellsToAdd (25),
id-ServedCellsToModify (26),
id-ServedCellsToDelete (27),
id-Registration-Request (28),
id-CellToReport (29),
id-ReportingPeriodicity (30),
id-CellToReport-Item (31),
id-CellMeasurementResult (32),
id-CellMeasurementResult-Item (33),
id-GUGroupIDToAddList (34),
id-GUGroupIDToDeleteList (35),
id-SRVCCOperationPossible (36),
id-Measurement-ID (37),
id-ReportCharacteristics (38),
id-ENB1-Measurement-ID (39),
id-ENB2-Measurement-ID (40),
id-Number-of-Antennaports (41),
id-CompositeAvailableCapacityGroup (42),
id-ENB1-Cell-ID (43),
id-ENB2-Cell-ID (44),
id-ENB2-Proposed-Mobility-Parameters (45),
id-ENB1-Mobility-Parameters (46),
id-ENB2-Mobility-Parameters-Modification-Range (47),
id-FailureCellPCI (48),
id-Re-establishmentCellECGI (49),
id-FailureCellCRNTI (50),
id-ShortMAC-I (51),
id-SourceCellECGI (52),
id-FailureCellECGI (53),
id-HandoverReportType (54),
id-PRACH-Configuration (55),
id-MBSFN-Subframe-Info (56),
id-ServedCellsToActivate (57),
id-ActivatedCellList (58),
id-DeactivationIndication (59),
id-UE-RLF-Report-Container (60)
} (0..maxProtocolIEs)
TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessful-outcome}
END
\ No newline at end of file
-- **************************************************************
--
-- Constant definitions
--
-- **************************************************************
X2AP-Constants {
itu-t (0) identified-organization (4) etsi (0) mobileDomain (0)
eps-Access (21) modules (3) x2ap (2) version1 (1) x2ap-Constants (4) }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
IMPORTS
ProcedureCode,
ProtocolIE-ID
FROM X2AP-CommonDataTypes;
-- **************************************************************
--
-- Elementary Procedures
--
-- **************************************************************
id-handoverPreparation ProcedureCode ::= 0
id-handoverCancel ProcedureCode ::= 1