Commit cf259776 authored by Vijay C's avatar Vijay C

Merge branch 'private/bugz121474-SYNC-ACP' into 'VTP_SRB_Queueing_Porting'

Bug #121474: update SIDL and sync ACP

See merge request firecell/rdsubscription/sequansrd!25
parents 225ec717 ef9b7848
...@@ -40,7 +40,10 @@ enum acpMsgLocalId { ...@@ -40,7 +40,10 @@ enum acpMsgLocalId {
ACP_LID_DrbProcessToSS = 0x90040601, ACP_LID_DrbProcessToSS = 0x90040601,
ACP_LID_HandshakeHandleFromSS = 0x90040700, ACP_LID_HandshakeHandleFromSS = 0x90040700,
ACP_LID_HandshakeHandleToSS = 0x90040701, ACP_LID_HandshakeHandleToSS = 0x90040701,
ACP_LID_SysIndProcessToSS = 0x90040800 ACP_LID_SysIndProcessToSS = 0x90040800,
ACP_LID_NrSysSrbProcessFromSS = 0x90040900,
ACP_LID_NrSysSrbProcessToSS = 0x90040901,
}; };
SIDL_END_C_INTERFACE SIDL_END_C_INTERFACE
/*
* Copyright 2022 Sequans Communications.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
#pragma once
#include "SIDL_NASEMU_NR_SYSTEM_PORT.h"
#include "acp.h"
SIDL_BEGIN_C_INTERFACE
int acpNrSysSrbProcessToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct NR_RRC_PDU_IND* ToSS);
int acpNrSysSrbProcessToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct NR_RRC_PDU_IND** ToSS);
void acpNrSysSrbProcessToSSFreeClt(struct NR_RRC_PDU_IND* ToSS);
int acpNrSysSrbProcessFromSSEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct NR_RRC_PDU_REQ* FromSS);
int acpNrSysSrbProcessFromSSDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct NR_RRC_PDU_REQ** FromSS);
void acpNrSysSrbProcessFromSSFreeSrv(struct NR_RRC_PDU_REQ* FromSS);
SIDL_END_C_INTERFACE
...@@ -15,5 +15,6 @@ ...@@ -15,5 +15,6 @@
*/ */
#pragma once #pragma once
#define ACP_VERSION "1.1.35"
#define ACP_VERSION_CKSM "a9a0f226034ae05f898989c8caa88eb3" #define ACP_VERSION "1.1.17"
#define ACP_VERSION_CKSM "6f927c915e07dd2246824a7868a8a4a3"
...@@ -74,7 +74,7 @@ static bool acpPeerHandshaked(struct acpCtx* ctx, int peer) ...@@ -74,7 +74,7 @@ static bool acpPeerHandshaked(struct acpCtx* ctx, int peer)
{ {
for (int i = 0; i < ACP_MAX_PEER_QTY; i++) { for (int i = 0; i < ACP_MAX_PEER_QTY; i++) {
if (ctx->peers[i] == peer) { if (ctx->peers[i] == peer) {
return (ctx->peersHandshaked[i] != 0)?true:false; return (ctx->peersHandshaked[i] != 0) ? true : false;
} }
} }
...@@ -276,8 +276,6 @@ int acpGetMsgLocalId(size_t size, const unsigned char* buffer, enum acpMsgLocalI ...@@ -276,8 +276,6 @@ int acpGetMsgLocalId(size_t size, const unsigned char* buffer, enum acpMsgLocalI
return 0; return 0;
} }
#ifdef ACP_USE_HANDSHAKE
static int acpRecvMsgInternal(int sock, size_t size, unsigned char* buffer) static int acpRecvMsgInternal(int sock, size_t size, unsigned char* buffer)
{ {
int length = 0; int length = 0;
...@@ -328,10 +326,10 @@ static int acpRecvMsgInternal(int sock, size_t size, unsigned char* buffer) ...@@ -328,10 +326,10 @@ static int acpRecvMsgInternal(int sock, size_t size, unsigned char* buffer)
return -ACP_ERR_SIDL_FAILURE; return -ACP_ERR_SIDL_FAILURE;
} }
return length+ACP_HEADER_SIZE; return length + ACP_HEADER_SIZE;
} }
static int acpHandleHandshakeFromClient(struct acpCtx* ctx, int sock, struct AcpHandshake_Type *hs) static int acpHandleHandshakeFromClient(struct acpCtx* ctx, int sock, struct AcpHandshake_Type* hs)
{ {
struct AcpHandshakeRsp_Type hs_rsp; struct AcpHandshakeRsp_Type hs_rsp;
...@@ -341,31 +339,31 @@ static int acpHandleHandshakeFromClient(struct acpCtx* ctx, int sock, struct Acp ...@@ -341,31 +339,31 @@ static int acpHandleHandshakeFromClient(struct acpCtx* ctx, int sock, struct Acp
snprintf(hs_rsp.acpVerCksm, 63, "%s", ACP_VERSION_CKSM); snprintf(hs_rsp.acpVerCksm, 63, "%s", ACP_VERSION_CKSM);
/* ACP version matched */ /* ACP version matched */
if(strncmp(ACP_VERSION, hs->acpVersion, strlen(ACP_VERSION)) == 0 && strncmp(ACP_VERSION_CKSM, hs->acpVerCksm, strlen(ACP_VERSION)) == 0) { if (strncmp(ACP_VERSION, hs->acpVersion, strlen(ACP_VERSION)) == 0 && strncmp(ACP_VERSION_CKSM, hs->acpVerCksm, strlen(ACP_VERSION)) == 0) {
hs_rsp.acpVersionChk = true; hs_rsp.acpVersionChk = true;
} else { } else {
hs_rsp.acpVersionChk = false; hs_rsp.acpVersionChk = false;
} }
ACP_DEBUG_CLOG(ctx, "ACP version: %s", hs_rsp.acpVersionChk?"matched":"not matched"); ACP_DEBUG_CLOG(ctx, "ACP version: %s", hs_rsp.acpVersionChk ? "matched" : "not matched");
int ret = 0; int ret = 0;
const size_t size = 16*1024; const size_t size = 16 * 1024;
size_t bufSize = size; size_t bufSize = size;
unsigned char* buffer = (unsigned char*)acpMalloc(size); unsigned char* buffer = (unsigned char*)acpMalloc(size);
SIDL_ASSERT(buffer); SIDL_ASSERT(buffer);
ret = acpHandshakeHandleToSSEncSrv(ctx, buffer, &bufSize, &hs_rsp); ret = acpHandshakeHandleToSSEncSrv(ctx, buffer, &bufSize, &hs_rsp);
if( ret == 0) { if (ret == 0) {
if (acpSocketSend(sock, bufSize, buffer) != (int)bufSize) { if (acpSocketSend(sock, bufSize, buffer) != (int)bufSize) {
ACP_DEBUG_CLOG(ctx, "Error: Failed to send HandshakeToSS message"); ACP_DEBUG_CLOG(ctx, "Error: Failed to send HandshakeToSS message");
acpPeerSetHandshaked(ctx, sock, 0); acpPeerSetHandshaked(ctx, sock, 0);
ret = -ACP_ERR_INTERNAL; ret = -ACP_ERR_INTERNAL;
} else { } else {
ACP_DEBUG_CLOG(ctx, "HandshakeToSS message sent"); ACP_DEBUG_CLOG(ctx, "HandshakeToSS message sent");
//No fatal to be generated if handshake not well processed // No fatal to be generated if handshake not well processed
acpPeerSetHandshaked(ctx, sock, 1); acpPeerSetHandshaked(ctx, sock, 1);
//acpPeerSetHandshaked(ctx, sock, (hs_rsp.acpVersionChk?1:0)); // acpPeerSetHandshaked(ctx, sock, (hs_rsp.acpVersionChk?1:0));
ret = 0; ret = 0;
} }
} else { } else {
...@@ -383,7 +381,7 @@ static int acpHandleHandshakeFromClient(struct acpCtx* ctx, int sock, struct Acp ...@@ -383,7 +381,7 @@ static int acpHandleHandshakeFromClient(struct acpCtx* ctx, int sock, struct Acp
static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock) static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock)
{ {
ACP_DEBUG_ENTER_CLOG(ctx); ACP_DEBUG_ENTER_CLOG(ctx);
const size_t size = 16*1024; const size_t size = 16 * 1024;
unsigned char* buffer = (unsigned char*)acpMalloc(size); unsigned char* buffer = (unsigned char*)acpMalloc(size);
SIDL_ASSERT(buffer); SIDL_ASSERT(buffer);
...@@ -392,15 +390,15 @@ static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock) ...@@ -392,15 +390,15 @@ static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock)
/* Send Handshake to Server */ /* Send Handshake to Server */
struct AcpHandshake_Type hs; struct AcpHandshake_Type hs;
struct AcpHandshakeRsp_Type *hs_rsp; struct AcpHandshakeRsp_Type* hs_rsp;
size_t bufSize = size; size_t bufSize = size;
int ret = 0; int ret = 0;
memset(hs.acpVersion, 0, 32); memset(hs.acpVersion, 0, 32);
snprintf(hs.acpVersion, 31, "%s", ACP_VERSION); snprintf(hs.acpVersion, 31, "%s", ACP_VERSION);
memset(hs.acpVerCksm, 0, 64); memset(hs.acpVerCksm, 0, 64);
snprintf(hs.acpVerCksm, 63, "%s", ACP_VERSION_CKSM); snprintf(hs.acpVerCksm, 63, "%s", ACP_VERSION_CKSM);
ret = acpHandshakeHandleFromSSEncClt(ctx, buffer, &bufSize, &hs); ret = acpHandshakeHandleFromSSEncClt(ctx, buffer, &bufSize, &hs);
if(ret == 0) { if (ret == 0) {
int retry = 0; int retry = 0;
if (acpSocketSend(sock, bufSize, buffer) != (int)bufSize) { if (acpSocketSend(sock, bufSize, buffer) != (int)bufSize) {
...@@ -422,7 +420,7 @@ static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock) ...@@ -422,7 +420,7 @@ static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock)
/* FIXME: No message (timeout on socket), retry */ /* FIXME: No message (timeout on socket), retry */
if (length == 0) { if (length == 0) {
retry++; retry++;
if(retry == 10) { if (retry == 10) {
ret = -ACP_ERR_SOCK_TIMEOUT; ret = -ACP_ERR_SOCK_TIMEOUT;
ACP_DEBUG_CLOG(ctx, "ERROR: No HandshakeToSSToSS message for ACP version handshake"); ACP_DEBUG_CLOG(ctx, "ERROR: No HandshakeToSSToSS message for ACP version handshake");
break; break;
...@@ -441,7 +439,7 @@ static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock) ...@@ -441,7 +439,7 @@ static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock)
if (localId != ACP_LID_HandshakeHandleToSS) { if (localId != ACP_LID_HandshakeHandleToSS) {
/* Discard message other than handshake rsp */ /* Discard message other than handshake rsp */
retry++; retry++;
if(retry == 10) { if (retry == 10) {
ret = -ACP_ERR_SOCK_TIMEOUT; ret = -ACP_ERR_SOCK_TIMEOUT;
break; break;
} }
...@@ -454,10 +452,10 @@ static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock) ...@@ -454,10 +452,10 @@ static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock)
break; break;
} }
if(!hs_rsp->acpVersionChk) { if (!hs_rsp->acpVersionChk) {
ACP_DEBUG_CLOG(ctx, "ERROR: ACP version Not Matched: cli_version=[%s, cksm: %s] srv_version=[%s, chksm: %s].", ACP_VERSION, ACP_VERSION_CKSM, hs_rsp->acpVersion, hs_rsp->acpVerCksm); ACP_DEBUG_CLOG(ctx, "ERROR: ACP version Not Matched: cli_version=[%s, cksm: %s] srv_version=[%s, chksm: %s].", ACP_VERSION, ACP_VERSION_CKSM, hs_rsp->acpVersion, hs_rsp->acpVerCksm);
acpHandshakeHandleToSSFreeClt(hs_rsp); acpHandshakeHandleToSSFreeClt(hs_rsp);
ret = 0;//-ACP_ERR_INVALID_VERSION; ret = 0; //-ACP_ERR_INVALID_VERSION;
break; break;
} }
...@@ -484,7 +482,7 @@ static int acpConnectToSrv(struct acpCtx* ctx, int sock) ...@@ -484,7 +482,7 @@ static int acpConnectToSrv(struct acpCtx* ctx, int sock)
/* Perform Handshake to Server */ /* Perform Handshake to Server */
int ret = acpHandleHandshakeToServer(ctx, sock); int ret = acpHandleHandshakeToServer(ctx, sock);
if(ret != 0) { if (ret != 0) {
ACP_DEBUG_EXIT_CLOG(ctx, "Error: Handshake failure"); ACP_DEBUG_EXIT_CLOG(ctx, "Error: Handshake failure");
return ret; return ret;
} }
...@@ -495,8 +493,6 @@ static int acpConnectToSrv(struct acpCtx* ctx, int sock) ...@@ -495,8 +493,6 @@ static int acpConnectToSrv(struct acpCtx* ctx, int sock)
return ret; return ret;
} }
#endif
int acpRecvMsg(acpCtx_t ctx, size_t* size, unsigned char* buffer) int acpRecvMsg(acpCtx_t ctx, size_t* size, unsigned char* buffer)
{ {
SIDL_ASSERT(size && buffer); SIDL_ASSERT(size && buffer);
...@@ -631,17 +627,16 @@ int acpRecvMsg(acpCtx_t ctx, size_t* size, unsigned char* buffer) ...@@ -631,17 +627,16 @@ int acpRecvMsg(acpCtx_t ctx, size_t* size, unsigned char* buffer)
int type = (int)((buffer[4] << 24) | (buffer[5] << 16) | (buffer[6] << 8) | (buffer[7])); int type = (int)((buffer[4] << 24) | (buffer[5] << 16) | (buffer[6] << 8) | (buffer[7]));
ACP_DEBUG_PREFIX_CLOG(ctx, "Receiving message '%s' (userId: %d, type: 0x%x)\r\n", acpGetMsgName(*size, buffer), userId, type); ACP_DEBUG_PREFIX_CLOG(ctx, "Receiving message '%s' (userId: %d, type: 0x%x)\r\n", acpGetMsgName(*size, buffer), userId, type);
#ifdef ACP_USE_HANDSHAKE
if (ACP_CTX_CAST(ctx)->isServer) { if (ACP_CTX_CAST(ctx)->isServer) {
bool handshaked = acpPeerHandshaked(ctx, sock); bool handshaked = acpPeerHandshaked(ctx, sock);
if(!handshaked && type != (int)ACP_LID_HandshakeHandleFromSS) { if (!handshaked && type != (int)ACP_LID_HandshakeHandleFromSS) {
/* The first message should be HandshakeHandleFromSS from client */ /* The first message should be HandshakeHandleFromSS from client */
ACP_DEBUG_PREFIX_CLOG(ctx, "Wrong message, should be HandshakeHandleFromSS\r\n"); ACP_DEBUG_PREFIX_CLOG(ctx, "Wrong message, should be HandshakeHandleFromSS\r\n");
userId = -ACP_ERR_INTERNAL; userId = -ACP_ERR_INTERNAL;
} else if(type == (int)ACP_LID_HandshakeHandleFromSS) { } else if (type == (int)ACP_LID_HandshakeHandleFromSS) {
/* Handle Handshake from Client */ /* Handle Handshake from Client */
/* FIXME: How about duplicate Handshake? */ /* FIXME: How about duplicate Handshake? */
struct AcpHandshake_Type *hs; struct AcpHandshake_Type* hs;
if(acpHandshakeHandleFromSSDecSrv(ctx, buffer, length + ACP_HEADER_SIZE, &hs) == 0) { if(acpHandshakeHandleFromSSDecSrv(ctx, buffer, length + ACP_HEADER_SIZE, &hs) == 0) {
ACP_DEBUG_CLOG(ctx, "ACP version: cli_version=[%s, cksm: %s] srv_version=[%s, chksm: %s].", hs->acpVersion, hs->acpVerCksm, ACP_VERSION, ACP_VERSION_CKSM); ACP_DEBUG_CLOG(ctx, "ACP version: cli_version=[%s, cksm: %s] srv_version=[%s, chksm: %s].", hs->acpVersion, hs->acpVerCksm, ACP_VERSION, ACP_VERSION_CKSM);
...@@ -653,7 +648,6 @@ int acpRecvMsg(acpCtx_t ctx, size_t* size, unsigned char* buffer) ...@@ -653,7 +648,6 @@ int acpRecvMsg(acpCtx_t ctx, size_t* size, unsigned char* buffer)
} }
} }
} }
#endif
if (userId >= 0) { if (userId >= 0) {
#ifdef ACP_DEBUG #ifdef ACP_DEBUG
...@@ -722,8 +716,6 @@ int acpClientInit(acpCtx_t ctx, IpAddress_t ipaddr, int port, size_t aSize) ...@@ -722,8 +716,6 @@ int acpClientInit(acpCtx_t ctx, IpAddress_t ipaddr, int port, size_t aSize)
return -ACP_ERR_SOCKCONN_ABORTED; return -ACP_ERR_SOCKCONN_ABORTED;
} }
#ifdef ACP_USE_HANDSHAKE
int ret = acpConnectToSrv(ACP_CTX_CAST(ctx), sock); int ret = acpConnectToSrv(ACP_CTX_CAST(ctx), sock);
if (ret < 0) { if (ret < 0) {
acpSocketClose(sock); acpSocketClose(sock);
...@@ -738,7 +730,6 @@ int acpClientInit(acpCtx_t ctx, IpAddress_t ipaddr, int port, size_t aSize) ...@@ -738,7 +730,6 @@ int acpClientInit(acpCtx_t ctx, IpAddress_t ipaddr, int port, size_t aSize)
acpSocketClose(sock); acpSocketClose(sock);
return -ACP_ERR_NOT_CONNECTED; return -ACP_ERR_NOT_CONNECTED;
} }
#endif
#endif #endif
ACP_CTX_CAST(ctx)->sock = sock; ACP_CTX_CAST(ctx)->sock = sock;
...@@ -826,9 +817,7 @@ int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable* ...@@ -826,9 +817,7 @@ int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable*
ACP_DEBUG_EXIT_LOG("ACP_ERR_INVALID_CTX"); ACP_DEBUG_EXIT_LOG("ACP_ERR_INVALID_CTX");
return -ACP_ERR_INVALID_CTX; return -ACP_ERR_INVALID_CTX;
} }
#ifdef ACP_USE_HANDSHAKE
bool isOnlyNotify = true; bool isOnlyNotify = true;
#endif
if (msgTable) { if (msgTable) {
while (msgTable->name) { while (msgTable->name) {
int err = acpSetMsgId(_ctx, msgTable->name, msgTable->userId); int err = acpSetMsgId(_ctx, msgTable->name, msgTable->userId);
...@@ -837,7 +826,7 @@ int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable* ...@@ -837,7 +826,7 @@ int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable*
ACP_DEBUG_EXIT_LOG("acpSetMsgId failed"); ACP_DEBUG_EXIT_LOG("acpSetMsgId failed");
return err; return err;
} }
#ifdef ACP_USE_HANDSHAKE
err = acpCtxGetMsgKindFromName(msgTable->name); err = acpCtxGetMsgKindFromName(msgTable->name);
if (err < 0) { if (err < 0) {
acpDeleteCtx(_ctx); acpDeleteCtx(_ctx);
...@@ -848,7 +837,6 @@ int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable* ...@@ -848,7 +837,6 @@ int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable*
if (err > 0) { if (err > 0) {
isOnlyNotify = false; isOnlyNotify = false;
} }
#endif
msgTable++; msgTable++;
} }
} }
...@@ -862,7 +850,6 @@ int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable* ...@@ -862,7 +850,6 @@ int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable*
*ctx = _ctx; *ctx = _ctx;
#ifdef ACP_USE_HANDSHAKE
if (isOnlyNotify) { if (isOnlyNotify) {
int ret = -1; int ret = -1;
ACP_DEBUG_CLOG(*ctx, "Wait for handshake\r\n"); ACP_DEBUG_CLOG(*ctx, "Wait for handshake\r\n");
...@@ -872,7 +859,6 @@ int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable* ...@@ -872,7 +859,6 @@ int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable*
ret = acpRecvMsg(*ctx, &sz, buffer); ret = acpRecvMsg(*ctx, &sz, buffer);
} }
} }
#endif
ACP_DEBUG_EXIT_LOG(NULL); ACP_DEBUG_EXIT_LOG(NULL);
return 0; return 0;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "acpIdMap.h" #include "acpIdMap.h"
const struct acpIdMapItf acpItfMap[] = { const struct acpIdMapItf acpItfMap[] = {
{ "Test", 1, 0, 7 }, { "Test", 1, 0, 7 },
{ "Sys", 2, 7, 1 }, { "Sys", 2, 7, 1 },
...@@ -26,6 +25,7 @@ const struct acpIdMapItf acpItfMap[] = { ...@@ -26,6 +25,7 @@ const struct acpIdMapItf acpItfMap[] = {
{ "Drb", 6, 13, 2 }, { "Drb", 6, 13, 2 },
{ "Handshake", 7, 15, 2 }, { "Handshake", 7, 15, 2 },
{ "SysInd", 8, 17, 1 }, { "SysInd", 8, 17, 1 },
{ "NrSysSrb", 9, 18, 2 },
}; };
const unsigned int acpItfMapSize = sizeof(acpItfMap) / sizeof(acpItfMap[0]); const unsigned int acpItfMapSize = sizeof(acpItfMap) / sizeof(acpItfMap[0]);
...@@ -66,7 +66,12 @@ struct acpIdMapService acpIdMap[] = { ...@@ -66,7 +66,12 @@ struct acpIdMapService acpIdMap[] = {
{ "HandshakeHandleFromSS", 0x90040700, (unsigned int)-1, 1 }, { "HandshakeHandleFromSS", 0x90040700, (unsigned int)-1, 1 },
{ "HandshakeHandleToSS", 0x90040701, (unsigned int)-1, 0 }, { "HandshakeHandleToSS", 0x90040701, (unsigned int)-1, 0 },
// SysInd part
{ "SysIndProcessToSS", 0x90040800, (unsigned int)-1, 0}, { "SysIndProcessToSS", 0x90040800, (unsigned int)-1, 0},
// NrSysSrb part
{ "NrSysSrbProcessFromSS", 0x90040900, (unsigned int)-1, 1 },
{ "NrSysSrbProcessToSS", 0x90040901, (unsigned int)-1, 0 },
}; };
const unsigned int acpIdMapSize = sizeof(acpIdMap) / sizeof(acpIdMap[0]); const unsigned int acpIdMapSize = sizeof(acpIdMap) / sizeof(acpIdMap[0]);
/*
* Copyright 2022 Sequans Communications.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
#include "acpNrSysSrb.h"
#include "acpCtx.h"
#include "acpProto.h"
#include "acpMsgIds.h"
#include "serNrSysSrb.h"
int acpNrSysSrbProcessToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct NR_RRC_PDU_IND* ToSS)
{
if (!acpCtxIsValid(_ctx)) {
return -ACP_ERR_INVALID_CTX;
}
size_t _lidx = ACP_HEADER_SIZE;
int _ret = serNrSysSrbProcessToSSEncSrv(_buffer, *_size, &_lidx, ToSS);
if (_ret == SIDL_STATUS_OK) {
acpBuildHeader(_ctx, ACP_LID_NrSysSrbProcessToSS, _lidx, _buffer);
}
*_size = _lidx;
return _ret;
}
int acpNrSysSrbProcessToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct NR_RRC_PDU_IND** ToSS)
{
if (!acpCtxIsValid(_ctx)) {
return -ACP_ERR_INVALID_CTX;
}
return serNrSysSrbProcessToSSDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, ToSS);
}
void acpNrSysSrbProcessToSSFreeClt(struct NR_RRC_PDU_IND* ToSS)
{
serNrSysSrbProcessToSSFreeClt(ToSS);
}
int acpNrSysSrbProcessFromSSEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct NR_RRC_PDU_REQ* FromSS)
{
if (!acpCtxIsValid(_ctx)) {
return -ACP_ERR_INVALID_CTX;
}
size_t _lidx = ACP_HEADER_SIZE;
int _ret = serNrSysSrbProcessFromSSEncClt(_buffer, *_size, &_lidx, FromSS);
if (_ret == SIDL_STATUS_OK) {
acpBuildHeader(_ctx, ACP_LID_NrSysSrbProcessFromSS, _lidx, _buffer);
}
*_size = _lidx;
return _ret;
}
int acpNrSysSrbProcessFromSSDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct NR_RRC_PDU_REQ** FromSS)
{
if (!acpCtxIsValid(_ctx)) {
return -ACP_ERR_INVALID_CTX;
}
return serNrSysSrbProcessFromSSDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, FromSS);
}
void acpNrSysSrbProcessFromSSFreeSrv(struct NR_RRC_PDU_REQ* FromSS)
{
serNrSysSrbProcessFromSSFreeSrv(FromSS);
}
/*
* Copyright 2022 Sequans Communications.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
#pragma once
#include "SIDL_NASEMU_NR_SYSTEM_PORT.h"
#include "adbg.h"
SIDL_BEGIN_C_INTERFACE
void adbgNrSysSrbProcessToSSLogOut(acpCtx_t _ctx, const struct NR_RRC_PDU_IND* ToSS);
void adbgNrSysSrbProcessFromSSLogIn(acpCtx_t _ctx, const struct NR_RRC_PDU_REQ* FromSS);
SIDL_END_C_INTERFACE
...@@ -17,42 +17,53 @@ ...@@ -17,42 +17,53 @@
#include "adbgMsgMap.h" #include "adbgMsgMap.h"
#include "serTest.h" #include "serTest.h"
#include "serHandshake.h"
#if defined(PROJECT_HAS_RAT_EUTRA)
#include "serSys.h" #include "serSys.h"
#include "serSysInd.h" #include "serSysInd.h"
#include "serSysSrb.h" #include "serSysSrb.h"
#include "serVng.h" #include "serVng.h"
#include "serDrb.h" #include "serDrb.h"
#include "serHandshake.h" #endif
#if defined(PROJECT_HAS_RAT_NR)
#include "serNrSysSrb.h"
#endif
#include "adbgTest.h" #include "adbgTest.h"
#include "adbgHandshake.h"
#if defined(PROJECT_HAS_RAT_EUTRA)
#include "adbgSys.h" #include "adbgSys.h"
#include "adbgSysInd.h" #include "adbgSysInd.h"
#include "adbgSysSrb.h" #include "adbgSysSrb.h"
#include "adbgVng.h" #include "adbgVng.h"
#include "adbgDrb.h" #include "adbgDrb.h"
#include "adbgHandshake.h" #endif
#if defined(PROJECT_HAS_RAT_NR)
#include "adbgNrSysSrb.h"
#endif
void adbgMsgLogInArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const unsigned char* buffer) void adbgMsgLogInArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const unsigned char* buffer)
{ {
if (id == 0x90040100 /* TestHelloFromSS */) { if (id == ACP_LID_TestHelloFromSS) {
return; return;
} }
if (id == 0x90040102 /* TestPing */) { if (id == ACP_LID_TestPing) {
return; return;
} }
if (id == 0x90040103 /* TestEcho */) { if (id == ACP_LID_TestEcho) {
return; return;
} }
if (id == 0x90040104 /* TestTest1 */) { if (id == ACP_LID_TestTest1) {
return; return;
} }
if (id == 0x90040105 /* TestTest2 */) { if (id == ACP_LID_TestTest2) {
return; return;
} }
if (id == 0x90040106 /* TestOther */) { if (id == ACP_LID_TestOther) {
return; return;
} }
if (id == 0x90040200 /* SysProcess */) { #if defined(PROJECT_HAS_RAT_EUTRA)
if (id == ACP_LID_SysProcess) {
struct SYSTEM_CTRL_REQ* FromSS; struct SYSTEM_CTRL_REQ* FromSS;
if (serSysProcessDecSrv(buffer, size, NULL, 0, &FromSS) == 0) { if (serSysProcessDecSrv(buffer, size, NULL, 0, &FromSS) == 0) {
adbgSysProcessLogIn(ctx, FromSS); adbgSysProcessLogIn(ctx, FromSS);
...@@ -63,10 +74,10 @@ void adbgMsgLogInArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const un ...@@ -63,10 +74,10 @@ void adbgMsgLogInArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const un
} }
return; return;
} }
if (id == 0x90040300 /* SysVTEnquireTimingAck */) { if (id == ACP_LID_SysVTEnquireTimingAck) {
return; return;
} }
if (id == 0x90040400 /* SysSrbProcessFromSS */) { if (id == ACP_LID_SysSrbProcessFromSS) {
struct EUTRA_RRC_PDU_REQ* FromSS; struct EUTRA_RRC_PDU_REQ* FromSS;
if (serSysSrbProcessFromSSDecSrv(buffer, size, NULL, 0, &FromSS) == 0) { if (serSysSrbProcessFromSSDecSrv(buffer, size, NULL, 0, &FromSS) == 0) {
adbgSysSrbProcessFromSSLogIn(ctx, FromSS); adbgSysSrbProcessFromSSLogIn(ctx, FromSS);
...@@ -78,7 +89,7 @@ void adbgMsgLogInArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const un ...@@ -78,7 +89,7 @@ void adbgMsgLogInArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const un
} }
return; return;
} }
if (id == 0x90040500 /* VngProcess */) { if (id == ACP_LID_VngProcess) {
struct EUTRA_VNG_CTRL_REQ* FromSS; struct EUTRA_VNG_CTRL_REQ* FromSS;
if (serVngProcessDecSrv(buffer, size, NULL, 0, &FromSS) == 0) { if (serVngProcessDecSrv(buffer, size, NULL, 0, &FromSS) == 0) {
adbgVngProcessLogIn(ctx, FromSS); adbgVngProcessLogIn(ctx, FromSS);
...@@ -89,7 +100,7 @@ void adbgMsgLogInArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const un ...@@ -89,7 +100,7 @@ void adbgMsgLogInArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const un
} }
return; return;
} }
if (id == 0x90040600 /* DrbProcessFromSS */) { if (id == ACP_LID_DrbProcessFromSS) {
struct DRB_COMMON_REQ* FromSS; struct DRB_COMMON_REQ* FromSS;
if (serDrbProcessFromSSDecSrv(buffer, size, NULL, 0, &FromSS) == 0) { if (serDrbProcessFromSSDecSrv(buffer, size, NULL, 0, &FromSS) == 0) {
adbgDrbProcessFromSSLogIn(ctx, FromSS); adbgDrbProcessFromSSLogIn(ctx, FromSS);
...@@ -101,35 +112,49 @@ void adbgMsgLogInArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const un ...@@ -101,35 +112,49 @@ void adbgMsgLogInArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const un
} }
return; return;
} }
#endif
if (id == ACP_LID_HandshakeHandleFromSS) {
return;
}
#if defined(PROJECT_HAS_RAT_NR)
if (id == ACP_LID_NrSysSrbProcessFromSS) {
struct NR_RRC_PDU_REQ* FromSS;
if (serNrSysSrbProcessFromSSDecSrv(buffer, size, NULL, 0, &FromSS) == 0) {
adbgNrSysSrbProcessFromSSLogIn(ctx, FromSS);
/* Handshake */ serNrSysSrbProcessFromSSFreeSrv(FromSS);
if (id == 0x90040700 /* HandshakeHandleFromSS */) { } else {
adbgPrintLog(ctx, "cannot decode buffer");
adbgPrintLog(ctx, NULL);
}
return; return;
} }
#endif
SIDL_ASSERT(0); SIDL_ASSERT(0);
} }
void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const unsigned char* buffer) void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const unsigned char* buffer)
{ {
if (id == 0x90040101 /* TestHelloToSS */) { if (id == ACP_LID_TestHelloToSS) {
return; return;
} }
if (id == 0x90040102 /* TestPing */) { if (id == ACP_LID_TestPing) {
return; return;
} }
if (id == 0x90040103 /* TestEcho */) { if (id == ACP_LID_TestEcho) {
return; return;
} }
if (id == 0x90040104 /* TestTest1 */) { if (id == ACP_LID_TestTest1) {
return; return;
} }
if (id == 0x90040105 /* TestTest2 */) { if (id == ACP_LID_TestTest2) {
return; return;
} }
if (id == 0x90040106 /* TestOther */) { if (id == ACP_LID_TestOther) {
return; return;
} }
if (id == 0x90040200 /* SysProcess */) { #if defined(PROJECT_HAS_RAT_EUTRA)
if (id == ACP_LID_SysProcess) {
struct SYSTEM_CTRL_CNF* ToSS; struct SYSTEM_CTRL_CNF* ToSS;
if (serSysProcessDecClt(buffer, size, NULL, 0, &ToSS) == 0) { if (serSysProcessDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
adbgSysProcessLogOut(ctx, ToSS); adbgSysProcessLogOut(ctx, ToSS);
...@@ -140,10 +165,10 @@ void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const u ...@@ -140,10 +165,10 @@ void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const u
} }
return; return;
} }
if (id == 0x90040301 /* SysVTEnquireTimingUpd */) { if (id == ACP_LID_SysVTEnquireTimingUpd) {
return; return;
} }
if (id == 0x90040401 /* SysSrbProcessToSS */) { if (id == ACP_LID_SysSrbProcessToSS) {
struct EUTRA_RRC_PDU_IND* ToSS; struct EUTRA_RRC_PDU_IND* ToSS;
if (serSysSrbProcessToSSDecClt(buffer, size, NULL, 0, &ToSS) == 0) { if (serSysSrbProcessToSSDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
adbgSysSrbProcessToSSLogOut(ctx, ToSS); adbgSysSrbProcessToSSLogOut(ctx, ToSS);
...@@ -155,7 +180,7 @@ void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const u ...@@ -155,7 +180,7 @@ void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const u
return; return;
} }
if (id == 0x90040500 /* VngProcess */) { if (id == ACP_LID_VngProcess) {
struct EUTRA_VNG_CTRL_CNF* ToSS; struct EUTRA_VNG_CTRL_CNF* ToSS;
if (serVngProcessDecClt(buffer, size, NULL, 0, &ToSS) == 0) { if (serVngProcessDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
adbgVngProcessLogOut(ctx, ToSS); adbgVngProcessLogOut(ctx, ToSS);
...@@ -166,7 +191,7 @@ void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const u ...@@ -166,7 +191,7 @@ void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const u
} }
return; return;
} }
if (id == 0x90040601 /* DrbProcessToSS */) { if (id == ACP_LID_DrbProcessToSS) {
struct DRB_COMMON_IND* ToSS; struct DRB_COMMON_IND* ToSS;
if (serDrbProcessToSSDecClt(buffer, size, NULL, 0, &ToSS) == 0) { if (serDrbProcessToSSDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
adbgDrbProcessToSSLogOut(ctx, ToSS); adbgDrbProcessToSSLogOut(ctx, ToSS);
...@@ -177,13 +202,7 @@ void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const u ...@@ -177,13 +202,7 @@ void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const u
} }
return; return;
} }
if (id == ACP_LID_SysIndProcessToSS /* SysIndProccessToSS */) {
/* Handshake */
if (id == 0x90040701 /* HandshakeHandleToSS */) {
return;
}
if (id == 0x90040800 /* SysIndProccessToSS */) {
struct SYSTEM_IND* ToSS = NULL; struct SYSTEM_IND* ToSS = NULL;
if (serSysIndProcessToSSDecClt(buffer, size, NULL, 0, &ToSS) == 0) { if (serSysIndProcessToSSDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
adbgSysIndProcessToSSLogOut(ctx, ToSS); adbgSysIndProcessToSSLogOut(ctx, ToSS);
...@@ -194,5 +213,24 @@ void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const u ...@@ -194,5 +213,24 @@ void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const u
} }
return; return;
} }
#endif
/* Handshake */
if (id == ACP_LID_HandshakeHandleToSS /* HandshakeHandleToSS */) {
return;
}
#if defined(PROJECT_HAS_RAT_NR)
if (id == ACP_LID_NrSysSrbProcessToSS) {
struct NR_RRC_PDU_IND* ToSS;
if (serNrSysSrbProcessToSSDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
adbgNrSysSrbProcessToSSLogOut(ctx, ToSS);
serNrSysSrbProcessToSSFreeClt(ToSS);
} else {
adbgPrintLog(ctx, "cannot decode buffer");
adbgPrintLog(ctx, NULL);
}
return;
}
#endif
SIDL_ASSERT(0); SIDL_ASSERT(0);
} }
This diff is collapsed.
/*
* Copyright 2022 Sequans Communications.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
#pragma once
#include "SIDL_NASEMU_NR_SYSTEM_PORT.h"
#include "SidlCompiler.h"
SIDL_BEGIN_C_INTERFACE
int serNrSysSrbProcessToSSEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct NR_RRC_PDU_IND* ToSS);
int serNrSysSrbProcessToSSDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct NR_RRC_PDU_IND** ToSS);
void serNrSysSrbProcessToSSFreeClt(struct NR_RRC_PDU_IND* ToSS);
int serNrSysSrbProcessFromSSEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct NR_RRC_PDU_REQ* FromSS);
int serNrSysSrbProcessFromSSDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct NR_RRC_PDU_REQ** FromSS);
void serNrSysSrbProcessFromSSFreeSrv(struct NR_RRC_PDU_REQ* FromSS);
SIDL_END_C_INTERFACE
This diff is collapsed.
...@@ -71,8 +71,8 @@ SIDL_BEGIN_C_INTERFACE ...@@ -71,8 +71,8 @@ SIDL_BEGIN_C_INTERFACE
*(idx) += 4; \ *(idx) += 4; \
} }
#define HTON_64(dst, src, idx) \ #define HTON_64(dst, src, idx) \
{ \ { \
*(dst) = ((uint64_t)(src) >> 56) & 0xFF; \ *(dst) = ((uint64_t)(src) >> 56) & 0xFF; \
*(dst + 1) = ((uint64_t)(src) >> 48) & 0xFF; \ *(dst + 1) = ((uint64_t)(src) >> 48) & 0xFF; \
*(dst + 2) = ((uint64_t)(src) >> 40) & 0xFF; \ *(dst + 2) = ((uint64_t)(src) >> 40) & 0xFF; \
...@@ -81,11 +81,11 @@ SIDL_BEGIN_C_INTERFACE ...@@ -81,11 +81,11 @@ SIDL_BEGIN_C_INTERFACE
*(dst + 5) = ((uint64_t)(src) >> 16) & 0xFF; \ *(dst + 5) = ((uint64_t)(src) >> 16) & 0xFF; \
*(dst + 6) = ((uint64_t)(src) >> 8) & 0xFF; \ *(dst + 6) = ((uint64_t)(src) >> 8) & 0xFF; \
*(dst + 7) = ((uint64_t)(src) >> 0) & 0xFF; \ *(dst + 7) = ((uint64_t)(src) >> 0) & 0xFF; \
*idx += 8; \ *idx += 8; \
} }
#define NTOH_64(dst, src, idx) \ #define NTOH_64(dst, src, idx) \
{ \ { \
(dst) = (((uint64_t)(((unsigned char*)src)[0]) << 56) | \ (dst) = (((uint64_t)(((unsigned char*)src)[0]) << 56) | \
((uint64_t)(((unsigned char*)src)[1]) << 48) | \ ((uint64_t)(((unsigned char*)src)[1]) << 48) | \
((uint64_t)(((unsigned char*)src)[2]) << 40) | \ ((uint64_t)(((unsigned char*)src)[2]) << 40) | \
...@@ -94,7 +94,7 @@ SIDL_BEGIN_C_INTERFACE ...@@ -94,7 +94,7 @@ SIDL_BEGIN_C_INTERFACE
((uint64_t)(((unsigned char*)src)[5]) << 16) | \ ((uint64_t)(((unsigned char*)src)[5]) << 16) | \
((uint64_t)(((unsigned char*)src)[6]) << 8) | \ ((uint64_t)(((unsigned char*)src)[6]) << 8) | \
((uint64_t)(((unsigned char*)src)[7]) << 0)); \ ((uint64_t)(((unsigned char*)src)[7]) << 0)); \
*(idx) += 8; \ *(idx) += 8; \
} }
SIDL_END_C_INTERFACE SIDL_END_C_INTERFACE
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "SidlBase.h" #include "SidlBase.h"
#include "SidlCommon.h" #include "SidlCommon.h"
#include "SidlCommonBase.h" #include "SidlCommonBase.h"
#include "SidlNrCommon.h"
#include "SidlParts.h" #include "SidlParts.h"
#include "SidlVals.h" #include "SidlVals.h"
#include "TtcnCommon.h" #include "TtcnCommon.h"
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "SidlBase.h" #include "SidlBase.h"
#include "SidlCommon.h" #include "SidlCommon.h"
#include "SidlCommonBase.h" #include "SidlCommonBase.h"
#include "SidlNrCommon.h"
#include "SidlParts.h" #include "SidlParts.h"
#include "SidlVals.h" #include "SidlVals.h"
#include "TtcnCommon.h" #include "TtcnCommon.h"
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "SidlBase.h" #include "SidlBase.h"
#include "SidlCommon.h" #include "SidlCommon.h"
#include "SidlCommonBase.h" #include "SidlCommonBase.h"
#include "SidlNrCommon.h"
#include "SidlParts.h" #include "SidlParts.h"
#include "SidlVals.h" #include "SidlVals.h"
#include "TtcnCommon.h" #include "TtcnCommon.h"
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "SidlBase.h" #include "SidlBase.h"
#include "SidlCommon.h" #include "SidlCommon.h"
#include "SidlCommonBase.h" #include "SidlCommonBase.h"
#include "SidlNrCommon.h"
#include "SidlParts.h" #include "SidlParts.h"
#include "SidlVals.h" #include "SidlVals.h"
#include "TtcnCommon.h" #include "TtcnCommon.h"
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "SidlBase.h" #include "SidlBase.h"
#include "SidlCommon.h" #include "SidlCommon.h"
#include "SidlCommonBase.h" #include "SidlCommonBase.h"
#include "SidlNrCommon.h"
#include "SidlParts.h" #include "SidlParts.h"
#include "SidlVals.h" #include "SidlVals.h"
#include "TtcnCommon.h" #include "TtcnCommon.h"
......
/*
* Copyright 2022 Sequans Communications.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
#pragma once
#include "SidlCompiler.h"
#include "SidlASN1.h"
#include "SidlASN1Base.h"
#include "SidlBase.h"
#include "SidlCommon.h"
#include "SidlCommonBase.h"
#include "SidlNrCommon.h"
#include "SidlParts.h"
#include "SidlVals.h"
#include "TtcnCommon.h"
#include "SidlCommon_BcchConfig.h"
#include "SidlCommon_Bcch_BRConfig.h"
#include "SidlCommon_CcchDcchDtchConfig.h"
#include "SidlCommon_InitialCellPower.h"
#include "SidlCommon_PhysicalLayerConfigDL.h"
#include "SidlCommon_PhysicalLayerConfigUL.h"
#include "SidlCommon_RachProcedureConfig.h"
#include "SidlCommon_SciSchedulingConfig.h"
#include "SidlCommon_ServingCellConfig.h"
#include "SidlCommon_StaticCellInfo.h"
#include "SidlCommon_CellConfigRequest.h"
SIDL_BEGIN_C_INTERFACE
enum NR_RRC_MSG_Request_Type_Sel {
NR_RRC_MSG_Request_Type_UNBOUND_VALUE = 0,
NR_RRC_MSG_Request_Type_Ccch = 1,
NR_RRC_MSG_Request_Type_Dcch = 2,
};
struct uint8_t_NR_RRC_MSG_Request_Type_Ccch_Dynamic {
size_t d;
uint8_t* v;
};
struct uint8_t_NR_RRC_MSG_Request_Type_Dcch_Dynamic {
size_t d;
uint8_t* v;
};
union NR_RRC_MSG_Request_Type_Value {
struct uint8_t_NR_RRC_MSG_Request_Type_Ccch_Dynamic Ccch;
struct uint8_t_NR_RRC_MSG_Request_Type_Dcch_Dynamic Dcch;
};
struct NR_RRC_MSG_Request_Type {
enum NR_RRC_MSG_Request_Type_Sel d;
union NR_RRC_MSG_Request_Type_Value v;
};
enum NR_RRC_MSG_Indication_Type_Sel {
NR_RRC_MSG_Indication_Type_UNBOUND_VALUE = 0,
NR_RRC_MSG_Indication_Type_Ccch = 1,
NR_RRC_MSG_Indication_Type_Ccch1 = 2,
NR_RRC_MSG_Indication_Type_Dcch = 3,
};
struct uint8_t_NR_RRC_MSG_Indication_Type_Ccch_Dynamic {
size_t d;
uint8_t* v;
};
struct uint8_t_NR_RRC_MSG_Indication_Type_Ccch1_Dynamic {
size_t d;
uint8_t* v;
};
struct uint8_t_NR_RRC_MSG_Indication_Type_Dcch_Dynamic {
size_t d;
uint8_t* v;
};
union NR_RRC_MSG_Indication_Type_Value {
struct uint8_t_NR_RRC_MSG_Indication_Type_Ccch_Dynamic Ccch;
struct uint8_t_NR_RRC_MSG_Indication_Type_Ccch1_Dynamic Ccch1;
struct uint8_t_NR_RRC_MSG_Indication_Type_Dcch_Dynamic Dcch;
};
struct NR_RRC_MSG_Indication_Type {
enum NR_RRC_MSG_Indication_Type_Sel d;
union NR_RRC_MSG_Indication_Type_Value v;
};
struct NR_RRC_PDU_REQ {
struct NR_ReqAspCommonPart_Type Common;
struct NR_RRC_MSG_Request_Type RrcPdu;
};
struct NR_RRC_PDU_IND {
struct NR_IndAspCommonPart_Type Common;
struct NR_RRC_MSG_Indication_Type RrcPdu;
};
SIDL_END_C_INTERFACE
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "SidlBase.h" #include "SidlBase.h"
#include "SidlCommon.h" #include "SidlCommon.h"
#include "SidlCommonBase.h" #include "SidlCommonBase.h"
#include "SidlNrCommon.h"
#include "SidlParts.h" #include "SidlParts.h"
#include "SidlVals.h" #include "SidlVals.h"
#include "TtcnCommon.h" #include "TtcnCommon.h"
......
/*
* Copyright 2022 Sequans Communications.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
#pragma once
#include "SidlCompiler.h"
#include "SidlASN1.h"
#include "SidlASN1Base.h"
#include "SidlBase.h"
#include "SidlCommon.h"
#include "SidlCommonBase.h"
SIDL_BEGIN_C_INTERFACE
typedef int32_t DRB_Identity;
enum NR_RadioBearerId_Type_Sel {
NR_RadioBearerId_Type_UNBOUND_VALUE = 0,
NR_RadioBearerId_Type_Srb = 1,
NR_RadioBearerId_Type_Drb = 2,
};
union NR_RadioBearerId_Type_Value {
SRB_Identity_Type Srb;
DRB_Identity Drb;
};
struct NR_RadioBearerId_Type {
enum NR_RadioBearerId_Type_Sel d;
union NR_RadioBearerId_Type_Value v;
};
enum NR_RoutingInfo_Type_Sel {
NR_RoutingInfo_Type_UNBOUND_VALUE = 0,
NR_RoutingInfo_Type_None = 1,
NR_RoutingInfo_Type_RadioBearerId = 2,
NR_RoutingInfo_Type_QosFlow = 3,
};
union NR_RoutingInfo_Type_Value {
Null_Type None;
struct NR_RadioBearerId_Type RadioBearerId;
struct QosFlow_Identification_Type QosFlow;
};
struct NR_RoutingInfo_Type {
enum NR_RoutingInfo_Type_Sel d;
union NR_RoutingInfo_Type_Value v;
};
typedef Null_Type NR_RoutingInfoSUL_Type;
struct NR_RoutingInfoSUL_Type_RoutingInfoSUL_Optional {
bool d;
NR_RoutingInfoSUL_Type v;
};
struct NR_IndAspCommonPart_Type {
NR_CellId_Type CellId;
struct NR_RoutingInfo_Type RoutingInfo;
struct NR_RoutingInfoSUL_Type_RoutingInfoSUL_Optional RoutingInfoSUL;
struct RlcBearerRouting_Type RlcBearerRouting;
struct TimingInfo_Type TimingInfo;
struct IndicationStatus_Type Status;
};
struct NR_ReqAspCommonPart_Type {
NR_CellId_Type CellId;
struct NR_RoutingInfo_Type RoutingInfo;
struct RlcBearerRouting_Type RlcBearerRouting;
struct TimingInfo_Type TimingInfo;
struct ReqAspControlInfo_Type ControlInfo;
};
SIDL_END_C_INTERFACE
...@@ -25,4 +25,3 @@ ...@@ -25,4 +25,3 @@
#ifdef C_RNTI #ifdef C_RNTI
#undef C_RNTI /* in case IDL is compiled with OAI eNB None type is also used by OAI source code */ #undef C_RNTI /* in case IDL is compiled with OAI eNB None type is also used by OAI source code */
#endif #endif
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "SidlBase.h" #include "SidlBase.h"
#include "SidlCommon.h" #include "SidlCommon.h"
#include "SidlCommonBase.h" #include "SidlCommonBase.h"
#include "SidlNrCommon.h"
#include "SidlParts.h" #include "SidlParts.h"
#include "SidlVals.h" #include "SidlVals.h"
#include "SidlCommon_BcchConfig.h" #include "SidlCommon_BcchConfig.h"
......
/*
* Copyright 2022 Sequans Communications.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
#pragma once
// SIDL keywords.
#include "msg.sidl"
// SIDL commons.
#include "SidlCommonBase.sidl"
#include "SidlCommon.sidl"
// #include "SidlASN1.sidl"
// TODO: move to NR ASN1
typedef int32_t ASN_NAME(DRB_Identity);
SIDL_UNION_ENUM(NR_RadioBearerId_Type) {
NR_RadioBearerId_Type_UNBOUND_VALUE,
NR_RadioBearerId_Type_Srb,
NR_RadioBearerId_Type_Drb
};
SIDL_UNION_BEGIN(NR_RadioBearerId_Type) {
SIDL_UNION_CASE(NR_RadioBearerId_Type_Srb)
SRB_Identity_Type Srb;
SIDL_UNION_CASE(NR_RadioBearerId_Type_Drb)
DRB_Identity Drb;
} SIDL_UNION_END;
SIDL_UNION_ENUM(NR_RoutingInfo_Type) {
NR_RoutingInfo_Type_UNBOUND_VALUE,
NR_RoutingInfo_Type_None,
NR_RoutingInfo_Type_RadioBearerId,
NR_RoutingInfo_Type_QosFlow
};
SIDL_UNION_BEGIN(NR_RoutingInfo_Type) {
SIDL_UNION_CASE(NR_RoutingInfo_Type_None)
Null_Type None;
SIDL_UNION_CASE(NR_RoutingInfo_Type_RadioBearerId)
struct NR_RadioBearerId_Type RadioBearerId;
SIDL_UNION_CASE(NR_RoutingInfo_Type_QosFlow)
struct QosFlow_Identification_Type QosFlow;
} SIDL_UNION_END;
typedef Null_Type NR_RoutingInfoSUL_Type;
struct NR_IndAspCommonPart_Type {
NR_CellId_Type CellId;
struct NR_RoutingInfo_Type RoutingInfo;
SIDL_OPTIONAL(NR_RoutingInfoSUL_Type, RoutingInfoSUL);
struct RlcBearerRouting_Type RlcBearerRouting;
struct TimingInfo_Type TimingInfo;
struct IndicationStatus_Type Status;
};
struct NR_ReqAspCommonPart_Type {
NR_CellId_Type CellId;
struct NR_RoutingInfo_Type RoutingInfo;
struct RlcBearerRouting_Type RlcBearerRouting;
struct TimingInfo_Type TimingInfo;
struct ReqAspControlInfo_Type ControlInfo;
};
...@@ -22,5 +22,8 @@ ...@@ -22,5 +22,8 @@
#include "SidlParts.sidl" #include "SidlParts.sidl"
#include "SidlVals.sidl" #include "SidlVals.sidl"
// SIDL NR common TTCN types and definitions.
#include "SidlNrCommon.sidl"
// SIDL should define anything to compile with castxml. // SIDL should define anything to compile with castxml.
SIDL_DUMMY(TtcnCommon); SIDL_DUMMY(TtcnCommon);
...@@ -23,12 +23,10 @@ ...@@ -23,12 +23,10 @@
METADATA_VAR(itf_name, "SysVT"); METADATA_VAR(itf_name, "SysVT");
METADATA_VAR(namespaces, "VirtualTime_TypesNS"); METADATA_VAR(namespaces, "VirtualTime_TypesNS");
struct VirtualTimeInfo_Type { struct VirtualTimeInfo_Type {
bool Enable; bool Enable;
struct SubFrameTiming_Type TimingInfo; struct SubFrameTiming_Type TimingInfo;
}; };
NOTIFY EnquireTimingUpd(const struct VirtualTimeInfo_Type* TimingInfoToSS); NOTIFY EnquireTimingUpd(const struct VirtualTimeInfo_Type* TimingInfoToSS);
ONEWAY EnquireTimingAck(const struct VirtualTimeInfo_Type* TimingInfoFromSS); ONEWAY EnquireTimingAck(const struct VirtualTimeInfo_Type* TimingInfoFromSS);
...@@ -31,4 +31,3 @@ struct AcpHandshakeRsp_Type { ...@@ -31,4 +31,3 @@ struct AcpHandshakeRsp_Type {
ONEWAY HandleFromSS(const struct AcpHandshake_Type* fromSS); ONEWAY HandleFromSS(const struct AcpHandshake_Type* fromSS);
NOTIFY HandleToSS(const struct AcpHandshakeRsp_Type* toSS); NOTIFY HandleToSS(const struct AcpHandshakeRsp_Type* toSS);
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
METADATA_VAR(itf_name, "Drb"); METADATA_VAR(itf_name, "Drb");
METADATA_VAR(rats, "EUTRA");
// TTCN namespaces // TTCN namespaces
METADATA_VAR(namespaces, "EUTRA_ASP_DrbDefs"); METADATA_VAR(namespaces, "EUTRA_ASP_DrbDefs");
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
METADATA_VAR(itf_name, "SysInd"); METADATA_VAR(itf_name, "SysInd");
METADATA_VAR(rats, "EUTRA");
// TTCN namespaces // TTCN namespaces
METADATA_VAR(namespaces, "EUTRA_ASP_TypeDefs"); METADATA_VAR(namespaces, "EUTRA_ASP_TypeDefs");
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
METADATA_VAR(itf_name, "Sys"); METADATA_VAR(itf_name, "Sys");
METADATA_VAR(rats, "EUTRA");
// TTCN namespaces // TTCN namespaces
METADATA_VAR(namespaces, "EUTRA_ASP_TypeDefs"); METADATA_VAR(namespaces, "EUTRA_ASP_TypeDefs");
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
METADATA_VAR(itf_name, "Vng"); METADATA_VAR(itf_name, "Vng");
METADATA_VAR(rats, "EUTRA");
// TTCN namespaces // TTCN namespaces
METADATA_VAR(namespaces, "EUTRA_ASP_VirtualNoiseDefs"); METADATA_VAR(namespaces, "EUTRA_ASP_VirtualNoiseDefs");
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
METADATA_VAR(itf_name, "SysSrb"); METADATA_VAR(itf_name, "SysSrb");
METADATA_VAR(rats, "EUTRA");
// TTCN namespaces // TTCN namespaces
METADATA_VAR(namespaces, "NasEmu_AspTypes_EUTRA"); METADATA_VAR(namespaces, "NasEmu_AspTypes_EUTRA");
......
/*
* Copyright 2022 Sequans Communications.
*
* Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
#include "msg.sidl"
// SIDL common TTCN types and definitions.
#include "TtcnCommon.sidl"
METADATA_VAR(itf_name, "NrSysSrb");
METADATA_VAR(rats, "NR");
// TTCN namespaces
METADATA_VAR(namespaces, "NasEmu5G_AspTypes_NR");
// Internal non-TTCN types
METADATA_VAR(internal, "NR_RRC_MSG_Request_Type NR_RRC_MSG_Indication_Type");
SIDL_UNION_ENUM(NR_RRC_MSG_Request_Type) {
NR_RRC_MSG_Request_Type_UNBOUND_VALUE,
NR_RRC_MSG_Request_Type_Ccch,
NR_RRC_MSG_Request_Type_Dcch
};
SIDL_UNION_BEGIN(NR_RRC_MSG_Request_Type) {
SIDL_UNION_CASE(NR_RRC_MSG_Request_Type_Ccch)
SIDL_DYNAMIC_WITH_PFX(NR_RRC_MSG_Request_Type, uint8_t, Ccch);
SIDL_UNION_CASE(NR_RRC_MSG_Request_Type_Dcch)
SIDL_DYNAMIC_WITH_PFX(NR_RRC_MSG_Request_Type, uint8_t, Dcch);
} SIDL_UNION_END;
SIDL_UNION_ENUM(NR_RRC_MSG_Indication_Type) {
NR_RRC_MSG_Indication_Type_UNBOUND_VALUE,
NR_RRC_MSG_Indication_Type_Ccch,
NR_RRC_MSG_Indication_Type_Ccch1,
NR_RRC_MSG_Indication_Type_Dcch
};
SIDL_UNION_BEGIN(NR_RRC_MSG_Indication_Type) {
SIDL_UNION_CASE(NR_RRC_MSG_Indication_Type_Ccch)
SIDL_DYNAMIC_WITH_PFX(NR_RRC_MSG_Indication_Type, uint8_t, Ccch);
SIDL_UNION_CASE(NR_RRC_MSG_Indication_Type_Ccch1)
SIDL_DYNAMIC_WITH_PFX(NR_RRC_MSG_Indication_Type, uint8_t, Ccch1);
SIDL_UNION_CASE(NR_RRC_MSG_Indication_Type_Dcch)
SIDL_DYNAMIC_WITH_PFX(NR_RRC_MSG_Indication_Type, uint8_t, Dcch);
} SIDL_UNION_END;
struct NR_RRC_PDU_REQ {
struct NR_ReqAspCommonPart_Type Common;
struct NR_RRC_MSG_Request_Type RrcPdu;
};
struct NR_RRC_PDU_IND {
struct NR_IndAspCommonPart_Type Common;
struct NR_RRC_MSG_Indication_Type RrcPdu;
};
NOTIFY ProcessToSS(struct NR_RRC_PDU_IND* ToSS);
ONEWAY ProcessFromSS(const struct NR_RRC_PDU_REQ* FromSS);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment