mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
- 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.
83 lines
1.8 KiB
C
83 lines
1.8 KiB
C
/*
|
|
* SPDX-License-Identifier: LicenseRef-CSSL-1.0
|
|
*/
|
|
|
|
|
|
/*
|
|
* Helper methods for PDCP test code
|
|
*/
|
|
|
|
#ifndef TEST_UTIL_H
|
|
#define TEST_UTIL_H
|
|
|
|
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
|
|
|
|
/*
|
|
* Prints binary representation of given octet prepending
|
|
* passed log message
|
|
*
|
|
* @param Octet as an unsigned character
|
|
* @return None
|
|
*/
|
|
void print_binary_representation(unsigned char* message, unsigned char byte)
|
|
{
|
|
unsigned char index = 0;
|
|
unsigned char mask = 0x80;
|
|
|
|
if (message != NULL)
|
|
printf("%s", message);
|
|
|
|
for (index = 0; index < 8; ++index) {
|
|
if (byte & mask) printf("1");
|
|
else printf("0");
|
|
|
|
mask /= 2;
|
|
}
|
|
|
|
printf("\n");
|
|
}
|
|
|
|
/*
|
|
* Prints octets of a byte array in hexadecimal representation
|
|
*/
|
|
void print_byte_stream(char* message, unsigned char* buffer, unsigned long size)
|
|
{
|
|
if (buffer == NULL)
|
|
return;
|
|
|
|
unsigned long index = 0lu;
|
|
|
|
printf("%s", message);
|
|
|
|
for (index = 0; index < size; ++index) {
|
|
msg("%x ", buffer[index]);
|
|
}
|
|
|
|
msg("\n");
|
|
}
|
|
|
|
/*
|
|
* Prints PDCP properties
|
|
*
|
|
* @param pdcp_t pointer for relevant PDCP entity
|
|
* @return none
|
|
*/
|
|
void print_pdcp_properties(pdcp_t* pdcp_entity)
|
|
{
|
|
printf("PDCP properties:\n");
|
|
|
|
if (pdcp_entity == NULL) {
|
|
printf("PDCP pointer is invalid!\n");
|
|
} else {
|
|
printf("-> Is header compression active? %s\n", ((pdcp_entity->header_compression_active == TRUE) ? "Yes" : "No"));
|
|
printf("-> Sequence number size: %d bits\n", pdcp_entity->seq_num_size);
|
|
printf("-> Next TX sequence number: %d\n", pdcp_entity->next_pdcp_tx_sn);
|
|
printf("-> Next RX sequence number: %d\n", pdcp_entity->next_pdcp_rx_sn);
|
|
printf("-> TX HFN: %d\n", pdcp_entity->tx_hfn);
|
|
printf("-> RX HFN: %d\n", pdcp_entity->rx_hfn);
|
|
printf("-> Last submitted RX sequence number: %d\n", pdcp_entity->last_submitted_pdcp_rx_sn);
|
|
}
|
|
}
|
|
|
|
#endif
|