Skip to content

Commit f423459

Browse files
authored
First iteration for the library (#4)
* Refactor transport types and add string conversion functions for E3LinkLayer and E3TransportLayer * Refactor transport configuration to use link and transport layers in E3Config and related components * Add CMake configuration and implementation for libe3 library - Introduced CMake files for compiler settings, dependencies, examples, installation, options, sources, targets, and tests. - Implemented ASN.1 encoding and decoding in the new asn1_encoder module. - Updated the E3Config structure to default to ASN.1 encoding format. - Added ZeroMQ connector support and conditional compilation based on user options. - Created unit tests for various components including types, subscription manager, and response queue. - Integrated FetchContent for managing external dependencies like nlohmann/json and tl::expected. - Established a structured approach for building examples and tests, ensuring modularity and ease of use. * Add fatal errors option to build script and update error codes in ASN.1 encoder * add versioning * Add EMPTY PDU type and update message ID generation logic * Update version information to be generated from VERSION file * Update README.md to enhance versioning information and clarify encoding support * Refactor README.md and libe3.hpp to improve clarity and remove unused includes * Remove EMPTY PDU type and set default PDU type to SETUP_REQUEST * remove simulation mode * Refactor SubscriptionManager to automatically assign unique dApp IDs and update related methods for improved registration handling * Enhance Setup Request handling by updating structure and encoding methods to include dApp details and protocol version * Enhance Setup Response handling by adding optional fields for protocol version, dApp identifier, and RAN function list in encoder and ASN.1 definitions * Enhance Subscription Request handling by adding optional fields for telemetry identifiers, control identifiers, subscription time, and periodicity in encoder and ASN.1 definitions * feat: Add ReleaseMessage support in ASN.1 and JSON encoders - Updated ASN.1 encoder to handle ReleaseMessage PDU type. - Enhanced JSON encoder to encode and decode ReleaseMessage. - Modified existing tests to validate new ReleaseMessage functionality. - Refactored error handling in response queue tests for clarity. - Improved consistency in assertion style across tests. * refactor: Remove simulation mode example and clean up related tests * Refactor: Remove [[nodiscard]] from methods in various headers - Removed [[nodiscard]] attribute from methods in logger.hpp, response_queue.hpp, sm_interface.hpp, subscription_manager.hpp, and types.hpp. - Updated method signatures in posix_connector.cpp and zmq_connector.cpp to ensure proper type casting. - Adjusted method implementations in asn1_encoder.cpp and json_encoder.hpp to remove [[nodiscard]]. - Added telemetry_ids() and control_ids() methods to the test E3Agent class for improved testing capabilities. * refactor: Update various methods for improved type handling and clarity * refactor: Update PDU type tests for consistency and remove redundant checks * feat: Enhance simple_agent with command-line options for configuration * refactor: Update simple_agent usage instructions and set default link/encoding formats feat: Add receive timeout for graceful shutdown in ZmqE3Connector * feat: Enhance Subscription Management and ASN.1 Encoding - Added subscription ID management in SubscriptionManager, allowing for unique identification of subscriptions. - Implemented `remove_subscription_by_id` method to facilitate subscription removal using subscription IDs. - Updated `add_subscription` and `remove_subscription` methods to handle subscription ID mappings. - Introduced ASN.1 encoding and decoding for SubscriptionDelete and DAppControlAction types. - Modified JSON encoder to support new SubscriptionDelete and DAppControlAction structures. - Updated tests to cover new functionality, including subscription deletion and DApp control actions. - Adjusted existing tests to reflect changes in subscription management and encoding logic. * refactor: Simplify RAN function handling and improve control action registration in Service Models * feat: Implement shutdown functionality for POSIX and ZMQ connectors, enhancing graceful termination * feat: Introduce TestServiceModel and enhance logging capabilities; remove unused custom service model example * refactor: Rename TestServiceModel to SimpleServiceModel and streamline control action handling * feat: Enhance message ID handling and update related encoding functions across the E3 protocol * Refactor E3 and JSON encoders to remove message ID fields - Removed `id` fields from `SetupRequest`, `SetupResponse`, `SubscriptionRequest`, `SubscriptionDelete`, `SubscriptionResponse`, `IndicationMessage`, `DAppControlAction`, `DAppReport`, `XAppControlAction`, and `MessageAck` structures in both E3 and JSON encoders. - Updated encoding and decoding functions to no longer handle `id` fields, instead using `message_id` in the PDU structure. - Adjusted unit tests to reflect the removal of `id` fields, ensuring that the tests remain valid and functional. * feat: Add Simple Service Model with ASN.1 definitions and encoding/decoding wrappers * FIX DELIVERY OF RAN FUNCTION feat: Enable debug logging in simple_agent and enhance logging in E3Interface setup handling * Add release message to allow graceful disconnection * feat: Add support for building documentation with Doxygen * fix: Update ran_function_data documentation for clarity on optional payload * fix: Update LICENSE and README for clarity and documentation improvements * feat: Add GitHub Actions workflows for mirroring and tagging releases, including .deb package creation * fix: Correct repository name in GitHub Actions workflows for mirroring and tagging * feat: Update maintainer information and enhance README with acknowledgments * fix: Update installation instructions and dependencies in README and build script * fix: Update copyright notice in LICENSE and enhance build script header with version and authorship details * fix: Update README and build script to include SCTP development dependencies * fix: Correct DESTDIR usage in create_deb.sh for cmake install command * feat: Add C API implementation for libe3 with service model and agent management * fix: Update package output paths in create_deb.sh and tag-and-release.yml * feat: Enhance Debian packaging workflow for multiple architectures (amd64 and arm64) * fix: Update branch name in workflow trigger from main to first-it * fix: Prevent double execution of build process when installing dependencies * feat: Add ports to E3Config structure for setup, subscriber, and publisher * feat: Introduce e3_config_t structure for E3Agent configuration with customizable ports and endpoints * feat: Implement dApp report handling and related functions in E3Agent and E3Interface * feat: Add SimpleConfigControl encoding/decoding and integrate xApp control actions in simple_agent * fix: Update ranFunctionIdentifier constraints to ensure valid range in ASN.1 definitions * Correct packaging * fix: Update Cflags in libe3.pc.in to allow <libe3/*.h> * feat: Enhance e3_service_model_handle to support ran_function_data storage and retrieval * feat: Refactor error code handling and add unit tests for error code mappings * feat: Add new error codes and update error code tests for consistency * feat: Add support for dApp report handling and packaging options in build script * feat: Implement control action handling and indication emission in service model * set the setup thread as the first to start * feat: Update ASN.1 definitions for telemetry and control identifier lists to include size constraints * Add optional JSON encoding support and mutual exclusion with ASN.1 (#5) * feat: Add optional JSON encoding support and mutual exclusion with ASN.1 * feat: Add JSON encoding option and update tests for encoding selection * feat: Add GitHub Actions workflow for unit testing and update encoding format conditionals * fix: Update workflow trigger branch from 'first-it' to 'main'
1 parent e4d974b commit f423459

71 files changed

Lines changed: 6306 additions & 2194 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/mirror.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Mirror to Public Repository
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
mirror:
10+
runs-on: ubuntu-latest
11+
if: github.repository != 'wineslab/dApp-libe3'
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: '0'
18+
19+
- name: Set up SSH Key
20+
run: |
21+
mkdir -p ~/.ssh
22+
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519
23+
chmod 600 ~/.ssh/id_ed25519
24+
ssh-keyscan github.com >> ~/.ssh/known_hosts
25+
env:
26+
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
27+
28+
- name: Push to Public Repository
29+
run: |
30+
echo "Pushing to public repository..."
31+
git remote add public git@github.com:wineslab/dApp-lie3.git
32+
git push public main:main --force

.github/workflows/pr-tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
name: Build and Test
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
build_type: [Debug, Release]
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Install build dependencies
21+
run: |
22+
sudo apt-get update
23+
chmod +x ./build_libe3 || true
24+
./build_libe3 -I || true
25+
26+
- name: Build and test with build_libe3 (${ { matrix.build_type } })
27+
shell: bash
28+
run: |
29+
chmod +x ./build_libe3 || true
30+
if [ "${{ matrix.build_type }}" = "Debug" ]; then
31+
BUILD_FLAG="-g"
32+
else
33+
BUILD_FLAG="-r"
34+
fi
35+
./build_libe3 -c -d build -j $(nproc) $BUILD_FLAG -t
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: Tag and Publish libe3 package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
create-tag:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
version: ${{ steps.get_version.outputs.version }}
13+
tag_created: ${{ steps.set_output.outputs.tag_created }}
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Read VERSION file
21+
id: get_version
22+
run: |
23+
version=$(cat VERSION | tr -d '[:space:]')
24+
echo "version=$version" >> $GITHUB_OUTPUT
25+
26+
- name: Check if tag exists
27+
id: check_tag
28+
run: |
29+
if git rev-parse "refs/tags/${{ steps.get_version.outputs.version }}" >/dev/null 2>&1; then
30+
echo "exists=true" >> $GITHUB_OUTPUT
31+
else
32+
echo "exists=false" >> $GITHUB_OUTPUT
33+
fi
34+
35+
- name: Create and push tag
36+
if: steps.check_tag.outputs.exists == 'false'
37+
id: create_push_tag
38+
run: |
39+
git tag ${{ steps.get_version.outputs.version }}
40+
git push origin ${{ steps.get_version.outputs.version }}
41+
42+
- name: Set tag_created output
43+
id: set_output
44+
run: |
45+
if [ "${{ steps.check_tag.outputs.exists }}" = "false" ]; then
46+
echo "tag_created=true" >> $GITHUB_OUTPUT
47+
else
48+
echo "tag_created=false" >> $GITHUB_OUTPUT
49+
fi
50+
51+
build-deb-amd64:
52+
name: Build Debian package (amd64)
53+
runs-on: ubuntu-latest
54+
needs: create-tag
55+
if: ${{ needs.create-tag.outputs.tag_created == 'true' && github.repository == 'wineslab/spear-libe3' }}
56+
steps:
57+
- uses: actions/checkout@v4
58+
with:
59+
persist-credentials: false
60+
61+
- name: Install build dependencies via build_libe3
62+
run: |
63+
sudo apt-get update
64+
chmod +x ./build_libe3 || true
65+
./build_libe3 -I
66+
67+
- name: Make packaging script executable
68+
run: |
69+
chmod +x ./scripts/create_deb.sh || true
70+
71+
- name: Run packaging script for amd64
72+
run: |
73+
./scripts/create_deb.sh amd64
74+
75+
- name: Upload amd64 .deb artifact
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: libe3-deb-amd64
79+
path: build/libe3_${{ needs.create-tag.outputs.version }}_amd64.deb
80+
81+
build-deb-arm64:
82+
name: Build Debian package (arm64)
83+
runs-on: ubuntu-24.04-arm
84+
needs: create-tag
85+
if: ${{ needs.create-tag.outputs.tag_created == 'true' && github.repository == 'wineslab/spear-libe3' }}
86+
steps:
87+
- uses: actions/checkout@v4
88+
with:
89+
persist-credentials: false
90+
91+
- name: Install build dependencies via build_libe3
92+
run: |
93+
sudo apt-get update
94+
chmod +x ./build_libe3 || true
95+
./build_libe3 -I
96+
97+
- name: Make packaging script executable
98+
run: |
99+
chmod +x ./scripts/create_deb.sh || true
100+
101+
- name: Run packaging script for arm64
102+
run: |
103+
./scripts/create_deb.sh arm64
104+
105+
- name: Upload arm64 .deb artifact
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: libe3-deb-arm64
109+
path: build/libe3_${{ needs.create-tag.outputs.version }}_arm64.deb
110+
111+
github-release:
112+
name: Upload Debian package to GitHub Release
113+
needs:
114+
- build-deb-amd64
115+
- build-deb-arm64
116+
- create-tag
117+
runs-on: ubuntu-latest
118+
if: ${{ needs.create-tag.outputs.tag_created == 'true' && github.repository == 'wineslab/spear-libe3' }}
119+
permissions:
120+
contents: write
121+
steps:
122+
- name: Download amd64 deb artifact
123+
uses: actions/download-artifact@v4
124+
with:
125+
name: libe3-deb-amd64
126+
path: dist/
127+
128+
- name: Download arm64 deb artifact
129+
uses: actions/download-artifact@v4
130+
with:
131+
name: libe3-deb-arm64
132+
path: dist/
133+
134+
- name: Create GitHub Release and upload .deb
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
run: |
138+
version=${{ needs.create-tag.outputs.version }}
139+
gh release create "$version" --repo ${{ github.repository }} --notes "libe3 release $version" || true
140+
gh release upload "$version" dist/** --repo ${{ github.repository }} || true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ CTestTestfile.cmake
3939
_deps/
4040
*.cmake
4141
!cmake/*.cmake
42+
!messages/**/*.cmake
4243

4344
# IDE and editor files
4445
.idea/

0 commit comments

Comments
 (0)