move F1AP_get_next_transaction_identifier() to f1ap_common.c
This commit is contained in:
@@ -546,6 +546,7 @@ add_library(F1AP
|
||||
${F1AP_DIR}/f1ap_encoder.c
|
||||
${F1AP_DIR}/f1ap_decoder.c
|
||||
${F1AP_DIR}/f1ap_handlers.c
|
||||
${F1AP_DIR}/f1ap_common.c
|
||||
${F1AP_DIR}/sctp_du.c
|
||||
${F1AP_DIR}/sctp_cu.c
|
||||
)
|
||||
|
||||
@@ -80,17 +80,6 @@ typedef struct f1ap_info {
|
||||
|
||||
} f1ap_info_t;
|
||||
|
||||
// helper functions
|
||||
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
|
||||
#define NUMBER_OF_eNB_MAX 3
|
||||
|
||||
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP) {
|
||||
static uint8_t transaction_identifier[NUMBER_OF_eNB_MAX];
|
||||
transaction_identifier[enb_mod_idP+cu_mod_idP] = (transaction_identifier[enb_mod_idP+cu_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
|
||||
//LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+cu_mod_idP]);
|
||||
return transaction_identifier[enb_mod_idP+cu_mod_idP];
|
||||
}
|
||||
|
||||
// ==============================================================================
|
||||
static
|
||||
void CU_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind) {
|
||||
|
||||
@@ -42,14 +42,6 @@
|
||||
|
||||
#include "T.h"
|
||||
|
||||
// helper functions
|
||||
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
|
||||
#define F1AP_UE_IDENTIFIER_NUMBER 3
|
||||
#define NUMBER_OF_eNB_MAX 3
|
||||
|
||||
// #include "common/ran_context.h"
|
||||
// extern RAN_CONTEXT_t RC;
|
||||
|
||||
/* This structure describes association of a DU to a CU */
|
||||
typedef struct f1ap_info {
|
||||
|
||||
@@ -86,13 +78,6 @@ typedef struct f1ap_info {
|
||||
void DU_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
|
||||
|
||||
|
||||
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t du_mod_idP) {
|
||||
static uint8_t transaction_identifier[NUMBER_OF_eNB_MAX];
|
||||
transaction_identifier[enb_mod_idP+du_mod_idP] = (transaction_identifier[enb_mod_idP+du_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
|
||||
//LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+du_mod_idP]);
|
||||
return transaction_identifier[enb_mod_idP+du_mod_idP];
|
||||
}
|
||||
|
||||
uint8_t F1AP_get_UE_identifier(module_id_t enb_mod_idP, int CC_idP, int UE_id) {
|
||||
static uint8_t UE_identifier[NUMBER_OF_eNB_MAX];
|
||||
UE_identifier[enb_mod_idP+CC_idP+UE_id] = (UE_identifier[enb_mod_idP+CC_idP+UE_id] + 1) % F1AP_UE_IDENTIFIER_NUMBER;
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
#include "f1ap_common.h"
|
||||
//#include "S1AP-PDU.h"
|
||||
|
||||
#if defined(EMIT_ASN_DEBUG_EXTERN)
|
||||
int asn_debug = 0;
|
||||
int asn1_xer_print = 0;
|
||||
|
||||
#if defined(EMIT_ASN_DEBUG_EXTERN)
|
||||
inline void ASN_DEBUG(const char *fmt, ...)
|
||||
{
|
||||
if (asn_debug) {
|
||||
@@ -56,6 +56,7 @@ inline void ASN_DEBUG(const char *fmt, ...)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
ssize_t f1ap_generate_initiating_message(
|
||||
uint8_t **buffer,
|
||||
uint32_t *length,
|
||||
@@ -76,9 +77,10 @@ ssize_t f1ap_generate_initiating_message(
|
||||
|
||||
if (asn1_xer_print) {
|
||||
xer_fprint(stdout, &asn_DEF_S1AP_PDU, (void *)&pdu);
|
||||
}
|
||||
}*/
|
||||
|
||||
/* We can safely free list of IE from sptr */
|
||||
/*
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr);
|
||||
|
||||
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &pdu,
|
||||
@@ -110,9 +112,10 @@ ssize_t f1ap_generate_successfull_outcome(
|
||||
|
||||
if (asn1_xer_print) {
|
||||
xer_fprint(stdout, &asn_DEF_S1AP_PDU, (void *)&pdu);
|
||||
}
|
||||
}*/
|
||||
|
||||
/* We can safely free list of IE from sptr */
|
||||
/*
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr);
|
||||
|
||||
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &pdu,
|
||||
@@ -146,8 +149,9 @@ ssize_t f1ap_generate_unsuccessfull_outcome(
|
||||
if (asn1_xer_print) {
|
||||
xer_fprint(stdout, &asn_DEF_S1AP_PDU, (void *)&pdu);
|
||||
}
|
||||
|
||||
*/
|
||||
/* We can safely free list of IE from sptr */
|
||||
/*
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, sptr);
|
||||
|
||||
if ((encoded = aper_encode_to_new_buffer(&asn_DEF_S1AP_PDU, 0, &pdu,
|
||||
@@ -197,3 +201,13 @@ void f1ap_handle_criticality(F1ap_Criticality_t criticality)
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP)
|
||||
{
|
||||
static uint8_t transaction_identifier[NUMBER_OF_eNB_MAX];
|
||||
transaction_identifier[enb_mod_idP+cu_mod_idP] =
|
||||
(transaction_identifier[enb_mod_idP+cu_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
|
||||
//LOG_T(F1AP,"generated xid is %d\n",transaction_identifier[enb_mod_idP+cu_mod_idP]);
|
||||
return transaction_identifier[enb_mod_idP+cu_mod_idP];
|
||||
}
|
||||
|
||||
@@ -37,9 +37,10 @@
|
||||
#ifndef F1AP_COMMON_H_
|
||||
#define F1AP_COMMON_H_
|
||||
|
||||
/* Defined in asn_internal.h */
|
||||
// extern int asn_debug_indent;
|
||||
extern int asn_debug;
|
||||
#include "openairinterface5g_limits.h"
|
||||
|
||||
#define F1AP_UE_IDENTIFIER_NUMBER 3
|
||||
#define F1AP_TRANSACTION_IDENTIFIER_NUMBER 3
|
||||
|
||||
#if defined(EMIT_ASN_DEBUG_EXTERN)
|
||||
inline void ASN_DEBUG(const char *fmt, ...);
|
||||
@@ -369,9 +370,6 @@ inline void ASN_DEBUG(const char *fmt, ...);
|
||||
|
||||
#define F1AP_UE_ID_FMT "0x%06"PRIX32
|
||||
|
||||
extern int asn_debug;
|
||||
extern int asn1_xer_print;
|
||||
|
||||
#include "assertions.h"
|
||||
|
||||
#if defined(ENB_MODE)
|
||||
@@ -402,4 +400,7 @@ typedef int (*f1ap_message_decoded_callback)(
|
||||
F1AP_F1AP_PDU_t *message_p
|
||||
);
|
||||
|
||||
|
||||
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t cu_mod_idP);
|
||||
|
||||
#endif /* F1AP_COMMON_H_ */
|
||||
|
||||
Reference in New Issue
Block a user