Merge remote-tracking branch 'origin/kdf_openssl' into integration_2022_wk06
This commit is contained in:
@@ -0,0 +1 @@
|
||||
add_subdirectory(utils)
|
||||
@@ -0,0 +1 @@
|
||||
add_subdirectory(ds)
|
||||
@@ -0,0 +1,5 @@
|
||||
add_library(ds OBJECT
|
||||
byte_array.c
|
||||
)
|
||||
|
||||
target_include_directories(ds PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "byte_array.h"
|
||||
|
||||
#include "common/utils/assertions.h"
|
||||
#include <string.h>
|
||||
|
||||
byte_array_t copy_byte_array(byte_array_t src)
|
||||
{
|
||||
byte_array_t dst = {0};
|
||||
dst.buf = malloc(src.len);
|
||||
DevAssert(dst.buf != NULL && "Memory exhausted");
|
||||
memcpy(dst.buf, src.buf, src.len);
|
||||
dst.len = src.len;
|
||||
return dst;
|
||||
}
|
||||
|
||||
void free_byte_array(byte_array_t ba)
|
||||
{
|
||||
free(ba.buf);
|
||||
}
|
||||
|
||||
bool eq_byte_array(const byte_array_t* m0, const byte_array_t* m1)
|
||||
{
|
||||
if (m0 == m1)
|
||||
return true;
|
||||
|
||||
if (m0 == NULL || m1 == NULL)
|
||||
return false;
|
||||
|
||||
if (m0->len != m1->len)
|
||||
return false;
|
||||
|
||||
const int rc = memcmp(m0->buf, m1->buf, m0->len);
|
||||
if (rc != 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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 BYTE_ARRAY_H_OAI
|
||||
#define BYTE_ARRAY_H_OAI
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef struct {
|
||||
size_t len;
|
||||
uint8_t* buf;
|
||||
} byte_array_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t buf[32];
|
||||
} byte_array_32_t;
|
||||
|
||||
byte_array_t copy_byte_array(byte_array_t src);
|
||||
void free_byte_array(byte_array_t ba);
|
||||
bool eq_byte_array(const byte_array_t* m0, const byte_array_t* m1);
|
||||
|
||||
#endif
|
||||
@@ -15,9 +15,6 @@ OPENAIR_DIR = /usr/local/oai/oai-develop/openairinterface5g
|
||||
FreeDiameter prefix not found, install freeDiameter if EPC, HSS
|
||||
3. building the compilation directives ...
|
||||
running cmake ../../..
|
||||
NETTLE VERSION_INSTALLED = 3.5.1
|
||||
NETTLE_VERSION_MAJOR = 3
|
||||
NETTLE_VERSION_MINOR = 5
|
||||
cuda include /usr/include
|
||||
cuda library
|
||||
-- CMAKE_BUILD_TYPE is RelWithDebInfo
|
||||
@@ -61,9 +58,6 @@ Call Stack (most recent call first):
|
||||
FreeDiameter prefix not found, install freeDiameter if EPC, HSS
|
||||
3. building the compilation directives ...
|
||||
running cmake ../../..
|
||||
NETTLE VERSION_INSTALLED = 3.5.1
|
||||
NETTLE_VERSION_MAJOR = 3
|
||||
NETTLE_VERSION_MINOR = 5
|
||||
cuda include /usr/include
|
||||
cuda library
|
||||
-- CMAKE_BUILD_TYPE is RelWithDebInfo
|
||||
@@ -209,4 +203,4 @@ The interface should be intuitive enough, keeping in mind the following restrict
|
||||
|
||||
Some front-end objects, which usage are less intuitive provide a tooltip to help interface usage.
|
||||
|
||||
[oai web serverinterface home](websrv.md)
|
||||
[oai web serverinterface home](websrv.md)
|
||||
|
||||
Reference in New Issue
Block a user