Files
Robert Schmidt 8107939f08 Change OAI license to CSSL v1.0 (and others)
- all RAN code, CI code, configuration files, dockerfiles, in CSSL v1.0
- all deployment code (openshift, charts, ancillary files like shell
  scripts), in MIT
- documentation in CC-BY-4.0
- exceptions might apply and are listed in NOTICE
- there is a new LICENSES folder with all licenses
- CONTRIBUTIONS.md has been updated accordingly

For automated changes based on OAI PL v1.1:

    perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.{c,h,cpp}
    perl -i~ -0pe 's/\/\*.*Licensed to the OpenAirInterface.*openairinterface.org\n#?/\/*\n * SPDX-License-Identifier: LicenseRef-CSSL-1.0\n/s' **/*.ts
    perl -i~ -0pe 's/<!--.*Licensed to the OpenAirInterface.*openairinterface.org\n.*-->/<!-- SPDX-License-Identifier: LicenseRef-CSSL-1.0 -->/s' **/*.xml

The rest (cmake, files with missing license, cmake) manually.
2026-03-27 16:36:37 +01:00

64 lines
2.0 KiB
C

/*
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
*/
#ifndef M2AP_IDS_H_
#define M2AP_IDS_H_
#include <stdint.h>
/* maximum number of simultaneous handovers, do not set too high */
#define M2AP_MAX_IDS 16
/*
* state:
* - when starting handover in source, UE is in state M2ID_STATE_SOURCE_PREPARE
* - after receiving HO_ack in source, UE is in state M2ID_STATE_SOURCE_OVERALL
* - in target, UE is in state X2ID_STATE_TARGET
* The state is used to check timers.
*/
typedef enum {
M2ID_STATE_SOURCE_PREPARE,
M2ID_STATE_SOURCE_OVERALL,
M2ID_STATE_TARGET
} m2id_state_t;
typedef struct {
int rnti; /* -1 when free */
int id_source;
int id_target;
/* the target eNB. Real type is m2ap_eNB_data_t * */
void *target;
/* state: needed to check timers */
m2id_state_t state;
/* timers */
uint64_t t_reloc_prep_start;
uint64_t tm2_reloc_overall_start;
} m2ap_id;
typedef struct {
m2ap_id ids[M2AP_MAX_IDS];
} m2ap_id_manager;
void m2ap_id_manager_init(m2ap_id_manager *m);
int m2ap_allocate_new_id(m2ap_id_manager *m);
void m2ap_release_id(m2ap_id_manager *m, int id);
int m2ap_find_id(m2ap_id_manager *, int id_source, int id_target);
int m2ap_find_id_from_id_source(m2ap_id_manager *, int id_source);
int m2ap_find_id_from_rnti(m2ap_id_manager *, int rnti);
void m2ap_set_ids(m2ap_id_manager *m, int ue_id, int rnti, int id_source, int id_target);
void m2ap_id_set_state(m2ap_id_manager *m, int ue_id, m2id_state_t state);
/* real type of target is m2ap_eNB_data_t * */
void m2ap_id_set_target(m2ap_id_manager *m, int ue_id, void *target);
void m2ap_set_reloc_prep_timer(m2ap_id_manager *m, int ue_id, uint64_t time);
void m2ap_set_reloc_overall_timer(m2ap_id_manager *m, int ue_id, uint64_t time);
int m2ap_id_get_id_source(m2ap_id_manager *m, int ue_id);
int m2ap_id_get_id_target(m2ap_id_manager *m, int ue_id);
int m2ap_id_get_rnti(m2ap_id_manager *m, int ue_id);
void *m2ap_id_get_target(m2ap_id_manager *m, int ue_id);
#endif /* M2AP_IDS_H_ */