Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-RAN
Commits
2a1f5ac5
Commit
2a1f5ac5
authored
Oct 28, 2024
by
Guido Casati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce library for E1AP message encoding/decoding
parent
ac8da484
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
221 additions
and
3 deletions
+221
-3
openair2/COMMON/e1ap_messages_types.h
openair2/COMMON/e1ap_messages_types.h
+2
-2
openair2/COMMON/ngap_messages_types.h
openair2/COMMON/ngap_messages_types.h
+1
-0
openair2/E1AP/CMakeLists.txt
openair2/E1AP/CMakeLists.txt
+6
-1
openair2/E1AP/lib/CMakeLists.txt
openair2/E1AP/lib/CMakeLists.txt
+9
-0
openair2/E1AP/lib/e1ap_bearer_context_management.c
openair2/E1AP/lib/e1ap_bearer_context_management.c
+39
-0
openair2/E1AP/lib/e1ap_bearer_context_management.h
openair2/E1AP/lib/e1ap_bearer_context_management.h
+29
-0
openair2/E1AP/lib/e1ap_lib_common.h
openair2/E1AP/lib/e1ap_lib_common.h
+69
-0
openair2/E1AP/lib/e1ap_lib_includes.h
openair2/E1AP/lib/e1ap_lib_includes.h
+25
-0
openair2/E1AP/tests/CMakeLists.txt
openair2/E1AP/tests/CMakeLists.txt
+6
-0
openair2/E1AP/tests/e1ap_lib_test.c
openair2/E1AP/tests/e1ap_lib_test.c
+35
-0
No files found.
openair2/COMMON/e1ap_messages_types.h
View file @
2a1f5ac5
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
#include <netinet/in.h>
#include <netinet/in.h>
#include <netinet/sctp.h>
#include <netinet/sctp.h>
#include "common/ngran_types.h"
#include "common/ngran_types.h"
#include "
f1ap_messages
_types.h"
#include "
common/platform
_types.h"
#include "
ngap_messages
_types.h"
#include "
common/5g_platform
_types.h"
/* Definitions according to 3GPP TS 38.463 */
/* Definitions according to 3GPP TS 38.463 */
#define E1AP_MAX_NUM_TRANSAC_IDS 4
#define E1AP_MAX_NUM_TRANSAC_IDS 4
...
...
openair2/COMMON/ngap_messages_types.h
View file @
2a1f5ac5
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#ifndef NGAP_MESSAGES_TYPES_H_
#ifndef NGAP_MESSAGES_TYPES_H_
#define NGAP_MESSAGES_TYPES_H_
#define NGAP_MESSAGES_TYPES_H_
#include "common/5g_platform_types.h"
#include "common/platform_constants.h"
#include "common/platform_constants.h"
#include "common/platform_types.h"
#include "common/platform_types.h"
#include "common/5g_platform_types.h"
#include "common/5g_platform_types.h"
...
...
openair2/E1AP/CMakeLists.txt
View file @
2a1f5ac5
add_subdirectory
(
MESSAGES
)
add_subdirectory
(
MESSAGES
)
add_subdirectory
(
lib
)
add_library
(
e1ap e1ap.c e1ap_common.c
)
add_library
(
e1ap e1ap.c e1ap_common.c
)
target_link_libraries
(
e1ap
target_link_libraries
(
e1ap
PUBLIC asn1_e1ap
f1ap
PUBLIC asn1_e1ap
e1ap_lib
PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap UTIL e1_if
)
PRIVATE asn1_nr_rrc_hdrs asn1_lte_rrc_hdrs asn1_f1ap UTIL e1_if
)
target_include_directories
(
e1ap PUBLIC
${
CMAKE_CURRENT_DIR
}
)
target_include_directories
(
e1ap PUBLIC
${
CMAKE_CURRENT_DIR
}
)
if
(
ENABLE_TESTS
)
add_subdirectory
(
tests
)
endif
()
openair2/E1AP/lib/CMakeLists.txt
0 → 100644
View file @
2a1f5ac5
add_library
(
e1ap_lib OBJECT
e1ap_bearer_context_management.c
)
target_link_libraries
(
e1ap_lib PRIVATE asn1_e1ap
)
target_include_directories
(
e1ap_lib PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
)
openair2/E1AP/lib/e1ap_bearer_context_management.c
0 → 100644
View file @
2a1f5ac5
/*
* 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
*/
/*! \file e1ap_bearer_context_management.c
* \brief E1AP library for E1 Bearer Context Management
* \author Guido Casati
* \date 2024
* \version 0.1
*/
#include <string.h>
#include "common/utils/assertions.h"
#include "openair3/UTILS/conversions.h"
#include "common/utils/oai_asn1.h"
#include "common/utils/utils.h"
#include "e1ap_lib_common.h"
#include "e1ap_bearer_context_management.h"
#include "e1ap_lib_includes.h"
openair2/E1AP/lib/e1ap_bearer_context_management.h
0 → 100644
View file @
2a1f5ac5
/*
* 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
*/
#ifndef E1AP_BEARER_CONTEXT_MANAGEMENT_H_
#define E1AP_BEARER_CONTEXT_MANAGEMENT_H_
#include <stdbool.h>
#include "openair2/COMMON/e1ap_messages_types.h"
#include "common/platform_types.h"
#endif
/* E1AP_BEARER_CONTEXT_MANAGEMENT_H_ */
openair2/E1AP/lib/e1ap_lib_common.h
0 → 100644
View file @
2a1f5ac5
/*
* 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
*/
#ifndef E1AP_LIB_COMMON_H_
#define E1AP_LIB_COMMON_H_
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "openair3/UTILS/conversions.h"
#ifdef ENABLE_TESTS
#define PRINT_ERROR(...) fprintf(stderr, ##__VA_ARGS__);
#else
#define PRINT_ERROR(...) // Do nothing
#endif
#define _E1_EQ_CHECK_GENERIC(condition, fmt, ...) \
do { \
if (!(condition)) { \
PRINT_ERROR("E1 Equality Check failure: %s:%d: Condition '%s' failed: " fmt " != " fmt "\n", \
__FILE__, \
__LINE__, \
#condition, \
##__VA_ARGS__); \
return false; \
} \
} while (0)
#define _E1_EQ_CHECK_LONG(A, B) _E1_EQ_CHECK_GENERIC(A == B, "%ld", A, B);
#define _E1_EQ_CHECK_INT(A, B) _E1_EQ_CHECK_GENERIC(A == B, "%d", A, B);
#define _E1_EQ_CHECK_STR(A, B) _E1_EQ_CHECK_GENERIC(strcmp(A, B) == 0, "'%s'", A, B);
// 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)
#endif
/* E1AP_LIB_COMMON_H_ */
openair2/E1AP/lib/e1ap_lib_includes.h
0 → 100644
View file @
2a1f5ac5
/*
* 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
*/
#ifndef E1AP_LIB_INCLUDES_H_
#define E1AP_LIB_INCLUDES_H_
#endif
/* E1AP_LIB_INCLUDES_H_ */
openair2/E1AP/tests/CMakeLists.txt
0 → 100644
View file @
2a1f5ac5
add_executable
(
e1ap_lib_test e1ap_lib_test.c
)
add_dependencies
(
tests e1ap_lib_test
)
add_test
(
NAME e1ap_lib_test COMMAND e1ap_lib_test
)
target_link_libraries
(
e1ap_lib_test PRIVATE e1ap_lib
)
target_link_libraries
(
e1ap_lib_test PRIVATE asn1_f1ap
)
target_include_directories
(
e1ap_lib_test PRIVATE ../../../
)
openair2/E1AP/tests/e1ap_lib_test.c
0 → 100644
View file @
2a1f5ac5
/*
* 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
*/
/*! \file e1ap_lib_test.c
* \brief Unit tests for E1AP libraries
* \author Guido Casati
* \date 2024
* \version 0.1
*/
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include "common/utils/assertions.h"
#include "e1ap.h"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment