Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rlc 52221 #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/rlc/rlc_c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

set(SOURCES
rlc_52221.c
wrapper.cpp
)

add_library(srsran_rlc_c STATIC ${SOURCES})

9 changes: 9 additions & 0 deletions lib/rlc/rlc_c/rlc_52221.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "rlc_52221.h"

int sn_in_reassembly_window_c(const int sn, struct rlc_rx_um_entity* entity){

if((entity->st.rx_next_highest - entity->um_window_size)<=sn && (sn < entity->st.rx_next_highest))
return 1;

return 0;
}
20 changes: 20 additions & 0 deletions lib/rlc/rlc_c/rlc_52221.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdint.h>

#ifndef RLC_52221
#define RLC_52221

//potrzebne structy
struct rlc_rx_um_state
{
int rx_next_highest;
};

struct rlc_rx_um_entity
{
struct rlc_rx_um_state st;
const uint32_t um_window_size;
};
//deklaracja funkcji
int sn_in_reassembly_window_c(const int sn, struct rlc_rx_um_entity* entity);
#endif

5 changes: 5 additions & 0 deletions lib/rlc/rlc_c/wrapper.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "wrapper.hpp"

bool sn_in_reassembly_window(const uint32_t sn, struct rlc_rx_um_entity* entity){
return sn_in_reassembly_window_c(sn, entity);
}
10 changes: 10 additions & 0 deletions lib/rlc/rlc_c/wrapper.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef WRAPPER_H
#define WRAPPER_H

extern "C" {
#include "rlc_52221.h"
}

bool sn_in_reassembly_window(const uint32_t sn, struct rlc_rx_um_entity* entity);

#endif