Files
openairinterface5g/openair2/E1AP/lib/e1ap_lib_common.h
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

54 lines
3.0 KiB
C

/*
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
*/
#ifndef E1AP_LIB_COMMON_H_
#define E1AP_LIB_COMMON_H_
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "openair3/UTILS/conversions.h"
#include "e1ap_messages_types.h"
#include "common/utils/eq_check.h"
#define CHECK_E1AP_DEC(exp) \
do { \
if (!(exp)) { \
PRINT_ERROR("Failed executing " #exp " in %s() line %d\n", __func__, __LINE__); \
return false; \
} \
} while (0)
// Macro to look up IE. If mandatory and not found, macro will log an error and return false.
#define E1AP_LIB_FIND_IE(IE_TYPE, ie, container, IE_ID, mandatory) \
do { \
ie = NULL; \
for (int i = 0; i < (container)->protocolIEs.list.count; ++i) { \
IE_TYPE *current_ie = (container)->protocolIEs.list.array[i]; \
if (current_ie->id == (IE_ID)) { \
ie = current_ie; \
break; \
} \
} \
if (mandatory && ie == NULL) { \
fprintf(stderr, "%s(): Mandatory element not found: ID" #IE_ID " with type " #IE_TYPE "\n", __func__); \
return false; \
} \
} while (0)
/* deep copy of optional E1AP IE */
#define _E1_CP_OPTIONAL_IE(dest, src, field) \
do { \
if ((src)->field) { \
(dest)->field = malloc_or_fail(sizeof(*(dest)->field)); \
*(dest)->field = *(src)->field; \
} \
} while (0)
struct E1AP_Cause;
struct E1AP_Cause e1_encode_cause_ie(const e1ap_cause_t *cause);
e1ap_cause_t e1_decode_cause_ie(const struct E1AP_Cause *ie);
#endif /* E1AP_LIB_COMMON_H_ */