mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 20:50:28 +00:00
Compare commits
5 Commits
power-refe
...
feature-sy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b7708d8fe | ||
|
|
4356ca5871 | ||
|
|
757631113d | ||
|
|
86ef0bcc67 | ||
|
|
0b54ccd0f3 |
224
ci-scripts/conf_files/firecell/proxy_rcc.band1.tm1.nfapi.conf
Normal file
224
ci-scripts/conf_files/firecell/proxy_rcc.band1.tm1.nfapi.conf
Normal file
@@ -0,0 +1,224 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
# real_time choice in {hard, rt-preempt, no}
|
||||
real_time = "no";
|
||||
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0x1;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
|
||||
plmn_list = ( { mcc = 208; mnc = 93; mnc_length = 2; } );
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "3GPP_eNODEB";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 0;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 1;
|
||||
downlink_frequency = 2160000000L;
|
||||
uplink_frequency_offset = -200000000L;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 50;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
pbch_repetition = "FALSE";
|
||||
prach_root = 22;
|
||||
prach_config_index = 3;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 5;
|
||||
prach_freq_offset = 4;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -27;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
ue_TransmissionMode = 1;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.61.4";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
enable_measurement_reports = "no";
|
||||
|
||||
///X2
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "l2sim-net";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "l2sim-net";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDRESS";
|
||||
ENB_PORT_FOR_X2C = 36422; # Spec 36422
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
# IP Address, port numbers and SSMode for System Simulator
|
||||
SSConfig = (
|
||||
{
|
||||
hostIp = "127.0.0.1"; #Host IP for System Simulator
|
||||
Sys_port = 7777; #Port Number for System Simulator Sys Port
|
||||
Srb_port = 7778; #Port Number for System Simulator Srb Port
|
||||
Vng_port = 7779; #Port Number for System Simulator VNG Port
|
||||
Vtp_port = 7780; #Port Number for System Simulator VTP Port
|
||||
SSMode = 1; #SSMode: 0 - eNB , 1- SYS_PORT test , 2- Only SRB_PORT test
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
local_s_if_name = "lo";
|
||||
remote_s_address = "127.0.0.1";
|
||||
local_s_address = "127.0.0.1";
|
||||
local_s_portc = 50001;
|
||||
remote_s_portc = 50000;
|
||||
local_s_portd = 50011;
|
||||
remote_s_portd = 50010;
|
||||
tr_s_preference = "nfapi";
|
||||
tr_n_preference = "local_RRC";
|
||||
scheduler_mode = "fairRR";
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config =
|
||||
{
|
||||
global_log_level ="warn";
|
||||
global_log_verbosity ="low";
|
||||
hw_log_level ="error";
|
||||
hw_log_verbosity ="low";
|
||||
phy_log_level ="error";
|
||||
phy_log_verbosity ="low";
|
||||
mac_log_level ="analysis";
|
||||
mac_log_verbosity ="low";
|
||||
rlc_log_level ="warn";
|
||||
rlc_log_verbosity ="low";
|
||||
pdcp_log_level ="analysis";
|
||||
pdcp_log_verbosity ="low";
|
||||
rrc_log_level ="analysis";
|
||||
rrc_log_verbosity ="full";
|
||||
};
|
||||
252
ci-scripts/conf_files/firecell/proxy_rcc.band7.tm1.nfapi.conf
Normal file
252
ci-scripts/conf_files/firecell/proxy_rcc.band7.tm1.nfapi.conf
Normal file
@@ -0,0 +1,252 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 5;
|
||||
|
||||
plmn_list = ( { mcc = 320; mnc = 230; mnc_length = 3; } );
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "3GPP_eNODEB";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 50;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
pbch_repetition = "FALSE";
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -27;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
ue_TransmissionMode = 1;
|
||||
|
||||
//Parameters for SIB18
|
||||
rxPool_sc_CP_Len = "normal";
|
||||
rxPool_sc_Period = "sf40";
|
||||
rxPool_data_CP_Len = "normal";
|
||||
rxPool_ResourceConfig_prb_Num = 20;
|
||||
rxPool_ResourceConfig_prb_Start = 5;
|
||||
rxPool_ResourceConfig_prb_End = 44;
|
||||
rxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
rxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
rxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
/* rxPool_dataHoppingConfig_hoppingParameter = 0;
|
||||
rxPool_dataHoppingConfig_numSubbands = "ns1";
|
||||
rxPool_dataHoppingConfig_rbOffset = 0;
|
||||
rxPool_commTxResourceUC-ReqAllowed = "TRUE";
|
||||
*/
|
||||
// Parameters for SIB19
|
||||
discRxPool_cp_Len = "normal"
|
||||
discRxPool_discPeriod = "rf32"
|
||||
discRxPool_numRetx = 1;
|
||||
discRxPool_numRepetition = 2;
|
||||
discRxPool_ResourceConfig_prb_Num = 5;
|
||||
discRxPool_ResourceConfig_prb_Start = 3;
|
||||
discRxPool_ResourceConfig_prb_End = 21;
|
||||
discRxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
discRxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
discRxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.61.3";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
enable_measurement_reports = "no";
|
||||
|
||||
///X2
|
||||
enable_x2 = "yes";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.1";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "lo";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.1";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
ENB_IPV4_ADDRESS_FOR_X2C = "127.0.0.1";
|
||||
ENB_PORT_FOR_X2C = 36422; # Spec 36422
|
||||
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
# IP Address, port numbers and SSMode for System Simulator
|
||||
SSConfig = (
|
||||
{
|
||||
hostIp = "127.0.0.1"; #Host IP for System Simulator
|
||||
Sys_port = 7777; #Port Number for System Simulator Sys Port
|
||||
Srb_port = 7778; #Port Number for System Simulator Srb Port
|
||||
Vng_port = 7779; #Port Number for System Simulator VNG Port
|
||||
Vtp_port = 7780; #Port Number for System Simulator VTP Port
|
||||
SSMode = 2; #SSMode: 0 - eNB , 1- SYS_PORT test , 2- Only SRB_PORT test
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
local_s_if_name = "lo";
|
||||
remote_s_address = "127.0.0.1";
|
||||
local_s_address = "127.0.0.1";
|
||||
local_s_portc = 50001;
|
||||
remote_s_portc = 50000;
|
||||
local_s_portd = 50011;
|
||||
remote_s_portd = 50010;
|
||||
tr_s_preference = "nfapi";
|
||||
tr_n_preference = "local_RRC";
|
||||
scheduler_mode = "fairRR";
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config =
|
||||
{
|
||||
global_log_level ="info";
|
||||
hw_log_level ="info";
|
||||
phy_log_level ="info";
|
||||
mac_log_level ="info";
|
||||
rlc_log_level ="info";
|
||||
pdcp_log_level ="info";
|
||||
rrc_log_level ="info";
|
||||
};
|
||||
@@ -155,6 +155,8 @@ set (NFAPI_USER_DIR ${OPENAIR_DIR}/nfapi/oai_integration)
|
||||
set (OPENAIR1_DIR ${OPENAIR_DIR}/openair1)
|
||||
set (OPENAIR2_DIR ${OPENAIR_DIR}/openair2)
|
||||
set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
|
||||
set (SIDL_DIR ${OPENAIR_DIR}/openair3/SS/Sidl/lib)
|
||||
set (SIDL_CMPLR ${OPENAIR_DIR}/openair3/SS/Sidl/sidl)
|
||||
set (OPENAIR_TARGETS ${OPENAIR_DIR}/targets)
|
||||
set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
|
||||
set (OPENAIR_CMAKE ${OPENAIR_DIR}/cmake_targets)
|
||||
@@ -991,10 +993,12 @@ include_directories("${OPENAIR3_DIR}/NAS/COMMON/IES")
|
||||
include_directories("${OPENAIR3_DIR}/NAS/COMMON/UTIL")
|
||||
include_directories("${OPENAIR3_DIR}/SECU")
|
||||
include_directories("${OPENAIR3_DIR}/SCTP")
|
||||
include_directories("${OPENAIR3_DIR}/SS")
|
||||
include_directories("${OPENAIR3_DIR}/S1AP")
|
||||
include_directories("${OPENAIR2_DIR}/X2AP")
|
||||
include_directories("${OPENAIR2_DIR}/M2AP")
|
||||
include_directories("${OPENAIR2_DIR}/F1AP")
|
||||
include_directories("${OPENAIR3_DIR}/UDP")
|
||||
include_directories("${OPENAIR3_DIR}/ocp-gtpu")
|
||||
include_directories("${OPENAIR3_DIR}/M3AP")
|
||||
include_directories("${OPENAIR3_DIR}/MME_APP")
|
||||
@@ -2096,6 +2100,26 @@ set (MME_APP_SRC
|
||||
add_library(MME_APP ${MME_APP_SRC})
|
||||
add_dependencies(MME_APP rrc_flag s1ap_flag x2_flag m2_flag m3_flag)
|
||||
|
||||
#------------------------------------------------------
|
||||
include_directories (SIDL_SRC_DIR ${SIDL_CMPLR}/api)
|
||||
include_directories (SIDL_SRC_DIR ${SIDL_DIR}/acp/api)
|
||||
include_directories (SIDL_SRC_DIR ${SIDL_DIR}/adbg/api)
|
||||
include_directories (SIDL_SRC_DIR ${SIDL_DIR}/ser/api)
|
||||
set(SS_SRC
|
||||
${OPENAIR3_DIR}/SS/ss_eNB_port_man_task.c
|
||||
${OPENAIR3_DIR}/SS/ss_eNB_sys_task.c
|
||||
${OPENAIR3_DIR}/SS/ss_eNB_srb_task.c
|
||||
${OPENAIR3_DIR}/SS/ss_eNB_vng_task.c
|
||||
)
|
||||
file(GLOB ss_sidl ${SIDL_CMPLR}/src/*.c)
|
||||
file(GLOB ss_acp ${SIDL_DIR}/acp/src/*.c)
|
||||
file(GLOB ss_adbg ${SIDL_DIR}/adbg/src/*.c)
|
||||
file(GLOB ss_ser ${SIDL_DIR}/ser/src/*.c)
|
||||
|
||||
add_library(SS_SERVER ${ss_sidl} ${ss_acp} ${ss_adbg} ${ss_ser} ${SS_SRC})
|
||||
add_dependencies(SS_SERVER rrc_flag)
|
||||
#------------------------------------------------------
|
||||
|
||||
set(SCTP_SRC
|
||||
${OPENAIR3_DIR}/SCTP/sctp_common.c
|
||||
${OPENAIR3_DIR}/SCTP/sctp_eNB_task.c
|
||||
@@ -2104,6 +2128,9 @@ set(SCTP_SRC
|
||||
add_library(SCTP_CLIENT ${SCTP_SRC})
|
||||
add_dependencies(SCTP_CLIENT rrc_flag)
|
||||
|
||||
add_library(UDP ${OPENAIR3_DIR}/UDP/udp_eNB_task.c)
|
||||
add_dependencies(UDP rrc_flag)
|
||||
|
||||
set(NAS_SRC ${OPENAIR3_DIR}/NAS/)
|
||||
set(libnas_api_OBJS
|
||||
${NAS_SRC}COMMON/API/NETWORK/as_message.c
|
||||
@@ -2617,7 +2644,7 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
|
||||
|
||||
target_link_libraries (lte-softmodem
|
||||
-Wl,--start-group
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT SS_SERVER MME_APP UDP SCHED_LIB SCHED_RU_LIB
|
||||
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "RRC/LTE/rrc_defs.h"
|
||||
#include "RRC/NR/nr_rrc_defs.h"
|
||||
#include <openair3/ocp-gtpu/gtpv1u_eNB_task.h>
|
||||
|
||||
#include <openair3/SS/ss_config.h>
|
||||
|
||||
typedef struct {
|
||||
/// RAN context config file name
|
||||
@@ -112,6 +112,10 @@ typedef struct {
|
||||
pthread_mutex_t ru_mutex;
|
||||
/// condition variable for signaling setup completion of an RU
|
||||
pthread_cond_t ru_cond;
|
||||
/// SS Config variables
|
||||
struct ss_config_s ss;
|
||||
|
||||
RBConfig RB_Config[MAX_RBS];
|
||||
} RAN_CONTEXT_t;
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
@@ -465,6 +465,7 @@ int logInit (void)
|
||||
register_log_component("eRAL","",RAL_ENB);
|
||||
register_log_component("mRAL","",RAL_UE);
|
||||
register_log_component("ENB_APP","log",ENB_APP);
|
||||
register_log_component("ENB_SS","log",ENB_SS);
|
||||
register_log_component("MCE_APP","log",MCE_APP);
|
||||
register_log_component("MME_APP","log",MME_APP);
|
||||
register_log_component("FLEXRAN_AGENT","log",FLEXRAN_AGENT);
|
||||
|
||||
@@ -158,7 +158,7 @@ extern "C" {
|
||||
#define DEBUG_RLC (1<<13)
|
||||
#define DEBUG_DLSCH_DECOD (1<<14)
|
||||
#define UE_TIMING (1<<20)
|
||||
|
||||
#define DEBUG_ENB_SS (1<<21)
|
||||
|
||||
#define LOG_MASKMAP_INIT {\
|
||||
{"PRACH", DEBUG_PRACH},\
|
||||
@@ -177,6 +177,7 @@ extern "C" {
|
||||
{"RLC", DEBUG_RLC},\
|
||||
{"DLSCH_DECOD", DEBUG_DLSCH_DECOD},\
|
||||
{"UE_TIMING", UE_TIMING},\
|
||||
{"ENB_SS", DEBUG_ENB_SS},\
|
||||
{NULL,-1}\
|
||||
}
|
||||
|
||||
@@ -225,6 +226,7 @@ typedef enum {
|
||||
RAL_ENB,
|
||||
RAL_UE,
|
||||
ENB_APP,
|
||||
ENB_SS,
|
||||
MCE_APP,
|
||||
MME_APP,
|
||||
FLEXRAN_AGENT,
|
||||
@@ -284,6 +286,9 @@ typedef struct {
|
||||
char *filelog_name;
|
||||
uint64_t debug_mask;
|
||||
uint64_t dump_mask;
|
||||
uint16_t sfn;
|
||||
uint8_t sf;
|
||||
|
||||
} log_t;
|
||||
|
||||
|
||||
|
||||
@@ -609,6 +609,27 @@ ID = LEGACY_ENB_APP_TRACE
|
||||
GROUP = ALL:LEGACY_ENB_APP:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_ENB_SS_INFO
|
||||
DESC = ENB_SS legacy logs - info level
|
||||
GROUP = ALL:LEGACY_ENB_SS:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_ENB_SS_ERROR
|
||||
DESC = ENB_SS legacy logs - error level
|
||||
GROUP = ALL:LEGACY_ENB_SS:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_ENB_SS_WARNING
|
||||
DESC = ENB_SS legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_ENB_SS:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_ENB_SS_DEBUG
|
||||
DESC = ENB_SS legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_ENB_SS:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_ENB_SS_TRACE
|
||||
DESC = ENB_SS legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_ENB_SS:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_GNB_APP_INFO
|
||||
DESC = GNB_APP legacy logs - info level
|
||||
GROUP = ALL:LEGACY_GNB_APP:LEGACY_GROUP_INFO:LEGACY
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "openair2/COMMON/gtpv1_u_messages_def.h"
|
||||
#include "openair2/COMMON/flexran_messages_def.h"
|
||||
#include "openair2/COMMON/f1ap_messages_def.h"
|
||||
#include "openair2/COMMON/ss_messages_def.h"
|
||||
#include "openair2/COMMON/ngap_messages_def.h"
|
||||
#if ITTI_SIM
|
||||
#include "openair2/COMMON/itti_sim_messages_def.h"
|
||||
|
||||
@@ -228,6 +228,7 @@ typedef struct IttiMsgText_s {
|
||||
#include <openair2/COMMON/m2ap_messages_types.h>
|
||||
#include <openair2/COMMON/m3ap_messages_types.h>
|
||||
#include <openair2/COMMON/sctp_messages_types.h>
|
||||
#include <openair2/COMMON/ss_messages_types.h>
|
||||
#include <openair2/COMMON/udp_messages_types.h>
|
||||
#include <openair2/COMMON/gtpv1_u_messages_types.h>
|
||||
#include <openair2/COMMON/ngap_messages_types.h>
|
||||
@@ -325,6 +326,10 @@ void *rrc_enb_process_msg(void *);
|
||||
TASK_DEF(TASK_M3AP_MME, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_M3AP_MCE, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_SS_PORTMAN, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_SYS, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_SS_SRB, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_VNG, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_GNB_APP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_MCE_APP, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
@@ -339,6 +344,7 @@ void *rrc_enb_process_msg(void *);
|
||||
TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000,NULL, NULL)\
|
||||
TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000, NULL, NULL)\
|
||||
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200, NULL, NULL) \
|
||||
|
||||
@@ -269,6 +269,8 @@ typedef struct {
|
||||
int non_stop;
|
||||
int emulate_l1;
|
||||
int continuous_tx;
|
||||
// Mode of eNB operation 0: Normal eNB operation 1: SS mode
|
||||
uint8_t mode;
|
||||
} softmodem_params_t;
|
||||
|
||||
extern uint64_t get_softmodem_optmask(void);
|
||||
|
||||
@@ -54,6 +54,9 @@ MESSAGE_DEF(RRC_STATE_IND, MESSAGE_PRIORITY_MED, RrcStateInd,
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// eNB: ENB_APP -> RRC messages
|
||||
MESSAGE_DEF(RRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, RrcConfigurationReq, rrc_configuration_req)
|
||||
MESSAGE_DEF(RRC_RBLIST_CFG_REQ, MESSAGE_PRIORITY_MED, RrcRblistCfgReq, rrc_rblist_cfg_req)
|
||||
MESSAGE_DEF(RRC_UE_CAT_INFO, MESSAGE_PRIORITY_MED, rrcUECatInfo, rrc_ue_cat_info)
|
||||
MESSAGE_DEF(RRC_AS_SECURITY_CONFIG_REQ, MESSAGE_PRIORITY_MED, RrcAsSecurityConfigReq, rrc_as_security_config_req)
|
||||
MESSAGE_DEF(NBIOTRRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, NbIoTRrcConfigurationReq, nbiotrrc_configuration_req)
|
||||
MESSAGE_DEF(NRRRC_CONFIGURATION_REQ, MESSAGE_PRIORITY_MED, gNB_RrcConfigurationReq, nrrrc_configuration_req)
|
||||
|
||||
|
||||
@@ -43,6 +43,12 @@
|
||||
#include "NR_RACH-ConfigCommon.h"
|
||||
#include "NR_ServingCellConfigCommon.h"
|
||||
#include "NR_ServingCellConfig.h"
|
||||
#include "LTE_LogicalChannelConfig.h"
|
||||
#include "LTE_SecurityAlgorithmConfig.h"
|
||||
#include "LTE_CipheringAlgorithm-r12.h"
|
||||
|
||||
#define MAX_RBS (LTE_maxDRB + 3)
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// Messages for RRC logging
|
||||
#if defined(DISABLE_ITTI_XER_PRINT)
|
||||
@@ -67,6 +73,12 @@
|
||||
|
||||
#define RRC_CONFIGURATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_configuration_req
|
||||
|
||||
#define RRC_RBLIST_CFG_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_rblist_cfg_req
|
||||
|
||||
#define RRC_UE_CAT_INFO(mSGpTR) (mSGpTR)->ittiMsg.rrc_ue_cat_info
|
||||
|
||||
#define RRC_AS_SECURITY_CONFIG_REQ(mSGpTR) (mSGpTR)->ittiMsg.rrc_as_security_config_req
|
||||
|
||||
#define NBIOTRRC_CONFIGURATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nbiotrrc_configuration_req
|
||||
|
||||
#define NRRRC_CONFIGURATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nrrrc_configuration_req
|
||||
@@ -94,6 +106,114 @@
|
||||
#define NAS_OAI_TUN_NSA(mSGpTR) (mSGpTR)->ittiMsg.nas_oai_tun_nsa
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
enum SecurityAct_Type_e {
|
||||
Pdcp_Count_Srb = 0,
|
||||
Pdcp_Count_DrbLongSQN = 1,
|
||||
Pdcp_Count_DrbShortSQN = 2,
|
||||
NrPdcp_Count_Srb = 3,
|
||||
NrPdcp_Count_DrbSQN12 = 4,
|
||||
NrPdcp_Count_DrbSQN18 = 5,
|
||||
};
|
||||
|
||||
typedef enum SecurityAct_Type_e SecurityAct_Type_e;
|
||||
|
||||
typedef struct ActTime_Type_s {
|
||||
SecurityAct_Type_e format;
|
||||
uint32_t sqn;
|
||||
}ActTime_Type;
|
||||
|
||||
typedef struct SecurityActTimeType_s {
|
||||
uint8_t rb_id;
|
||||
ActTime_Type UL;
|
||||
ActTime_Type DL;
|
||||
}SecurityActTimeType;
|
||||
|
||||
typedef struct SecurityActTimeList_s {
|
||||
int size;
|
||||
SecurityActTimeType SecurityActTime[MAX_RBS];
|
||||
}SecurityActTimeList;
|
||||
|
||||
typedef struct AS_IntegrityInfo_s {
|
||||
e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm;
|
||||
uint8_t *kRRCint;
|
||||
SecurityActTimeList ActTimeList;
|
||||
}AS_IntegrityInfo;
|
||||
|
||||
typedef struct AS_CipheringInfo_s {
|
||||
LTE_CipheringAlgorithm_r12_t ciphering_algorithm;
|
||||
uint8_t *kRRCenc;
|
||||
uint8_t *kUPenc;
|
||||
SecurityActTimeList ActTimeList;
|
||||
}AS_CipheringInfo;
|
||||
|
||||
typedef struct RrcAsSecurityConfigReq_s {
|
||||
bool isIntegrityInfroPresent;
|
||||
AS_IntegrityInfo Integrity;
|
||||
bool isCipheringInfoPresent;
|
||||
AS_CipheringInfo Ciphering;
|
||||
int rnti;
|
||||
}RrcAsSecurityConfigReq;
|
||||
|
||||
enum ue_CategoryDL_v1310_e {
|
||||
ue_CategoryDL_v1310_e_n17 = 0,
|
||||
ue_CategoryDL_v1310_e_m1 = 1,
|
||||
};
|
||||
|
||||
typedef enum ue_CategoryDL_v1310_e ue_CategoryDL_v1310_e;
|
||||
|
||||
enum ue_CategoryDL_v1350_e {
|
||||
ue_CategoryDL_v1350_e_oneBis = 0,
|
||||
};
|
||||
|
||||
typedef enum ue_CategoryDL_v1350_e ue_CategoryDL_v1350_e;
|
||||
|
||||
typedef struct rrcUECatInfo_s {
|
||||
uint8_t ue_Category;
|
||||
bool is_ue_Category_V1020_present;
|
||||
uint8_t ue_Category_V1020;
|
||||
bool is_ue_Category_v1170_present;
|
||||
uint8_t ue_Category_v1170;
|
||||
bool is_ue_Category_v11a0_present;
|
||||
uint8_t ue_Category_v11a0;
|
||||
bool is_ue_Category_v1250_present;
|
||||
uint8_t ue_Category_v1250;
|
||||
bool is_ue_CategoryDL_r12_present;
|
||||
uint8_t ue_CategoryDL_r12;
|
||||
bool is_ue_CategoryDL_v1260_present;
|
||||
uint8_t ue_CategoryDL_v1260;
|
||||
bool is_ue_CategoryDL_v1310_present;
|
||||
ue_CategoryDL_v1310_e ue_CategoryDL_v1310;
|
||||
bool is_ue_CategoryDL_v1330_present;
|
||||
uint8_t ue_CategoryDL_v1330;
|
||||
bool is_ue_CategoryDL_v1350_present;
|
||||
ue_CategoryDL_v1350_e ue_CategoryDL_v1350;
|
||||
bool is_ue_CategoryDL_v1460_present;
|
||||
uint8_t ue_CategoryDL_v1460;
|
||||
}rrcUECatInfo;
|
||||
|
||||
typedef struct RadioBearerConfig_s {
|
||||
bool isPDCPConfigValid;
|
||||
bool isRLCConfigValid;
|
||||
bool isLogicalChannelIdValid;
|
||||
bool isMacConfigValid;
|
||||
bool isDiscardULDataValid;
|
||||
LTE_PDCP_Config_t Pdcp;
|
||||
LTE_RLC_Config_t Rlc;
|
||||
long LogicalChannelId;
|
||||
LTE_LogicalChannelConfig_t Mac;
|
||||
bool DiscardULData;
|
||||
}RadioBearerConfig;
|
||||
|
||||
typedef struct rb_info_s {
|
||||
uint8_t RbId;
|
||||
RadioBearerConfig RbConfig;
|
||||
} rb_info;
|
||||
|
||||
typedef struct RrcRblistCfgReq_s {
|
||||
int rb_count;
|
||||
rb_info rb_list[MAX_RBS];
|
||||
} RrcRblistCfgReq;
|
||||
|
||||
typedef struct RrcStateInd_s {
|
||||
Rrc_State_t state;
|
||||
Rrc_Sub_State_t sub_state;
|
||||
@@ -329,6 +449,12 @@ typedef struct RrcConfigurationReq_s {
|
||||
long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
|
||||
//Nr secondary cell group SSB central frequency (for ENDC NSA)
|
||||
int nr_scg_ssb_freq;
|
||||
|
||||
//SS: Cell Config
|
||||
long q_RxLevMin;
|
||||
long q_QualMin;
|
||||
long p_MaxEUTRA;
|
||||
|
||||
} RrcConfigurationReq;
|
||||
|
||||
#define MAX_NUM_NBIOT_CELEVELS 3
|
||||
|
||||
38
openair2/COMMON/ss_messages_def.h
Normal file
38
openair2/COMMON/ss_messages_def.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
MESSAGE_DEF(SS_GET_TIM_INFO, MESSAGE_PRIORITY_MED, ss_get_timinfo_t , ss_get_timinfo)
|
||||
MESSAGE_DEF(SS_SET_TIM_INFO, MESSAGE_PRIORITY_MED, ss_set_timinfo_t , ss_set_timinfo)
|
||||
|
||||
MESSAGE_DEF(SS_RRC_PDU_REQ, MESSAGE_PRIORITY_MED, ss_rrc_pdu_req_t , ss_rrc_pdu_req)
|
||||
MESSAGE_DEF(SS_RRC_PDU_IND, MESSAGE_PRIORITY_MED, ss_rrc_pdu_ind_t , ss_rrc_pdu_ind)
|
||||
MESSAGE_DEF(SS_UPD_TIM_INFO, MESSAGE_PRIORITY_MED, ss_upd_timinfo_t , ss_upd_timinfo)
|
||||
MESSAGE_DEF(SS_SYS_PORT_MSG_IND, MESSAGE_PRIORITY_MED, ss_sys_port_msg_ind_t , ss_sys_port_msg_ind)
|
||||
MESSAGE_DEF(SS_SYS_PORT_MSG_CNF, MESSAGE_PRIORITY_MED, ss_sys_port_msg_cnf_t , ss_sys_port_msg_cnf)
|
||||
|
||||
MESSAGE_DEF(SS_GET_PDCP_CNT, MESSAGE_PRIORITY_MED, ss_get_pdcp_cnt_t , ss_get_pdcp_cnt)
|
||||
MESSAGE_DEF(SS_SET_PDCP_CNT, MESSAGE_PRIORITY_MED, ss_set_pdcp_cnt_t , ss_set_pdcp_cnt)
|
||||
MESSAGE_DEF(SS_REQ_PDCP_CNT, MESSAGE_PRIORITY_MED, ss_req_pdcp_cnt_t , ss_req_pdcp_cnt)
|
||||
|
||||
MESSAGE_DEF(SS_VNG_PROXY_REQ, MESSAGE_PRIORITY_MED, ss_vng_proxy_req_t , ss_vng_proxy_req)
|
||||
MESSAGE_DEF(SS_VNG_PROXY_RESP, MESSAGE_PRIORITY_MED, ss_vng_proxy_resp_t , ss_vng_proxy_resp)
|
||||
|
||||
MESSAGE_DEF(SS_SS_PAGING_IND, MESSAGE_PRIORITY_MED, ss_paging_ind_t , ss_paging_ind)
|
||||
199
openair2/COMMON/ss_messages_types.h
Normal file
199
openair2/COMMON/ss_messages_types.h
Normal file
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* 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 SS_MESSAGES_TYPES_H_
|
||||
#define SS_MESSAGES_TYPES_H_
|
||||
|
||||
#define SS_SYS_PORT_MSG_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_sys_port_msg_ind
|
||||
#define SS_SYS_PORT_MSG_CNF(mSGpTR) (mSGpTR)->ittiMsg.ss_sys_port_msg_cnf
|
||||
|
||||
#define SS_GET_TIM_INFO(mSGpTR) (mSGpTR)->ittiMsg.ss_get_timinfo
|
||||
#define SS_SET_TIM_INFO(mSGpTR) (mSGpTR)->ittiMsg.ss_set_timinfo
|
||||
#define SS_UPD_TIM_INFO(mSGpTR) (mSGpTR)->ittiMsg.ss_upd_timinfo
|
||||
#define SS_CELL_ATTN_LIST_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_cell_attn_list_ind
|
||||
#define SS_CELL_ATTN_LIST_CNF(mSGpTR) (mSGpTR)->ittiMsg.ss_cell_attn_list_cnf
|
||||
|
||||
/** PDCP Count */
|
||||
#define SS_REQ_PDCP_CNT(mSGpTR) (mSGpTR)->ittiMsg.ss_req_pdcp_cnt
|
||||
#define SS_GET_PDCP_CNT(mSGpTR) (mSGpTR)->ittiMsg.ss_get_pdcp_cnt
|
||||
#define SS_SET_PDCP_CNT(mSGpTR) (mSGpTR)->ittiMsg.ss_set_pdcp_cnt
|
||||
|
||||
#define SS_RRC_PDU_REQ(mSGpTR) (mSGpTR)->ittiMsg.ss_rrc_pdu_req
|
||||
#define SS_RRC_PDU_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_rrc_pdu_ind
|
||||
#define SS_SYS_PROXY_MSG_CNF(mSGpTR) (mSGpTR)->ittiMsg.udp_data_ind
|
||||
#define SS_PAGING_IND(mSGpTR) (mSGpTR)->ittiMsg.ss_paging_ind
|
||||
|
||||
|
||||
/** VNG */
|
||||
#define SS_VNG_PROXY_REQ(mSGpTR) (mSGpTR)->ittiMsg.ss_vng_proxy_req
|
||||
#define SS_VNG_PROXY_RESP(mSGpTR) (mSGpTR)->ittiMsg.ss_vng_proxy_resp
|
||||
|
||||
#define SDU_SIZE (512)
|
||||
|
||||
/** PORTMAN */
|
||||
typedef struct ss_sys_port_msg_ind {
|
||||
struct SYSTEM_CTRL_REQ* req;
|
||||
int userId;
|
||||
} ss_sys_port_msg_ind_t;
|
||||
|
||||
typedef struct ss_sys_port_msg_cnf {
|
||||
struct SYSTEM_CTRL_CNF* cnf;
|
||||
} ss_sys_port_msg_cnf_t;
|
||||
|
||||
/** SYS */
|
||||
typedef struct ss_set_timinfo_s {
|
||||
uint16_t sfn;
|
||||
uint8_t sf;
|
||||
} ss_set_timinfo_t;
|
||||
|
||||
typedef ss_set_timinfo_t ss_upd_timinfo_t;
|
||||
|
||||
typedef struct ss_get_timinfo_s {
|
||||
uint8_t EnquireTiming;
|
||||
} ss_get_timinfo_t;
|
||||
|
||||
typedef struct ss_cell_attn_list_ind {
|
||||
uint16_t cell_id;
|
||||
uint8_t attn; /*!< \brief 0xFF -> Off */
|
||||
ss_set_timinfo_t time_info; /*!< \brief Optional.*/
|
||||
} ss_cell_attn_list_ind_t;
|
||||
|
||||
typedef struct ss_cell_attn_list_cnf {
|
||||
uint8_t status;
|
||||
} ss_cell_attn_list_cnf_t;
|
||||
|
||||
enum PdcpCountFormat_Type_e {
|
||||
E_PdcpCount_Srb = 0,
|
||||
E_PdcpCount_DrbLongSQN = 1,
|
||||
E_PdcpCount_DrbShortSQN = 2,
|
||||
E_NrPdcpCount_Srb = 3,
|
||||
E_NrPdcpCount_DrbSQN12 = 4,
|
||||
E_NrPdcpCount_DrbSQN18 = 5,
|
||||
};
|
||||
|
||||
typedef enum PdcpCountFormat_Type_e PdcpCountFormat_Type_e;
|
||||
|
||||
typedef struct pdcp_count_rb_s {
|
||||
uint8_t rb_id;
|
||||
uint8_t is_srb;
|
||||
PdcpCountFormat_Type_e ul_format;
|
||||
PdcpCountFormat_Type_e dl_format;
|
||||
uint32_t ul_count;
|
||||
uint32_t dl_count;
|
||||
} pdcp_count_rb_t;
|
||||
|
||||
typedef struct ss_set_pdcp_cnt_s {
|
||||
pdcp_count_rb_t rb_list[MAX_RBS];
|
||||
} ss_set_pdcp_cnt_t;
|
||||
|
||||
typedef struct ss_get_pdcp_cnt_s {
|
||||
//struct PdcpCountInfo_Type_Get_Dynamic Get;
|
||||
uint32_t size;
|
||||
pdcp_count_rb_t rb_info[MAX_RBS];
|
||||
} ss_get_pdcp_cnt_t;
|
||||
|
||||
typedef struct ss_req_pdcp_cnt_s {
|
||||
rnti_t rnti;
|
||||
uint8_t rb_id;
|
||||
} ss_req_pdcp_cnt_t;
|
||||
|
||||
/** SRB */
|
||||
typedef struct ss_rrc_pdu_req_s {
|
||||
uint8_t srb_id;
|
||||
uint32_t sdu_size;
|
||||
uint8_t sdu[SDU_SIZE];
|
||||
uint16_t rnti;
|
||||
} ss_rrc_pdu_req_t;
|
||||
|
||||
typedef struct ss_rrc_pdu_ind_s {
|
||||
uint8_t srb_id;
|
||||
uint32_t sdu_size;
|
||||
uint8_t sdu[SDU_SIZE];
|
||||
uint16_t rnti;
|
||||
frame_t frame; /*!< \brief LTE frame number.*/
|
||||
sub_frame_t subframe; /*!< \brief LTE sub frame number.*/
|
||||
} ss_rrc_pdu_ind_t;
|
||||
|
||||
/** VNG */
|
||||
|
||||
typedef struct ss_vng_proxy_resp_s {
|
||||
uint8_t cell_id; /** Cell_id of the cell for
|
||||
which VNG request came */
|
||||
uint32_t sfn_sf; /** Time at which response was
|
||||
received from Proxy in the SYS task */
|
||||
uint8_t status; /** 0 Success: 1 Failure */
|
||||
} ss_vng_proxy_resp_t;
|
||||
|
||||
typedef enum carrierBandwidthEUTRA_dl_Bandwidth_e {
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_n6 = 0,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_n15 = 1,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_n25 = 2,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_n50 = 3,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_n75 = 4,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_n100 = 5,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_spare10 = 6,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_spare9 = 7,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_spare8 = 8,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_spare7 = 9,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_spare6 = 10,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_spare5 = 11,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_spare4 = 12,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_spare3 = 13,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_spare2 = 14,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_spare1 = 15,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_NONE = 16,
|
||||
carrierBandwidthEUTRA_dl_Bandwidth_e_INVALID = 0xFF
|
||||
} Dl_Bw_e;
|
||||
|
||||
typedef enum VngCmd_e {
|
||||
INVALID = 0,
|
||||
CONFIGURE = 1,
|
||||
ACTIVATE,
|
||||
DEACTIVATE
|
||||
} VngCmd;
|
||||
|
||||
typedef struct ss_vng_proxy_req_s {
|
||||
uint16_t cell_id; /** PCI of the cell for
|
||||
which VNG request came */
|
||||
Dl_Bw_e bw; /** DL Bandwidth enum (ASN1) */
|
||||
int32_t Noc_level; /** 0 Success: 1 Failure */
|
||||
VngCmd cmd; /** CONF, ACTV, DEACTV */
|
||||
} ss_vng_proxy_req_t;
|
||||
|
||||
|
||||
typedef struct ss_paging_identity_s {
|
||||
/* UE identity index value.
|
||||
* Specified in 3GPP TS 36.304
|
||||
*/
|
||||
unsigned ue_index_value:10;
|
||||
|
||||
/* UE paging identity */
|
||||
ue_paging_identity_t ue_paging_identity;
|
||||
|
||||
/* Indicates origin of paging */
|
||||
cn_domain_t cn_domain;
|
||||
}ss_paging_identity_t;
|
||||
typedef struct ss_paging_ind_s {
|
||||
uint16_t sfn;
|
||||
uint8_t sf;
|
||||
ss_paging_identity_t *paging_recordList;
|
||||
} ss_paging_ind_t;
|
||||
#endif /* SS_MESSAGES_TYPES_H_ */
|
||||
@@ -204,6 +204,22 @@ void RCconfig_L1(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void RCconfig_ssparam(void) {
|
||||
paramdef_t SSConfig_Params[] = SSPARAMS_DESC;
|
||||
paramlist_def_t SSConfig_ParamList = {CONFIG_SS,NULL,0};
|
||||
config_getlist( &SSConfig_ParamList,SSConfig_Params,sizeof(SSConfig_Params)/sizeof(paramdef_t), NULL);
|
||||
|
||||
if ( SSConfig_ParamList.numelt > 0) {
|
||||
RC.ss.hostIp = strdup(*(SSConfig_ParamList.paramarray[0][CONFIG_SS_HOSTIP_IDX].strptr));
|
||||
RC.ss.Sysport = *(SSConfig_ParamList.paramarray[0][CONFIG_SS_SYSPORT_IDX].iptr);
|
||||
RC.ss.Srbport = *(SSConfig_ParamList.paramarray[0][CONFIG_SS_SRBPORT_IDX].iptr);
|
||||
RC.ss.Vngport = *(SSConfig_ParamList.paramarray[0][CONFIG_SS_VNGPORT_IDX].iptr);
|
||||
get_softmodem_params()->mode = *(SSConfig_ParamList.paramarray[0][CONFIG_SS_MODE_IDX].iptr);
|
||||
}
|
||||
LOG_A(ENB_APP,"SS_Config:SSMode %d, hostIp=%s, Sysport=%d, Srbport=%d Vngport=%d\n",
|
||||
get_softmodem_params()->mode, RC.ss.hostIp,RC.ss.Sysport,RC.ss.Srbport,RC.ss.Vngport);
|
||||
}
|
||||
|
||||
void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]) {
|
||||
int j;
|
||||
paramdef_t MacRLC_Params[] = MACRLCPARAMS_DESC;
|
||||
@@ -3206,6 +3222,7 @@ void read_config_and_init(void) {
|
||||
RCconfig_L1();
|
||||
LOG_I(PHY, "%s() RC.nb_L1_inst: %d\n", __FUNCTION__, RC.nb_L1_inst);
|
||||
RCconfig_macrlc(macrlc_has_f1);
|
||||
RCconfig_ssparam();
|
||||
LOG_I(MAC, "%s() RC.nb_macrlc_inst: %d\n", __FUNCTION__, RC.nb_macrlc_inst);
|
||||
|
||||
if (RC.nb_L1_inst > 0)
|
||||
|
||||
@@ -102,6 +102,7 @@ typedef struct ru_config_s {
|
||||
|
||||
extern void RCconfig_flexran(void);
|
||||
extern void RCconfig_L1(void);
|
||||
extern void RCconfig_ssparam(void);
|
||||
extern void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]);
|
||||
extern void UE_config_stub_pnf(void);
|
||||
extern int RCconfig_gtpu(void );
|
||||
|
||||
@@ -350,6 +350,28 @@ typedef enum {
|
||||
}
|
||||
|
||||
|
||||
/* SS configuration */
|
||||
|
||||
#define CONFIG_SS "SSConfig"
|
||||
#define CONFIG_SS_HOSTIP "hostIp"
|
||||
#define CONFIG_SS_SYSPORT "Sys_port"
|
||||
#define CONFIG_SS_SRBPORT "Srb_port"
|
||||
#define CONFIG_SS_VNGPORT "Vng_port"
|
||||
#define CONFIG_SS_MODE "SSMode"
|
||||
|
||||
#define CONFIG_SS_HOSTIP_IDX 0
|
||||
#define CONFIG_SS_SYSPORT_IDX 1
|
||||
#define CONFIG_SS_SRBPORT_IDX 2
|
||||
#define CONFIG_SS_VNGPORT_IDX 3
|
||||
#define CONFIG_SS_MODE_IDX 4
|
||||
|
||||
#define SSPARAMS_DESC { \
|
||||
{CONFIG_SS_HOSTIP , "SS Host IP", 0, uptr:NULL, defstrval:"0.0.0.0", TYPE_STRING, 0}, \
|
||||
{CONFIG_SS_SYSPORT , "SS Sys Port", 0, uptr:NULL, defintval:7777, TYPE_UINT, 0}, \
|
||||
{CONFIG_SS_SRBPORT , "SS SRB Port", 0, uptr:NULL, defintval:7778, TYPE_UINT, 0}, \
|
||||
{CONFIG_SS_VNGPORT , "SS VNG Port", 0, uptr:NULL, defintval:7779, TYPE_UINT, 0}, \
|
||||
{CONFIG_SS_MODE , "SS Mode", 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
|
||||
}
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define ENB_CONFIG_STRING_MBMS_CONFIGURATION_DATA_LIST "mbms_configuration_data_list"
|
||||
|
||||
|
||||
@@ -754,7 +754,6 @@ typedef struct {
|
||||
uint32_t sizeof_paging[MAX_MOBILES_PER_ENB];
|
||||
} rrc_eNB_carrier_data_t;
|
||||
|
||||
|
||||
typedef struct eNB_RRC_INST_s {
|
||||
/// southbound midhaul configuration
|
||||
ngran_node_t node_type;
|
||||
|
||||
@@ -40,6 +40,6 @@
|
||||
#include "mme_app_messages_types.h"
|
||||
#include "m2ap_messages_types.h"
|
||||
#include "ngap_messages_types.h"
|
||||
|
||||
#include "ss_messages_types.h"
|
||||
|
||||
#endif /* MESSAGES_TYPES_H_ */
|
||||
|
||||
325
openair3/SS/Sidl/lib/acp/api/acp.h
Normal file
325
openair3/SS/Sidl/lib/acp/api/acp.h
Normal file
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// System includes
|
||||
#include <stdbool.h>
|
||||
|
||||
// Internal includes
|
||||
#include "SidlCompiler.h"
|
||||
#include "acpMsgIds.h"
|
||||
#include "acpMem.h"
|
||||
#include "acpSocket.h"
|
||||
#include "acpInternal.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
/** Defines MAX ACP context quantity. */
|
||||
#define ACP_MAX_CTX_QTY 4
|
||||
|
||||
/** Defines MAX peers quantity. */
|
||||
#define ACP_MAX_PEER_QTY 5
|
||||
|
||||
/** Defines ACP Context. */
|
||||
typedef void* acpCtx_t;
|
||||
|
||||
/** Defines the API table for registration */
|
||||
struct acpMsgTable {
|
||||
/** Service name */
|
||||
const char* name;
|
||||
/** User ID */
|
||||
int userId;
|
||||
};
|
||||
|
||||
/** Defines ACP Header size. */
|
||||
#define ACP_HEADER_SIZE 16
|
||||
|
||||
/** This message is received upon TCP connection establishment with server.
|
||||
* It provides the list of services supported by server.
|
||||
*/
|
||||
#define ACP_SERVICE_PUSH_TYPE 0xFFFFFFFF
|
||||
|
||||
/** This message may be received when server sends KEEPALIVE. */
|
||||
#define ACP_KEEPALIVE_HANDLE 0xAAAAAAAA
|
||||
|
||||
/** Update ACP context from ACP_SERVICE_PUSH_TYPE message content.
|
||||
* Note: ACP_SERVICE_PUSH_TYPE will be received twice. First time upon TCP connection establishment
|
||||
* and later when the client links to a given device using internal::ConnectToMs message.
|
||||
*
|
||||
* @param[in] ctx Context to updaten, if NULL new context will
|
||||
* @param[in] size Total message size (header + payload)
|
||||
* @param[in] buffer Total message buffer
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpUpdateCtx(acpCtx_t ctx, size_t size, const unsigned char* buffer);
|
||||
|
||||
/** Creates an ACP context.
|
||||
*
|
||||
* @param[out] ctx ACP Context
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpCreateCtx(acpCtx_t* ctx);
|
||||
|
||||
/** Deletes a given ACP context.
|
||||
*
|
||||
* @param[in] ctx ACP context
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpDeleteCtx(acpCtx_t ctx);
|
||||
|
||||
/** Checks if the connection to the device is completed.
|
||||
*
|
||||
* @param[in] ctx ACP context
|
||||
* @return true if connected, false otherwise
|
||||
*/
|
||||
bool acpIsConnected(acpCtx_t ctx);
|
||||
|
||||
/** Returns SIDL status from the response message header.
|
||||
*
|
||||
* @param[in] size It should be equal to ACP_HEADER_SIZE
|
||||
* @param[in] buffer Input header message buffer
|
||||
* @param[out] sidlStatus SIDL status
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpGetMsgSidlStatus(size_t size, const unsigned char* buffer, SidlStatus* sidlStatus);
|
||||
|
||||
/** Returns message length from header buffer.
|
||||
* This is used after the read of ACP header to get the remaining bytes quantity to read for the
|
||||
* current message.
|
||||
*
|
||||
* @param[in] size It should be equal to ACP_HEADER_SIZE
|
||||
* @param[in] buffer Input header message buffer
|
||||
* @return Message length or a negative error code
|
||||
*/
|
||||
int acpGetMsgLength(size_t size, unsigned char* buffer);
|
||||
|
||||
/** Returns message ID.
|
||||
*
|
||||
* @param[in] ctx ACP context
|
||||
* @param[in] size Total message size (header + payload)
|
||||
* @param[in] buffer Total message buffer
|
||||
* @return User id for the message, or a negative error code
|
||||
*/
|
||||
int acpGetMsgId(acpCtx_t ctx, size_t size, const unsigned char* buffer);
|
||||
|
||||
/** Returns message ID.
|
||||
*
|
||||
* @param[in] size It should be equal to ACP_HEADER_SIZE
|
||||
* @param[in] buffer Input header message buffer
|
||||
* @param[out] localMsgId Local message id
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpGetMsgLocalId(size_t size, const unsigned char* buffer, enum acpMsgLocalId* localMsgId);
|
||||
|
||||
/** Reads the next message on the context socket and returns the message ID.
|
||||
*
|
||||
* @param[in] ctx ACP context
|
||||
* @param[in,out] size Buffer size, and received size on output
|
||||
* @param[out] buffer Buffer used for received data
|
||||
* @return User id for the message, 0 on no message (timeout), or a negative error code on failure
|
||||
*/
|
||||
int acpRecvMsg(acpCtx_t ctx, size_t* size, unsigned char* buffer);
|
||||
|
||||
/** Sends the message on the context socket.
|
||||
*
|
||||
* @param[in] ctx ACP context
|
||||
* @param[in] size Buffer size
|
||||
* @param[in] buffer Buffer used for sent data
|
||||
* @return 0 on success, or a negative error code on failure
|
||||
*/
|
||||
int acpSendMsg(acpCtx_t ctx, size_t size, const unsigned char* buffer);
|
||||
|
||||
/** Memory management callbacks
|
||||
* Note: NOT called for marshalling / demarshalling usage.
|
||||
*/
|
||||
typedef void* (*acpMalloc_t)(size_t size);
|
||||
typedef void (*acpFree_t)(void* ptr);
|
||||
|
||||
/** Module initialization.
|
||||
* Shall be called once.
|
||||
* Alloc/release callbacks shall be supplied to use in acpMalloc/acpFree.
|
||||
* Internally acpMalloc/acpFree are used only in context creation and during connection to server.
|
||||
* The timeout argument specifies the block interval on socket operations.
|
||||
*
|
||||
* @param[in] alloc Memory allocation callback
|
||||
* @param[in] release Memory release callback
|
||||
* @param[in] socketTimeout Timeout on socket, with value in milli-seconds
|
||||
*/
|
||||
void acpInit(acpMalloc_t alloc, acpFree_t release, MSec_t socketTimeout);
|
||||
|
||||
/** Connects to server.
|
||||
* Context should be allocated with acpCreateCtx.
|
||||
*
|
||||
* @param[in] ctx ACP Context
|
||||
* @param[in] ipaddr Server ip address
|
||||
* @param[in] port Server TCP port
|
||||
* @param[in] aSize Arena size
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpClientInit(acpCtx_t ctx, IpAddress_t ipaddr, int port, size_t aSize);
|
||||
|
||||
/** Connects to server.
|
||||
* Allocates the context with registering to requested notifications.
|
||||
*
|
||||
* @param[in] ipaddr Server ip address
|
||||
* @param[in] port Server TCP port
|
||||
* @param[in] msgTable Requested service responses/notifications to register, last element should be with name==NULL
|
||||
* @param[in] aSize Arena size
|
||||
* @param[out] ctx ACP Context
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpClientInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable* msgTable, size_t aSize, acpCtx_t* ctx);
|
||||
|
||||
/** Runs server.
|
||||
* Context should be allocated with acpCreateCtx.
|
||||
*
|
||||
* @param[in] ctx ACP Context
|
||||
* @param[in] ipaddr Server ip address
|
||||
* @param[in] port Server TCP port
|
||||
* @param[in] aSize Arena size
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpServerInit(acpCtx_t ctx, IpAddress_t ipaddr, int port, size_t aSize);
|
||||
|
||||
/** Runs server.
|
||||
* Allocates the context with registering to requested notifications.
|
||||
*
|
||||
* @param[in] ipaddr Server ip address
|
||||
* @param[in] port Server TCP port
|
||||
* @param[in] msgTable Requested service responses/notifications to register, last element should be with name==NULL
|
||||
* @param[in] aSize Arena size
|
||||
* @param[out] ctx ACP Context
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable* msgTable, size_t aSize, acpCtx_t* ctx);
|
||||
|
||||
/** Closes the socket from the context,
|
||||
* an ACP context is still valid after call.
|
||||
*
|
||||
* @param[in] ctx ACP Context
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpClose2(acpCtx_t ctx);
|
||||
|
||||
/** Closes the socket from the context,
|
||||
* and deletes a given ACP context.
|
||||
*
|
||||
* @param[in] ctx ACP Context
|
||||
* @return 0 on success, or an error code on failure.
|
||||
*/
|
||||
int acpClose(acpCtx_t ctx);
|
||||
|
||||
/** Gets socket fd from the context.
|
||||
*
|
||||
* @param[in] ctx ACP Context
|
||||
* @return socket fd
|
||||
*/
|
||||
int acpGetSocketFd(acpCtx_t ctx);
|
||||
|
||||
/** Sets socket fd to the context.
|
||||
* Actually should not be used, since the socket fd is managed by ACP library.
|
||||
*
|
||||
* @param[in] ctx ACP Context
|
||||
* @param[in] socketfd Socket fd
|
||||
*/
|
||||
void acpSetSocketFd(acpCtx_t ctx, int socketfd);
|
||||
|
||||
/** Gets last peer socket fd from the context, who sent the message.
|
||||
*
|
||||
* @param[in] ctx ACP Context
|
||||
* @return peer socket fd
|
||||
*/
|
||||
int acpGetLastPeerSocketFd(acpCtx_t ctx);
|
||||
|
||||
/** Sets last peer socket fd to the context.
|
||||
* Actually should not be used, since the peer socket fd is managed by ACP library.
|
||||
*
|
||||
* @param[in] ctx ACP Context
|
||||
* @param[in] socketfd Socket fd
|
||||
*/
|
||||
void acpSetLastPeerSocketFd(acpCtx_t ctx, int socketfd);
|
||||
|
||||
/** Gets socket reception timeout, passed as parameter to acpInit.
|
||||
*
|
||||
* @return socketTimeout with value in milli-seconds
|
||||
*/
|
||||
MSec_t acpGetSocketTimeout(void);
|
||||
|
||||
/** Registers the user id associated to a named service/notification.
|
||||
*
|
||||
* @param[in] ctx ACP Context
|
||||
* @param[in] name Service/Notification name
|
||||
* @param[in] userMsgId User message ID
|
||||
* @return negative value for an unsupported name, and 0 on success
|
||||
*/
|
||||
int acpSetMsgId(acpCtx_t ctx, const char* name, int userMsgId);
|
||||
|
||||
/** Registers the user id associated to service/notification local ID.
|
||||
*
|
||||
* @param[in] ctx ACP Context
|
||||
* @param[in] localMsgId Service/Notification local ID
|
||||
* @param[in] userMsgId User message ID
|
||||
* @return negative value for an unsupported local ID, and 0 on success
|
||||
*/
|
||||
int acpSetMsgIdFromLocalId(acpCtx_t ctx, enum acpMsgLocalId localMsgId, int userMsgId);
|
||||
|
||||
/** Returns message name (for debug).
|
||||
*
|
||||
* @param[in] size It should be equal to ACP_HEADER_SIZE
|
||||
* @param[in] buffer Input header message buffer
|
||||
* @return Service name
|
||||
*/
|
||||
const char* acpGetMsgName(size_t size, const unsigned char* buffer);
|
||||
|
||||
/** Defines helper to bind message to user id. */
|
||||
#define ASC_SET_MSG_ID(cTX, mSG, uID) acpSetMsgIdFromLocalId((cTX), ACP_LID_##mSG, (uID))
|
||||
|
||||
// #define ASC_SET_MSG_ID(cTX, mSG, uID) acpSetMsgId((cTX), #mSG, (uID))
|
||||
|
||||
/** Defines error codes. */
|
||||
enum acpErrorCode {
|
||||
/** API called with invalid context. */
|
||||
ACP_ERR_INVALID_CTX = 2,
|
||||
/** Invalid ACP header. */
|
||||
ACP_ERR_INVALID_HEADER,
|
||||
/** Socket connection failure. */
|
||||
ACP_ERR_SOCKCONN_ABORTED,
|
||||
/** Socket read/write failure. */
|
||||
ACP_ERR_SOCK_ERROR,
|
||||
/** Socket read/write timeout. */
|
||||
ACP_ERR_SOCK_TIMEOUT,
|
||||
/** Unknown service name. */
|
||||
ACP_ERR_UNKNOWN_SERVICE_NAME,
|
||||
/** Service not mapped to user id. */
|
||||
ACP_ERR_SERVICE_NOT_MAPPED,
|
||||
/** Not connected to server. */
|
||||
ACP_ERR_NOT_CONNECTED,
|
||||
/** Supplied buffer has not enough space. */
|
||||
ACP_ERR_SMALL_BUFFER,
|
||||
/** Other internal failures. */
|
||||
ACP_ERR_INTERNAL,
|
||||
/** SIDL service failure. */
|
||||
ACP_ERR_SIDL_FAILURE,
|
||||
/** No server handle received. */
|
||||
ACP_ERR_SHANDLE_UNAVAILABLE,
|
||||
/** ACP version not match */
|
||||
ACP_ERR_INVALID_VERSION,
|
||||
|
||||
ACP_ERR_QTY
|
||||
};
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
121
openair3/SS/Sidl/lib/acp/api/acpCtx.h
Normal file
121
openair3/SS/Sidl/lib/acp/api/acpCtx.h
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// System includes
|
||||
#include <stdbool.h>
|
||||
|
||||
// Internal includes
|
||||
#include "acp.h"
|
||||
#include "acpIdMap.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
#define ACP_CTX_CAST(pTR) ((struct acpCtx*)(pTR))
|
||||
|
||||
/** Defines user ID. */
|
||||
struct acpUserService {
|
||||
/** User ID */
|
||||
int user_id;
|
||||
/** Offset in acpIdMap table */
|
||||
int id_index;
|
||||
};
|
||||
|
||||
/** Defines ACP Context. */
|
||||
struct acpCtx {
|
||||
/** Context pointer. */
|
||||
acpCtx_t ptr;
|
||||
/** Arena to devode received message. */
|
||||
unsigned char* arena;
|
||||
/** Arena size to decode received message. */
|
||||
size_t aSize;
|
||||
/** If context is server side. */
|
||||
bool isServer;
|
||||
/** ACP handle. */
|
||||
void* handle;
|
||||
/** ACP server handle. */
|
||||
void* sHandle;
|
||||
/** Socket descriptor (on client side, or master socket on server side). */
|
||||
int sock;
|
||||
/** Peers socket descriptors on server side. */
|
||||
int peers[ACP_MAX_PEER_QTY];
|
||||
/** Peers socket handshake state on server side. */
|
||||
int peersHandshaked[ACP_MAX_PEER_QTY];
|
||||
/** Peers socket descriptors size. */
|
||||
size_t peersSize;
|
||||
/** Last peer socket descriptor who sent the message. */
|
||||
int lastPeer;
|
||||
/** User ID map. */
|
||||
struct acpUserService* userIdMap;
|
||||
/** User ID map max size. */
|
||||
size_t userIdMapMaxSize;
|
||||
/** ID map size. */
|
||||
size_t userIdMapSize;
|
||||
|
||||
/** Debug logger callback. */
|
||||
void (*logger)(const char*);
|
||||
/** Debug logger buffer. */
|
||||
unsigned char* logBuf;
|
||||
/** Debug logger buffer max size. */
|
||||
size_t logBufMaxSize;
|
||||
/** Debug logger buffer size. */
|
||||
size_t logBufSize;
|
||||
/** Debug logger use formatting. */
|
||||
bool logFormat;
|
||||
/** Debug logger formatting buffer. */
|
||||
unsigned char* logFormatBuf;
|
||||
/** Debug logger formatting buffer max size. */
|
||||
size_t logFormatBufMaxSize;
|
||||
};
|
||||
|
||||
/** Init. */
|
||||
void acpCtxInit(void);
|
||||
|
||||
/** Returns new available context. */
|
||||
acpCtx_t acpTakeCtx(void);
|
||||
|
||||
/** Makes the context available. */
|
||||
void acpGiveCtx(acpCtx_t ctx);
|
||||
|
||||
/** Gets message user id. */
|
||||
int acpCtxGetMsgUserId(struct acpCtx* ctx, unsigned int type);
|
||||
|
||||
/** Sets message user id. */
|
||||
int acpCtxSetMsgUserId(struct acpCtx* ctx, const char* name, int userId);
|
||||
|
||||
/** Sets message user id. */
|
||||
int acpCtxSetMsgUserIdById(struct acpCtx* ctx, enum acpMsgLocalId lid, int userId);
|
||||
|
||||
/** Checks if the context is valid. */
|
||||
bool acpCtxIsValid(acpCtx_t ctx);
|
||||
|
||||
/** Resolves message id. */
|
||||
int acpCtxResolveId(int id, const char* name);
|
||||
|
||||
/** Gets message name from id (for debug). */
|
||||
const char* acpCtxGetMsgNameFromId(int id);
|
||||
|
||||
/** Gets message kind from id (for debug). */
|
||||
int acpCtxGetMsgKindFromId(int id);
|
||||
|
||||
/** Gets sidl name from local id. */
|
||||
const char* acpCtxGetItfNameFrom_localId(int id);
|
||||
|
||||
/** Gets message kind from name */
|
||||
int acpCtxGetMsgKindFromName(const char* name);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
36
openair3/SS/Sidl/lib/acp/api/acpDrb.h
Normal file
36
openair3/SS/Sidl/lib/acp/api/acpDrb.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_EUTRA_DRB_PORT.h"
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int acpDrbProcessFromSSEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct DRB_COMMON_REQ* FromSS);
|
||||
|
||||
int acpDrbProcessFromSSDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct DRB_COMMON_REQ** FromSS);
|
||||
|
||||
void acpDrbProcessFromSSFreeSrv(struct DRB_COMMON_REQ* FromSS);
|
||||
|
||||
int acpDrbProcessToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct DRB_COMMON_IND* ToSS);
|
||||
|
||||
int acpDrbProcessToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct DRB_COMMON_IND** ToSS);
|
||||
|
||||
void acpDrbProcessToSSFreeClt(struct DRB_COMMON_IND* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
36
openair3/SS/Sidl/lib/acp/api/acpHandshake.h
Normal file
36
openair3/SS/Sidl/lib/acp/api/acpHandshake.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_Handshake.h"
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int acpHandshakeHandleFromSSEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct AcpHandshake_Type* fromSS);
|
||||
|
||||
int acpHandshakeHandleFromSSDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct AcpHandshake_Type** fromSS);
|
||||
|
||||
void acpHandshakeHandleFromSSFreeSrv(struct AcpHandshake_Type* fromSS);
|
||||
|
||||
int acpHandshakeHandleToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct AcpHandshakeRsp_Type* toSS);
|
||||
|
||||
int acpHandshakeHandleToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct AcpHandshakeRsp_Type** toSS);
|
||||
|
||||
void acpHandshakeHandleToSSFreeClt(struct AcpHandshakeRsp_Type* toSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
55
openair3/SS/Sidl/lib/acp/api/acpIdMap.h
Normal file
55
openair3/SS/Sidl/lib/acp/api/acpIdMap.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// Internal includes
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
/** Defines ACP Context. */
|
||||
struct acpIdMapService {
|
||||
/** Service name. */
|
||||
const char* name;
|
||||
/** Service static local id. */
|
||||
unsigned int local_id;
|
||||
/** Service remote id. */
|
||||
unsigned int remote_id;
|
||||
/** Service kind (0 - NTF, 1 - ONEWAY, 2 - CMD). */
|
||||
int kind;
|
||||
};
|
||||
|
||||
struct acpIdMapItf {
|
||||
/** SIDL interface name. */
|
||||
const char* name;
|
||||
/** interface id. */
|
||||
int id;
|
||||
/** Start index. */
|
||||
int startIndex;
|
||||
/** Service quantity. */
|
||||
int servicesQty;
|
||||
};
|
||||
|
||||
/** Interface IDs mapping. */
|
||||
extern const struct acpIdMapItf acpItfMap[];
|
||||
extern const unsigned int acpItfMapSize;
|
||||
|
||||
/** Service IDs mapping. */
|
||||
extern struct acpIdMapService acpIdMap[];
|
||||
extern const unsigned int acpIdMapSize;
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
22
openair3/SS/Sidl/lib/acp/api/acpInternal.h
Normal file
22
openair3/SS/Sidl/lib/acp/api/acpInternal.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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 "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
SIDL_END_C_INTERFACE
|
||||
38
openair3/SS/Sidl/lib/acp/api/acpMem.h
Normal file
38
openair3/SS/Sidl/lib/acp/api/acpMem.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// Internal includes
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
/** Allocates size bytes and returns a pointer to the allocated memory.
|
||||
*
|
||||
* @param[in] size Buffer size to allocate
|
||||
* @return pointer to the allocation buffer or NULL on failure
|
||||
*/
|
||||
void* acpMalloc(size_t size);
|
||||
|
||||
/** Frees the memory space pointed to by ptr, which must have been returned
|
||||
* by a previous call acpMalloc.
|
||||
*
|
||||
* @param[in] ptr Pointer to the allocated buffer
|
||||
*/
|
||||
void acpFree(void* ptr);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
49
openair3/SS/Sidl/lib/acp/api/acpMsgIds.h
Normal file
49
openair3/SS/Sidl/lib/acp/api/acpMsgIds.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// Internal includes
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
/** Defines message local IDs. */
|
||||
enum acpMsgLocalId {
|
||||
ACP_LID_TestHelloFromSS = 0x90040100,
|
||||
ACP_LID_TestHelloToSS = 0x90040101,
|
||||
ACP_LID_TestPing = 0x90040102,
|
||||
ACP_LID_TestEcho = 0x90040103,
|
||||
ACP_LID_TestTest1 = 0x90040104,
|
||||
ACP_LID_TestTest2 = 0x90040105,
|
||||
ACP_LID_TestOther = 0x90040106,
|
||||
ACP_LID_SysProcess = 0x90040200,
|
||||
ACP_LID_SysVTEnquireTimingAck = 0x90040300,
|
||||
ACP_LID_SysVTEnquireTimingUpd = 0x90040301,
|
||||
ACP_LID_SysSrbProcessFromSS = 0x90040400,
|
||||
ACP_LID_SysSrbProcessToSS = 0x90040401,
|
||||
ACP_LID_VngProcess = 0x90040500,
|
||||
ACP_LID_DrbProcessFromSS = 0x90040600,
|
||||
ACP_LID_DrbProcessToSS = 0x90040601,
|
||||
ACP_LID_HandshakeHandleFromSS = 0x90040700,
|
||||
ACP_LID_HandshakeHandleToSS = 0x90040701,
|
||||
ACP_LID_SysIndProcessToSS = 0x90040800,
|
||||
|
||||
ACP_LID_NrSysSrbProcessFromSS = 0x90040900,
|
||||
ACP_LID_NrSysSrbProcessToSS = 0x90040901,
|
||||
};
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
84
openair3/SS/Sidl/lib/acp/api/acpSocket.h
Normal file
84
openair3/SS/Sidl/lib/acp/api/acpSocket.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// System includes
|
||||
#include <stdbool.h>
|
||||
|
||||
// Internal includes
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
/** Connects to server.
|
||||
*
|
||||
* @param[in] ipaddr Server ip address
|
||||
* @param[in] port Server ip port
|
||||
* @return socket fd, or negative number on failure
|
||||
*/
|
||||
int acpSocketConnect(IpAddress_t ipaddr, int port);
|
||||
|
||||
/** Opens listening socket.
|
||||
*
|
||||
* @param[in] ipaddr Server ip address
|
||||
* @param[in] port Server ip port
|
||||
* @return socket fd, or negative number on failure
|
||||
*/
|
||||
int acpSocketListen(IpAddress_t ipaddr, int port);
|
||||
|
||||
int acpSocketSelect(int sock, MSec_t socketTimeout);
|
||||
|
||||
int acpSocketSelectMulti(int* sock, MSec_t socketTimeout, size_t peersSize, int* peers);
|
||||
|
||||
int acpSocketAccept(int sock);
|
||||
|
||||
/** Sends a message on socket.
|
||||
*
|
||||
* @param[in] sock Socket fd
|
||||
* @param[in] size Buffer size
|
||||
* @param[in] buffer Buffer to send
|
||||
* @return number of bytes sent, or negative number on failure
|
||||
*/
|
||||
int acpSocketSend(int sock, size_t size, const unsigned char* buffer);
|
||||
|
||||
/** Receives a message on socket.
|
||||
*
|
||||
* @param[in] sock Socket fd
|
||||
* @param[in] size Buffer size
|
||||
* @param[in] buffer Buffer where to put received data
|
||||
* @param[in] socketTimeout Timeout on socket reception, with value in milli-seconds
|
||||
* @param[out] disconnected Check if other side performed an orderly shutdown
|
||||
* @return number of bytes received, or negative number on failure
|
||||
*/
|
||||
int acpSocketReceive(int sock, size_t size, unsigned char* buffer, MSec_t socketTimeout, bool* disconnected);
|
||||
|
||||
/** Closes the socket.
|
||||
*
|
||||
* @param[in] sock Socket fd
|
||||
* @return 0 on success, or negative number on failure
|
||||
*/
|
||||
int acpSocketClose(int sock);
|
||||
|
||||
/** Converts ip address from string to IpAddress_t.
|
||||
*
|
||||
* @param[in] ipstr IP address in string
|
||||
* @param[out] ipaddr Converted IP address
|
||||
* @return true on success, false otherwise
|
||||
*/
|
||||
bool acpConvertIp(const char* ipstr, IpAddress_t* ipaddr);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
36
openair3/SS/Sidl/lib/acp/api/acpSys.h
Normal file
36
openair3/SS/Sidl/lib/acp/api/acpSys.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_EUTRA_SYSTEM_PORT.h"
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int acpSysProcessEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct SYSTEM_CTRL_REQ* FromSS);
|
||||
|
||||
int acpSysProcessDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct SYSTEM_CTRL_REQ** FromSS);
|
||||
|
||||
void acpSysProcessFreeSrv(struct SYSTEM_CTRL_REQ* FromSS);
|
||||
|
||||
int acpSysProcessEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct SYSTEM_CTRL_CNF* ToSS);
|
||||
|
||||
int acpSysProcessDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct SYSTEM_CTRL_CNF** ToSS);
|
||||
|
||||
void acpSysProcessFreeClt(struct SYSTEM_CTRL_CNF* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
30
openair3/SS/Sidl/lib/acp/api/acpSysInd.h
Normal file
30
openair3/SS/Sidl/lib/acp/api/acpSysInd.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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_EUTRA_SYSIND_PORT.h"
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int acpSysIndProcessToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct SYSTEM_IND* ToSS);
|
||||
|
||||
int acpSysIndProcessToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct SYSTEM_IND** ToSS);
|
||||
|
||||
void acpSysIndProcessToSSFreeClt(struct SYSTEM_IND* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
36
openair3/SS/Sidl/lib/acp/api/acpSysSrb.h
Normal file
36
openair3/SS/Sidl/lib/acp/api/acpSysSrb.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_EUTRA_SYSTEM_PORT.h"
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int acpSysSrbProcessToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EUTRA_RRC_PDU_IND* ToSS);
|
||||
|
||||
int acpSysSrbProcessToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EUTRA_RRC_PDU_IND** ToSS);
|
||||
|
||||
void acpSysSrbProcessToSSFreeClt(struct EUTRA_RRC_PDU_IND* ToSS);
|
||||
|
||||
int acpSysSrbProcessFromSSEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EUTRA_RRC_PDU_REQ* FromSS);
|
||||
|
||||
int acpSysSrbProcessFromSSDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EUTRA_RRC_PDU_REQ** FromSS);
|
||||
|
||||
void acpSysSrbProcessFromSSFreeSrv(struct EUTRA_RRC_PDU_REQ* FromSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
36
openair3/SS/Sidl/lib/acp/api/acpSysVT.h
Normal file
36
openair3/SS/Sidl/lib/acp/api/acpSysVT.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_VIRTUAL_TIME_PORT.h"
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int acpSysVTEnquireTimingUpdEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct VirtualTimeInfo_Type* TimingInfoToSS);
|
||||
|
||||
int acpSysVTEnquireTimingUpdDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct VirtualTimeInfo_Type** TimingInfoToSS);
|
||||
|
||||
void acpSysVTEnquireTimingUpdFreeClt(struct VirtualTimeInfo_Type* TimingInfoToSS);
|
||||
|
||||
int acpSysVTEnquireTimingAckEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct VirtualTimeInfo_Type* TimingInfoFromSS);
|
||||
|
||||
int acpSysVTEnquireTimingAckDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct VirtualTimeInfo_Type** TimingInfoFromSS);
|
||||
|
||||
void acpSysVTEnquireTimingAckFreeSrv(struct VirtualTimeInfo_Type* TimingInfoFromSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
80
openair3/SS/Sidl/lib/acp/api/acpTest.h
Normal file
80
openair3/SS/Sidl/lib/acp/api/acpTest.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* 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_Test.h"
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int acpTestHelloFromSSEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, size_t StrQty, const char* StrArray);
|
||||
|
||||
int acpTestHelloFromSSDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, size_t* StrQty, char** StrArray);
|
||||
|
||||
void acpTestHelloFromSSFreeSrv(char* StrArray);
|
||||
|
||||
int acpTestHelloToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, size_t StrQty, const char* StrArray);
|
||||
|
||||
int acpTestHelloToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, size_t* StrQty, char** StrArray);
|
||||
|
||||
void acpTestHelloToSSFreeClt(char* StrArray);
|
||||
|
||||
int acpTestPingEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, uint32_t FromSS);
|
||||
|
||||
int acpTestPingDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, uint32_t* FromSS);
|
||||
|
||||
int acpTestPingEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, uint32_t ToSS);
|
||||
|
||||
int acpTestPingDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, uint32_t* ToSS);
|
||||
|
||||
int acpTestEchoEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EchoData* FromSS);
|
||||
|
||||
int acpTestEchoDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EchoData** FromSS);
|
||||
|
||||
void acpTestEchoFreeSrv(struct EchoData* FromSS);
|
||||
|
||||
int acpTestEchoEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EchoData* ToSS);
|
||||
|
||||
int acpTestEchoDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EchoData** ToSS);
|
||||
|
||||
void acpTestEchoFreeClt(struct EchoData* ToSS);
|
||||
|
||||
int acpTestTest1EncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct Output* out);
|
||||
|
||||
int acpTestTest1DecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct Output** out);
|
||||
|
||||
void acpTestTest1FreeSrv(struct Output* out);
|
||||
|
||||
int acpTestTest2EncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct Output* out);
|
||||
|
||||
int acpTestTest2DecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct Output** out);
|
||||
|
||||
void acpTestTest2FreeClt(struct Output* out);
|
||||
|
||||
int acpTestOtherEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct Empty* in1, uint32_t in2, size_t in3Qty, const char* in3Array, const char* in4, bool in5, int in6, float in7, SomeEnum in8, size_t in9Qty, const struct Empty* in9Array, const struct Empty2* in10, const struct New* in11);
|
||||
|
||||
int acpTestOtherDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct Empty** in1, uint32_t* in2, size_t* in3Qty, char** in3Array, char** in4, bool* in5, int* in6, float* in7, SomeEnum* in8, size_t* in9Qty, struct Empty** in9Array, struct Empty2** in10, struct New** in11);
|
||||
|
||||
void acpTestOtherFreeSrv(struct Empty* in1, char* in3Array, char* in4, struct Empty* in9Array, size_t in9Qty, struct Empty2* in10, struct New* in11);
|
||||
|
||||
int acpTestOtherEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct Empty* out1, uint32_t out2, size_t out3Qty, const char* out3Array, const char* out4, bool out5, int out6, float out7, SomeEnum out8, size_t out9Qty, const struct Empty* out9Array, const struct Empty2* out10, const struct New* out11);
|
||||
|
||||
int acpTestOtherDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct Empty** out1, uint32_t* out2, size_t* out3Qty, char** out3Array, char** out4, bool* out5, int* out6, float* out7, SomeEnum* out8, size_t* out9Qty, struct Empty** out9Array, struct Empty2** out10, struct New** out11);
|
||||
|
||||
void acpTestOtherFreeClt(struct Empty* out1, char* out3Array, char* out4, struct Empty* out9Array, size_t out9Qty, struct Empty2* out10, struct New* out11);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
20
openair3/SS/Sidl/lib/acp/api/acpVer.h
Normal file
20
openair3/SS/Sidl/lib/acp/api/acpVer.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
#define ACP_VERSION "1.1.19"
|
||||
#define ACP_VERSION_CKSM "7e49fb44a76ef00489a052a3bd0e7dfb"
|
||||
36
openair3/SS/Sidl/lib/acp/api/acpVng.h
Normal file
36
openair3/SS/Sidl/lib/acp/api/acpVng.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_EUTRA_VNG_PORT.h"
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int acpVngProcessEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EUTRA_VNG_CTRL_REQ* FromSS);
|
||||
|
||||
int acpVngProcessDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EUTRA_VNG_CTRL_REQ** FromSS);
|
||||
|
||||
void acpVngProcessFreeSrv(struct EUTRA_VNG_CTRL_REQ* FromSS);
|
||||
|
||||
int acpVngProcessEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EUTRA_VNG_CTRL_CNF* ToSS);
|
||||
|
||||
int acpVngProcessDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EUTRA_VNG_CTRL_CNF** ToSS);
|
||||
|
||||
void acpVngProcessFreeClt(struct EUTRA_VNG_CTRL_CNF* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
975
openair3/SS/Sidl/lib/acp/src/acp.c
Normal file
975
openair3/SS/Sidl/lib/acp/src/acp.c
Normal file
@@ -0,0 +1,975 @@
|
||||
/*
|
||||
* 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
// Internal includes
|
||||
#include "acp.h"
|
||||
#include "acpMem.h"
|
||||
#include "acpCtx.h"
|
||||
#include "acpSocket.h"
|
||||
#include "acpProto.h"
|
||||
#include "acpMsgIds.h"
|
||||
#include "acpInternal.h"
|
||||
#include "adbg.h"
|
||||
#include "adbgMsg.h"
|
||||
#include "acpVer.h"
|
||||
#include "acpHandshake.h"
|
||||
|
||||
|
||||
// #define ACP_LOG_DEBUG(...) printf(__VA_ARGS__);
|
||||
#define ACP_LOG_DEBUG(...)
|
||||
|
||||
// Static variables
|
||||
static acpMalloc_t _alloc = NULL;
|
||||
static acpFree_t _release = NULL;
|
||||
static MSec_t _socketTimeout = 1000;
|
||||
static bool _initialized = false;
|
||||
bool acp_printPrettyMessages = false;
|
||||
|
||||
// Adds peer to the server context.
|
||||
static void acpAddPeer(struct acpCtx* ctx, int peer)
|
||||
{
|
||||
for (int i = 0; i < ACP_MAX_PEER_QTY; i++) {
|
||||
if (ctx->peers[i] == -1) {
|
||||
ctx->peers[i] = peer;
|
||||
ctx->peersHandshaked[i] = 0;
|
||||
ctx->peersSize++;
|
||||
return;
|
||||
}
|
||||
}
|
||||
SIDL_ASSERT(0);
|
||||
}
|
||||
|
||||
// Removes peer from the server context.
|
||||
static void acpRemovePeer(struct acpCtx* ctx, int peer)
|
||||
{
|
||||
for (int i = 0; i < ACP_MAX_PEER_QTY; i++) {
|
||||
if (ctx->peers[i] == peer) {
|
||||
ctx->peers[i] = -1;
|
||||
ctx->peersHandshaked[i] = 0;
|
||||
ctx->peersSize--;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool acpPeerHandshaked(struct acpCtx* ctx, int peer)
|
||||
{
|
||||
for (int i = 0; i < ACP_MAX_PEER_QTY; i++) {
|
||||
if (ctx->peers[i] == peer) {
|
||||
return (ctx->peersHandshaked[i] != 0) ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool acpAnyPeerHandshaked(struct acpCtx* ctx)
|
||||
{
|
||||
for (int i = 0; i < ACP_MAX_PEER_QTY; i++) {
|
||||
if (ctx->peersHandshaked[i] > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void acpPeerSetHandshaked(struct acpCtx* ctx, int peer, int flag)
|
||||
{
|
||||
for (int i = 0; i < ACP_MAX_PEER_QTY; i++) {
|
||||
if (ctx->peers[i] == peer) {
|
||||
ctx->peersHandshaked[i] = flag;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ___________________________ / Interface // ___________________________
|
||||
|
||||
void* acpMalloc(size_t size)
|
||||
{
|
||||
if (_alloc) {
|
||||
return _alloc(size);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void acpFree(void* ptr)
|
||||
{
|
||||
if (_release) {
|
||||
_release(ptr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void acpInit(acpMalloc_t alloc, acpFree_t release, MSec_t socketTimeout)
|
||||
{
|
||||
ACP_DEBUG_ENTER_TRACE_LOG();
|
||||
|
||||
if (_initialized) {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG("FALSE");
|
||||
return;
|
||||
}
|
||||
|
||||
SIDL_ASSERT(alloc && release);
|
||||
|
||||
_alloc = alloc;
|
||||
|
||||
_release = release;
|
||||
|
||||
_socketTimeout = socketTimeout;
|
||||
|
||||
acpCtxInit();
|
||||
|
||||
_initialized = true;
|
||||
ACP_DEBUG_EXIT_TRACE_LOG("TRUE");
|
||||
}
|
||||
|
||||
int acpUpdateCtx(acpCtx_t ctx, size_t size, const unsigned char* buffer)
|
||||
{
|
||||
ACP_DEBUG_ENTER_TRACE_LOG();
|
||||
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG("ACP_ERR_INVALID_CTX");
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
if (size < ACP_HEADER_SIZE) {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG("ACP_ERR_INVALID_HEADER");
|
||||
return -ACP_ERR_INVALID_HEADER;
|
||||
}
|
||||
|
||||
acpProcessPushMsg(ctx, size, buffer);
|
||||
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpCreateCtx(acpCtx_t* ctx)
|
||||
{
|
||||
SIDL_ASSERT(ctx);
|
||||
|
||||
*ctx = acpTakeCtx();
|
||||
if (!*ctx) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpDeleteCtx(acpCtx_t ctx)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
acpGiveCtx(ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool acpIsConnected(acpCtx_t ctx)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
struct acpCtx* c = ACP_CTX_CAST(ctx);
|
||||
return (c->sHandle != NULL);
|
||||
}
|
||||
|
||||
int acpGetMsgSidlStatus(size_t size, const unsigned char* buffer, SidlStatus* sidlStatus)
|
||||
{
|
||||
if (size < ACP_HEADER_SIZE) {
|
||||
return -ACP_ERR_INVALID_HEADER;
|
||||
}
|
||||
|
||||
if (sidlStatus) {
|
||||
*sidlStatus = (SidlStatus)(uint32_t)((buffer[12] << 24) | (buffer[13] << 16) | (buffer[14] << 8) | (buffer[15]));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpGetMsgLength(size_t size, unsigned char* buffer)
|
||||
{
|
||||
if (size < ACP_HEADER_SIZE) {
|
||||
return -ACP_ERR_INVALID_HEADER;
|
||||
}
|
||||
|
||||
int length = (int)((buffer[2] << 8) | buffer[3]);
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
int acpGetMsgId(acpCtx_t ctx, size_t size, const unsigned char* buffer)
|
||||
{
|
||||
if (size < ACP_HEADER_SIZE) {
|
||||
return -ACP_ERR_INVALID_HEADER;
|
||||
}
|
||||
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
int type = (int)((buffer[4] << 24) | (buffer[5] << 16) | (buffer[6] << 8) | (buffer[7]));
|
||||
|
||||
if (type == (int)ACP_SERVICE_PUSH_TYPE) {
|
||||
acpUpdateCtx(ctx, size, buffer);
|
||||
return type;
|
||||
}
|
||||
|
||||
#if 0 // TODO
|
||||
if (type == ACP_LID_InternalConnectToMs) {
|
||||
SidlStatus sidlStatus;
|
||||
if (acpGetMsgSidlStatus(ACP_HEADER_SIZE, buffer, &sidlStatus) < 0) {
|
||||
return -ACP_ERR_INVALID_HEADER;
|
||||
}
|
||||
if (sidlStatus == SIDL_STATUS_OK) {
|
||||
uint32_t sHandle = 0;
|
||||
if (acpInternalConnectToMsDec(ctx, buffer, size, &sHandle) == 0) {
|
||||
if (sHandle) {
|
||||
ACP_CTX_CAST(ctx)->sHandle = (void*)(uintptr_t)sHandle;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return acpCtxGetMsgUserId(ACP_CTX_CAST(ctx), type);
|
||||
}
|
||||
|
||||
int acpGetMsgLocalId(size_t size, const unsigned char* buffer, enum acpMsgLocalId* localMsgId)
|
||||
{
|
||||
if (size < ACP_HEADER_SIZE) {
|
||||
return -ACP_ERR_INVALID_HEADER;
|
||||
}
|
||||
|
||||
int type = (int)((buffer[4] << 24) | (buffer[5] << 16) | (buffer[6] << 8) | (buffer[7]));
|
||||
|
||||
if (localMsgId) {
|
||||
*localMsgId = (enum acpMsgLocalId)type;
|
||||
}
|
||||
|
||||
if (type == (int)ACP_SERVICE_PUSH_TYPE) {
|
||||
return type;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int acpRecvMsgInternal(int sock, size_t size, unsigned char* buffer)
|
||||
{
|
||||
int length = 0;
|
||||
SidlStatus sidlStatus;
|
||||
|
||||
/* Read ACP message header */
|
||||
int sz = acpSocketReceive(sock, ACP_HEADER_SIZE, buffer, _socketTimeout, NULL);
|
||||
if (sz < 0) {
|
||||
return -ACP_ERR_SOCK_ERROR;
|
||||
}
|
||||
|
||||
if (sz == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sz != ACP_HEADER_SIZE) {
|
||||
return -ACP_ERR_SOCK_ERROR;
|
||||
}
|
||||
|
||||
/* Get payload length */
|
||||
length = acpGetMsgLength(ACP_HEADER_SIZE, buffer);
|
||||
if (length < 0) {
|
||||
return -ACP_ERR_INVALID_HEADER;
|
||||
}
|
||||
|
||||
/* Check decode buffer is enough to read received message */
|
||||
if (length > (int)(size - ACP_HEADER_SIZE)) {
|
||||
return -ACP_ERR_INTERNAL;
|
||||
}
|
||||
|
||||
if (length > 0) {
|
||||
/* Read ACP message payload */
|
||||
sz = acpSocketReceive(sock, length, &buffer[ACP_HEADER_SIZE], _socketTimeout, NULL);
|
||||
if (sz < 0) {
|
||||
return -ACP_ERR_SOCK_ERROR;
|
||||
}
|
||||
|
||||
if (sz != length) {
|
||||
return -ACP_ERR_SOCK_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
if (acpGetMsgSidlStatus(ACP_HEADER_SIZE, buffer, &sidlStatus) < 0) {
|
||||
return -ACP_ERR_INVALID_HEADER;
|
||||
}
|
||||
|
||||
if (sidlStatus != SIDL_STATUS_OK) {
|
||||
return -ACP_ERR_SIDL_FAILURE;
|
||||
}
|
||||
|
||||
return length + ACP_HEADER_SIZE;
|
||||
}
|
||||
|
||||
static int acpHandleHandshakeFromClient(struct acpCtx* ctx, int sock, struct AcpHandshake_Type* hs)
|
||||
{
|
||||
struct AcpHandshakeRsp_Type hs_rsp;
|
||||
|
||||
memset(hs_rsp.acpVersion, 0, 32);
|
||||
snprintf(hs_rsp.acpVersion, 31, "%s", ACP_VERSION);
|
||||
memset(hs_rsp.acpVerCksm, 0, 64);
|
||||
snprintf(hs_rsp.acpVerCksm, 63, "%s", ACP_VERSION_CKSM);
|
||||
|
||||
/* ACP version matched */
|
||||
if (strncmp(ACP_VERSION, hs->acpVersion, strlen(ACP_VERSION)) == 0 && strncmp(ACP_VERSION_CKSM, hs->acpVerCksm, strlen(ACP_VERSION)) == 0) {
|
||||
hs_rsp.acpVersionChk = true;
|
||||
} else {
|
||||
hs_rsp.acpVersionChk = false;
|
||||
}
|
||||
|
||||
ACP_DEBUG_CLOG(ctx, "ACP version: %s", hs_rsp.acpVersionChk ? "matched" : "not matched");
|
||||
|
||||
int ret = 0;
|
||||
const size_t size = 16 * 1024;
|
||||
size_t bufSize = size;
|
||||
unsigned char* buffer = (unsigned char*)acpMalloc(size);
|
||||
SIDL_ASSERT(buffer);
|
||||
|
||||
ret = acpHandshakeHandleToSSEncSrv(ctx, buffer, &bufSize, &hs_rsp);
|
||||
if (ret == 0) {
|
||||
if (acpSocketSend(sock, bufSize, buffer) != (int)bufSize) {
|
||||
ACP_DEBUG_CLOG(ctx, "Error: Failed to send HandshakeToSS message");
|
||||
acpPeerSetHandshaked(ctx, sock, 0);
|
||||
ret = -ACP_ERR_INTERNAL;
|
||||
} else {
|
||||
ACP_DEBUG_CLOG(ctx, "HandshakeToSS message sent");
|
||||
// No fatal to be generated if handshake not well processed
|
||||
acpPeerSetHandshaked(ctx, sock, 1);
|
||||
// acpPeerSetHandshaked(ctx, sock, (hs_rsp.acpVersionChk?1:0));
|
||||
ret = 0;
|
||||
}
|
||||
} else {
|
||||
ACP_DEBUG_CLOG(ctx, "ERROR: Failed to encode HandshakeToSS message");
|
||||
acpPeerSetHandshaked(ctx, sock, 0);
|
||||
ret = -ACP_ERR_INTERNAL;
|
||||
}
|
||||
|
||||
acpFree(buffer);
|
||||
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int acpHandleHandshakeToServer(struct acpCtx* ctx, int sock)
|
||||
{
|
||||
ACP_DEBUG_ENTER_CLOG(ctx);
|
||||
const size_t size = 16 * 1024;
|
||||
unsigned char* buffer = (unsigned char*)acpMalloc(size);
|
||||
SIDL_ASSERT(buffer);
|
||||
|
||||
int length;
|
||||
enum acpMsgLocalId localId;
|
||||
|
||||
/* Send Handshake to Server */
|
||||
struct AcpHandshake_Type hs;
|
||||
struct AcpHandshakeRsp_Type* hs_rsp;
|
||||
size_t bufSize = size;
|
||||
int ret = 0;
|
||||
memset(hs.acpVersion, 0, 32);
|
||||
snprintf(hs.acpVersion, 31, "%s", ACP_VERSION);
|
||||
memset(hs.acpVerCksm, 0, 64);
|
||||
snprintf(hs.acpVerCksm, 63, "%s", ACP_VERSION_CKSM);
|
||||
ret = acpHandshakeHandleFromSSEncClt(ctx, buffer, &bufSize, &hs);
|
||||
if (ret == 0) {
|
||||
int retry = 0;
|
||||
|
||||
if (acpSocketSend(sock, bufSize, buffer) != (int)bufSize) {
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, "Failed to send HandshakeFromSS message");
|
||||
acpFree(buffer);
|
||||
return -ACP_ERR_INTERNAL;
|
||||
}
|
||||
|
||||
/* Now wait for handshake rsp from Server side */
|
||||
/* Loop */
|
||||
for (;;) {
|
||||
length = acpRecvMsgInternal(sock, size, buffer);
|
||||
if (length < 0) {
|
||||
ACP_DEBUG_CLOG(ctx, "ERROR: Failed to receive ACP message, error=%d", length);
|
||||
ret = -ACP_ERR_SOCK_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
/* FIXME: No message (timeout on socket), retry */
|
||||
if (length == 0) {
|
||||
retry++;
|
||||
if (retry == 10) {
|
||||
ret = -ACP_ERR_SOCK_TIMEOUT;
|
||||
ACP_DEBUG_CLOG(ctx, "ERROR: No HandshakeToSSToSS message for ACP version handshake");
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Get local message ID */
|
||||
if (acpGetMsgLocalId(ACP_HEADER_SIZE, buffer, &localId) < -1) {
|
||||
ret = -ACP_ERR_INVALID_HEADER;
|
||||
break;
|
||||
}
|
||||
|
||||
ACP_DEBUG_CLOG(ctx, "<<< Receive '%s' service message [localId=%08X]", acpGetMsgName(ACP_HEADER_SIZE, buffer), localId);
|
||||
|
||||
if (localId != ACP_LID_HandshakeHandleToSS) {
|
||||
/* Discard message other than handshake rsp */
|
||||
retry++;
|
||||
if (retry == 10) {
|
||||
ret = -ACP_ERR_SOCK_TIMEOUT;
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (acpHandshakeHandleToSSDecClt(ctx, buffer, length, &hs_rsp) != 0) {
|
||||
ACP_DEBUG_CLOG(ctx, "ERROR: Failed to decode HandshakeToSS message");
|
||||
ret = -ACP_ERR_INTERNAL;
|
||||
break;
|
||||
}
|
||||
|
||||
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);
|
||||
acpHandshakeHandleToSSFreeClt(hs_rsp);
|
||||
ret = 0; //-ACP_ERR_INVALID_VERSION;
|
||||
break;
|
||||
}
|
||||
|
||||
ACP_DEBUG_CLOG(ctx, "ACP version Matched: [%s], checksum: [%s]", hs_rsp->acpVersion, hs_rsp->acpVerCksm);
|
||||
acpHandshakeHandleToSSFreeClt(hs_rsp);
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
ACP_DEBUG_CLOG(ctx, "ERROR: Failed to encode HandshakeFromSS message");
|
||||
ret = -ACP_ERR_INTERNAL;
|
||||
}
|
||||
|
||||
acpFree(buffer);
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Performs full connection to server. */
|
||||
static int acpConnectToSrv(struct acpCtx* ctx, int sock)
|
||||
{
|
||||
ACP_DEBUG_ENTER_CLOG(ctx);
|
||||
|
||||
/* Perform Handshake to Server */
|
||||
int ret = acpHandleHandshakeToServer(ctx, sock);
|
||||
|
||||
if (ret != 0) {
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, "Error: Handshake failure");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* TODO: Other operations to communicate with server */
|
||||
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int acpRecvMsg(acpCtx_t ctx, size_t* size, unsigned char* buffer)
|
||||
{
|
||||
SIDL_ASSERT(size && buffer);
|
||||
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_ENTER_TRACE_CLOG(ctx);
|
||||
#endif
|
||||
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_INVALID_CTX");
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
int err, sz, length, userId;
|
||||
unsigned int handle;
|
||||
SidlStatus sidlStatus;
|
||||
|
||||
int sock = ACP_CTX_CAST(ctx)->sock;
|
||||
size_t peersSize = 0;
|
||||
int* peers = NULL;
|
||||
|
||||
bool disconnected = false;
|
||||
|
||||
if (ACP_CTX_CAST(ctx)->isServer) {
|
||||
peersSize = ACP_CTX_CAST(ctx)->peersSize;
|
||||
peers = ACP_CTX_CAST(ctx)->peers;
|
||||
}
|
||||
|
||||
err = acpSocketSelectMulti(&sock, _socketTimeout, peersSize, peers);
|
||||
if (err == 0) {
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, NULL);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
if (err < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "acpSocketSelectMulti failed");
|
||||
return -ACP_ERR_SOCK_ERROR;
|
||||
}
|
||||
|
||||
if (ACP_CTX_CAST(ctx)->isServer) {
|
||||
if (ACP_CTX_CAST(ctx)->sock == sock) {
|
||||
int peerSock = acpSocketAccept(sock);
|
||||
if (peerSock < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "acpSocketAccept failed");
|
||||
return -ACP_ERR_SOCK_ERROR;
|
||||
}
|
||||
acpAddPeer(ACP_CTX_CAST(ctx), peerSock);
|
||||
ACP_DEBUG_CLOG(ctx, "Peer connected");
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ACP_CTX_CAST(ctx)->lastPeer = sock;
|
||||
}
|
||||
|
||||
// Check decode buffer is enough to read message header
|
||||
if (ACP_HEADER_SIZE > *size) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_SMALL_BUFFER");
|
||||
return -ACP_ERR_SMALL_BUFFER;
|
||||
}
|
||||
|
||||
// Read SIDL message header
|
||||
sz = acpSocketReceive(sock, ACP_HEADER_SIZE, buffer, _socketTimeout, (ACP_CTX_CAST(ctx)->isServer ? &disconnected : NULL));
|
||||
if (sz == 0) {
|
||||
if (ACP_CTX_CAST(ctx)->isServer && disconnected) {
|
||||
acpRemovePeer(ACP_CTX_CAST(ctx), sock);
|
||||
acpSocketClose(sock);
|
||||
ACP_DEBUG_CLOG(ctx, "Peer disconnected");
|
||||
}
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, NULL);
|
||||
return -ACP_ERR_SOCKCONN_ABORTED;
|
||||
}
|
||||
if (sz < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_SOCK_ERROR");
|
||||
return -ACP_ERR_SOCK_ERROR;
|
||||
}
|
||||
if (sz != ACP_HEADER_SIZE) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_SOCK_TIMEOUT");
|
||||
return -ACP_ERR_SOCK_TIMEOUT;
|
||||
}
|
||||
|
||||
// Get payload length
|
||||
length = acpGetMsgLength(ACP_HEADER_SIZE, buffer);
|
||||
if (length < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_INVALID_HEADER");
|
||||
return -ACP_ERR_INVALID_HEADER;
|
||||
}
|
||||
|
||||
// Check decode buffer is enough to read received message
|
||||
if (length > (int)(*size - ACP_HEADER_SIZE)) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_SMALL_BUFFER");
|
||||
return -ACP_ERR_SMALL_BUFFER;
|
||||
}
|
||||
|
||||
if (length > 0) {
|
||||
// Read ACP message payload
|
||||
sz = acpSocketReceive(sock, length, &buffer[ACP_HEADER_SIZE], _socketTimeout, NULL);
|
||||
if (sz < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_SOCK_ERROR");
|
||||
return -ACP_ERR_SOCK_ERROR;
|
||||
}
|
||||
if (sz != length) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_SOCK_TIMEOUT");
|
||||
return -ACP_ERR_SOCK_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
if (acpGetMsgSidlStatus(ACP_HEADER_SIZE, buffer, &sidlStatus) < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_INVALID_HEADER");
|
||||
return -ACP_ERR_INVALID_HEADER;
|
||||
}
|
||||
if (sidlStatus != SIDL_STATUS_OK) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_SIDL_FAILURE");
|
||||
return -ACP_ERR_SIDL_FAILURE;
|
||||
}
|
||||
|
||||
// Get message ID
|
||||
userId = acpGetMsgId(ctx, length + ACP_HEADER_SIZE, buffer);
|
||||
|
||||
if (userId == (int)ACP_SERVICE_PUSH_TYPE) {
|
||||
userId = 0;
|
||||
}
|
||||
|
||||
handle = (unsigned int)((buffer[8] << 24) | (buffer[9] << 16) | (buffer[10] << 8) | (buffer[11]));
|
||||
|
||||
if (handle == ACP_KEEPALIVE_HANDLE) {
|
||||
userId = 0;
|
||||
}
|
||||
|
||||
*size = length + ACP_HEADER_SIZE;
|
||||
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);
|
||||
|
||||
if (ACP_CTX_CAST(ctx)->isServer) {
|
||||
bool handshaked = acpPeerHandshaked(ctx, sock);
|
||||
if (!handshaked && type != (int)ACP_LID_HandshakeHandleFromSS) {
|
||||
/* The first message should be HandshakeHandleFromSS from client */
|
||||
ACP_DEBUG_PREFIX_CLOG(ctx, "Wrong message, should be HandshakeHandleFromSS\r\n");
|
||||
userId = -ACP_ERR_INTERNAL;
|
||||
} else if (type == (int)ACP_LID_HandshakeHandleFromSS) {
|
||||
/* Handle Handshake from Client */
|
||||
/* FIXME: How about duplicate Handshake? */
|
||||
struct AcpHandshake_Type* hs;
|
||||
|
||||
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);
|
||||
userId = acpHandleHandshakeFromClient(ctx, sock, hs);
|
||||
acpHandshakeHandleFromSSFreeSrv(hs);
|
||||
} else {
|
||||
ACP_DEBUG_CLOG(ctx, "ERROR: Failed to decode HandshakeFromSS message");
|
||||
userId = -ACP_ERR_INTERNAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (userId >= 0) {
|
||||
#ifdef ACP_DEBUG
|
||||
adbgMsgLog(ctx, ADBG_MSG_LOG_RECV_DIR, *size, buffer);
|
||||
#endif
|
||||
}
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, NULL);
|
||||
return userId;
|
||||
}
|
||||
|
||||
int acpSendMsg(acpCtx_t ctx, size_t size, const unsigned char* buffer)
|
||||
{
|
||||
SIDL_ASSERT(buffer);
|
||||
|
||||
// ACP_DEBUG_ENTER_TRACE_CLOG(ctx);
|
||||
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
int sock = ACP_CTX_CAST(ctx)->sock;
|
||||
if (ACP_CTX_CAST(ctx)->isServer) {
|
||||
|
||||
if ( ACP_CTX_CAST(ctx)->lastPeer == -1) {
|
||||
ACP_CTX_CAST(ctx)->lastPeer = acpSocketAccept(sock);
|
||||
}
|
||||
|
||||
sock = ACP_CTX_CAST(ctx)->lastPeer;
|
||||
if (sock == -1) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_INVALID_CTX");
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
}
|
||||
|
||||
ACP_DEBUG_PREFIX_CLOG(ctx, "Sending message '%s'", acpGetMsgName(size, buffer));
|
||||
#ifdef ACP_DEBUG
|
||||
adbgMsgLog(ctx, ADBG_MSG_LOG_SEND_DIR, size, buffer);
|
||||
#endif
|
||||
|
||||
if (acpSocketSend(sock, size, buffer) != (int)size) {
|
||||
ACP_DEBUG_EXIT_TRACE_CLOG(ctx, "ACP_ERR_INTERNAL");
|
||||
return -ACP_ERR_INTERNAL;
|
||||
}
|
||||
|
||||
/*
|
||||
if (ACP_CTX_CAST(ctx)->isServer) {
|
||||
ACP_CTX_CAST(ctx)->lastPeer = -1;
|
||||
}
|
||||
*/
|
||||
|
||||
// ACP_DEBUG_EXIT_TRACE_CLOG(ctx, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpClientInit(acpCtx_t ctx, IpAddress_t ipaddr, int port, size_t aSize)
|
||||
{
|
||||
ACP_DEBUG_ENTER_CLOG(ctx);
|
||||
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
int sock = acpSocketConnect(ipaddr, port);
|
||||
if (sock < 0) {
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, "ACP_ERR_SOCKCONN_ABORTED");
|
||||
return -ACP_ERR_SOCKCONN_ABORTED;
|
||||
}
|
||||
|
||||
int ret = acpConnectToSrv(ACP_CTX_CAST(ctx), sock);
|
||||
if (ret < 0) {
|
||||
acpSocketClose(sock);
|
||||
ACP_DEBUG_CLOG(ctx, "ERROR: Failed to connect to Server (toSS) error=%d", ret);
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Should not happen
|
||||
if (!acpIsConnected(ctx)) {
|
||||
acpSocketClose(sock);
|
||||
return -ACP_ERR_NOT_CONNECTED;
|
||||
}
|
||||
#endif
|
||||
|
||||
ACP_CTX_CAST(ctx)->sock = sock;
|
||||
ACP_CTX_CAST(ctx)->isServer = false;
|
||||
ACP_CTX_CAST(ctx)->aSize = aSize;
|
||||
ACP_CTX_CAST(ctx)->arena = (unsigned char*)acpMalloc(aSize);
|
||||
SIDL_ASSERT(ACP_CTX_CAST(ctx)->arena);
|
||||
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpClientInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable* msgTable, size_t aSize, acpCtx_t* ctx)
|
||||
{
|
||||
SIDL_ASSERT(ctx);
|
||||
|
||||
ACP_DEBUG_ENTER_LOG();
|
||||
|
||||
acpCtx_t _ctx = NULL;
|
||||
if (acpCreateCtx(&_ctx) < 0) {
|
||||
ACP_DEBUG_EXIT_LOG("ACP_ERR_INVALID_CTX");
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
if (msgTable) {
|
||||
while (msgTable->name) {
|
||||
int err = acpSetMsgId(_ctx, msgTable->name, msgTable->userId);
|
||||
if (err < 0) {
|
||||
acpDeleteCtx(_ctx);
|
||||
ACP_DEBUG_EXIT_LOG("acpSetMsgId failed");
|
||||
return err;
|
||||
}
|
||||
msgTable++;
|
||||
}
|
||||
}
|
||||
|
||||
int ret = acpClientInit(_ctx, ipaddr, port, aSize);
|
||||
if (ret < 0) {
|
||||
acpDeleteCtx(_ctx);
|
||||
ACP_DEBUG_EXIT_LOG("acpClientInit failed");
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (acp_printPrettyMessages) {
|
||||
adbgSetPrintLogFormat(_ctx, true);
|
||||
}
|
||||
*ctx = _ctx;
|
||||
|
||||
ACP_DEBUG_EXIT_LOG(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpServerInit(acpCtx_t ctx, IpAddress_t ipaddr, int port, size_t aSize)
|
||||
{
|
||||
ACP_DEBUG_ENTER_CLOG(ctx);
|
||||
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
int sock = acpSocketListen(ipaddr, port);
|
||||
if (sock < 0) {
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, "ACP_ERR_SOCKCONN_ABORTED");
|
||||
return -ACP_ERR_SOCKCONN_ABORTED;
|
||||
}
|
||||
|
||||
ACP_CTX_CAST(ctx)->sock = sock;
|
||||
ACP_CTX_CAST(ctx)->isServer = true;
|
||||
ACP_CTX_CAST(ctx)->aSize = aSize;
|
||||
ACP_CTX_CAST(ctx)->arena = (unsigned char*)acpMalloc(aSize);
|
||||
SIDL_ASSERT(ACP_CTX_CAST(ctx)->arena);
|
||||
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpServerInitWithCtx(IpAddress_t ipaddr, int port, const struct acpMsgTable* msgTable, size_t aSize, acpCtx_t* ctx)
|
||||
{
|
||||
SIDL_ASSERT(ctx);
|
||||
|
||||
ACP_DEBUG_ENTER_LOG();
|
||||
|
||||
acpCtx_t _ctx = NULL;
|
||||
if (acpCreateCtx(&_ctx) < 0) {
|
||||
ACP_DEBUG_EXIT_LOG("ACP_ERR_INVALID_CTX");
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
bool isOnlyNotify = true;
|
||||
if (msgTable) {
|
||||
while (msgTable->name) {
|
||||
int err = acpSetMsgId(_ctx, msgTable->name, msgTable->userId);
|
||||
if (err < 0) {
|
||||
acpDeleteCtx(_ctx);
|
||||
ACP_DEBUG_EXIT_LOG("acpSetMsgId failed");
|
||||
return err;
|
||||
}
|
||||
|
||||
err = acpCtxGetMsgKindFromName(msgTable->name);
|
||||
if (err < 0) {
|
||||
acpDeleteCtx(_ctx);
|
||||
ACP_DEBUG_EXIT_LOG("acpSetMsgId failed");
|
||||
return err;
|
||||
}
|
||||
|
||||
if (err > 0) {
|
||||
isOnlyNotify = false;
|
||||
}
|
||||
msgTable++;
|
||||
}
|
||||
}
|
||||
|
||||
int ret = acpServerInit(_ctx, ipaddr, port, aSize);
|
||||
if (ret < 0) {
|
||||
acpDeleteCtx(_ctx);
|
||||
ACP_DEBUG_EXIT_LOG("acpServerInit failed");
|
||||
return ret;
|
||||
}
|
||||
|
||||
*ctx = _ctx;
|
||||
|
||||
if (isOnlyNotify) {
|
||||
int ret = -1;
|
||||
ACP_DEBUG_CLOG(*ctx, "Wait for handshake\r\n");
|
||||
while(!acpAnyPeerHandshaked(ACP_CTX_CAST(*ctx)) || ret > 0) {
|
||||
uint8_t buffer[256] = {};
|
||||
size_t sz = sizeof(buffer);
|
||||
ret = acpRecvMsg(*ctx, &sz, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
ACP_DEBUG_EXIT_LOG(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpClose2(acpCtx_t ctx)
|
||||
{
|
||||
ACP_DEBUG_ENTER_CLOG(ctx);
|
||||
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
acpSocketClose(ACP_CTX_CAST(ctx)->sock);
|
||||
|
||||
if (ACP_CTX_CAST(ctx)->isServer) {
|
||||
for (int i = 0; i < ACP_MAX_PEER_QTY; i++) {
|
||||
if (ACP_CTX_CAST(ctx)->peers[i] != -1) {
|
||||
acpSocketClose(ACP_CTX_CAST(ctx)->peers[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ACP_DEBUG_EXIT_CLOG(ctx, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpClose(acpCtx_t ctx)
|
||||
{
|
||||
ACP_DEBUG_ENTER_LOG();
|
||||
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
ACP_DEBUG_EXIT_LOG("ACP_ERR_INVALID_CTX");
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
acpSocketClose(ACP_CTX_CAST(ctx)->sock);
|
||||
|
||||
if (ACP_CTX_CAST(ctx)->isServer) {
|
||||
for (int i = 0; i < ACP_MAX_PEER_QTY; i++) {
|
||||
if (ACP_CTX_CAST(ctx)->peers[i] != -1) {
|
||||
acpSocketClose(ACP_CTX_CAST(ctx)->peers[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
acpDeleteCtx(ctx);
|
||||
|
||||
ACP_DEBUG_EXIT_LOG(NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpGetSocketFd(acpCtx_t ctx)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
return ACP_CTX_CAST(ctx)->sock;
|
||||
}
|
||||
|
||||
void acpSetSocketFd(acpCtx_t ctx, int socketfd)
|
||||
{
|
||||
if (acpCtxIsValid(ctx)) {
|
||||
ACP_CTX_CAST(ctx)->sock = socketfd;
|
||||
}
|
||||
}
|
||||
|
||||
int acpGetLastPeerSocketFd(acpCtx_t ctx)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
return ACP_CTX_CAST(ctx)->lastPeer;
|
||||
}
|
||||
|
||||
void acpSetLastPeerSocketFd(acpCtx_t ctx, int socketfd)
|
||||
{
|
||||
if (acpCtxIsValid(ctx)) {
|
||||
ACP_CTX_CAST(ctx)->lastPeer = socketfd;
|
||||
}
|
||||
}
|
||||
|
||||
MSec_t acpGetSocketTimeout(void)
|
||||
{
|
||||
return _socketTimeout;
|
||||
}
|
||||
|
||||
int acpSetMsgId(acpCtx_t ctx, const char* name, int userMsgId)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return acpCtxSetMsgUserId(ACP_CTX_CAST(ctx), name, userMsgId);
|
||||
}
|
||||
|
||||
int acpSetMsgIdFromLocalId(acpCtx_t ctx, enum acpMsgLocalId localMsgId, int userMsgId)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
|
||||
return acpCtxSetMsgUserIdById(ACP_CTX_CAST(ctx), localMsgId, userMsgId);
|
||||
}
|
||||
|
||||
const char* acpGetMsgName(size_t size, const unsigned char* buffer)
|
||||
{
|
||||
if (size < ACP_HEADER_SIZE) {
|
||||
return "INVALID_HEADER";
|
||||
}
|
||||
int type = (int)((buffer[4] << 24) | (buffer[5] << 16) | (buffer[6] << 8) | (buffer[7]));
|
||||
return acpCtxGetMsgNameFromId(type);
|
||||
}
|
||||
314
openair3/SS/Sidl/lib/acp/src/acpCtx.c
Normal file
314
openair3/SS/Sidl/lib/acp/src/acpCtx.c
Normal file
@@ -0,0 +1,314 @@
|
||||
/*
|
||||
* 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 <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
// Internal includes
|
||||
#include "acpCtx.h"
|
||||
#include "acpMem.h"
|
||||
#include "acpIdMap.h"
|
||||
#include "adbg.h"
|
||||
|
||||
// Definitions
|
||||
#define ACP_USER_ID_DEFAULT_MAP_SIZE 8
|
||||
|
||||
// Use assert if the interface in ACP host package doesn't match the interface on server
|
||||
// #define ACP_ASSERT_INTERFACE_MISMATCH
|
||||
|
||||
// Static variables
|
||||
static struct acpCtx _contexts[ACP_MAX_CTX_QTY];
|
||||
|
||||
void acpCtxInit(void)
|
||||
{
|
||||
ACP_DEBUG_ENTER_LOG();
|
||||
ACP_DEBUG_LOG("Clearing the context pool");
|
||||
memset(_contexts, 0, sizeof(_contexts));
|
||||
ACP_DEBUG_EXIT_LOG(NULL);
|
||||
}
|
||||
|
||||
acpCtx_t acpTakeCtx(void)
|
||||
{
|
||||
ACP_DEBUG_ENTER_LOG();
|
||||
for (int index = 0; index < ACP_MAX_CTX_QTY; index++) {
|
||||
if (!_contexts[index].ptr) {
|
||||
_contexts[index].ptr = &_contexts[index];
|
||||
_contexts[index].arena = NULL;
|
||||
_contexts[index].aSize = 0;
|
||||
_contexts[index].isServer = false;
|
||||
_contexts[index].handle = NULL;
|
||||
_contexts[index].sHandle = NULL;
|
||||
_contexts[index].sock = -1;
|
||||
for (int peer = 0; peer < ACP_MAX_PEER_QTY; peer++) {
|
||||
_contexts[index].peers[peer] = -1;
|
||||
_contexts[index].peersHandshaked[peer] = 0;
|
||||
}
|
||||
_contexts[index].peersSize = 0;
|
||||
_contexts[index].lastPeer = -1;
|
||||
_contexts[index].userIdMap = (struct acpUserService*)acpMalloc(ACP_USER_ID_DEFAULT_MAP_SIZE * sizeof(struct acpUserService));
|
||||
SIDL_ASSERT(_contexts[index].userIdMap);
|
||||
_contexts[index].userIdMapMaxSize = ACP_USER_ID_DEFAULT_MAP_SIZE;
|
||||
_contexts[index].userIdMapSize = 0;
|
||||
|
||||
_contexts[index].logger = NULL;
|
||||
_contexts[index].logBuf = NULL;
|
||||
_contexts[index].logBufMaxSize = 0;
|
||||
_contexts[index].logBufSize = 0;
|
||||
_contexts[index].logFormat = false;
|
||||
_contexts[index].logFormatBuf = NULL;
|
||||
_contexts[index].logFormatBufMaxSize = 0;
|
||||
|
||||
ACP_DEBUG_LOG("Adding a new context: index=%d, _contexts[%d].ptr=%p", index, index, _contexts[index].ptr);
|
||||
ACP_DEBUG_EXIT_LOG(NULL);
|
||||
return &_contexts[index];
|
||||
}
|
||||
}
|
||||
ACP_DEBUG_EXIT_LOG(NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void acpGiveCtx(acpCtx_t ctx)
|
||||
{
|
||||
ACP_DEBUG_ENTER_LOG();
|
||||
for (int index = 0; index < ACP_MAX_CTX_QTY; index++) {
|
||||
if (_contexts[index].ptr == ctx) {
|
||||
ACP_DEBUG_LOG("Clearing the context: index=%d, _contexts[%d].ptr=%p", index, index, _contexts[index].ptr);
|
||||
_contexts[index].ptr = NULL;
|
||||
if (_contexts[index].arena) {
|
||||
acpFree(_contexts[index].arena);
|
||||
}
|
||||
if (_contexts[index].userIdMap) {
|
||||
acpFree(_contexts[index].userIdMap);
|
||||
}
|
||||
|
||||
if (_contexts[index].logBuf) {
|
||||
acpFree(_contexts[index].logBuf);
|
||||
}
|
||||
if (_contexts[index].logFormatBuf) {
|
||||
acpFree(_contexts[index].logFormatBuf);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
ACP_DEBUG_EXIT_LOG(NULL);
|
||||
}
|
||||
|
||||
const char* acpCtxGetItfNameFrom_localId(int id)
|
||||
{
|
||||
int itf_id = (id >> 8) & 0xFF;
|
||||
|
||||
for (unsigned int i = 0; i < acpItfMapSize; i++) {
|
||||
if (acpItfMap[i].id == itf_id) {
|
||||
return acpItfMap[i].name;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int acpGetIndexFrom_localId_name(int id, const char* name)
|
||||
{
|
||||
static int last_itf_id_index = 0;
|
||||
|
||||
// FIXME: how to handle SIDL_PUBLIC_SERVICES
|
||||
if ((id & 0xF0000000) != 0x90000000) {
|
||||
return -ACP_ERR_UNKNOWN_SERVICE_NAME;
|
||||
}
|
||||
|
||||
int itf_id = (id >> 8) & 0xFF;
|
||||
|
||||
if (acpItfMap[last_itf_id_index].id != itf_id) {
|
||||
for (unsigned int i = 0; i < acpItfMapSize; i++) {
|
||||
if (acpItfMap[i].id == itf_id) {
|
||||
last_itf_id_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (last_itf_id_index == (int)acpItfMapSize) {
|
||||
last_itf_id_index = 0;
|
||||
return -ACP_ERR_UNKNOWN_SERVICE_NAME;
|
||||
}
|
||||
|
||||
int service_id_index = acpItfMap[last_itf_id_index].startIndex + (id & 0xFF);
|
||||
|
||||
// This is just to check that the current server service matches the generated one
|
||||
if (name) {
|
||||
size_t remoteNameOffset = strlen(acpItfMap[last_itf_id_index].name);
|
||||
|
||||
do {
|
||||
if (service_id_index >= (int)acpIdMapSize) {
|
||||
#ifndef ACP_ASSERT_INTERFACE_MISMATCH
|
||||
service_id_index = -ACP_ERR_UNKNOWN_SERVICE_NAME;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
#ifndef ACP_ASSERT_INTERFACE_MISMATCH
|
||||
if (remoteNameOffset >= strlen(acpIdMap[service_id_index].name)) {
|
||||
service_id_index = -ACP_ERR_UNKNOWN_SERVICE_NAME;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
SIDL_ASSERT(remoteNameOffset < strlen(acpIdMap[service_id_index].name));
|
||||
#endif
|
||||
|
||||
const char* remoteName = acpIdMap[service_id_index].name + remoteNameOffset;
|
||||
int ret = strcasecmp(remoteName, name);
|
||||
#ifndef ACP_ASSERT_INTERFACE_MISMATCH
|
||||
if (ret != 0) {
|
||||
service_id_index = -ACP_ERR_UNKNOWN_SERVICE_NAME;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
SIDL_ASSERT(ret == 0);
|
||||
#endif
|
||||
} while (false);
|
||||
|
||||
// iterate interface to find the name
|
||||
if (service_id_index < 0) {
|
||||
unsigned int start = acpItfMap[last_itf_id_index].startIndex;
|
||||
unsigned int end = start + acpItfMap[last_itf_id_index].servicesQty;
|
||||
for (unsigned int i = start; i < end; i++) {
|
||||
if (remoteNameOffset >= strlen(acpIdMap[i].name)) {
|
||||
continue;
|
||||
}
|
||||
const char* remoteName = acpIdMap[i].name + remoteNameOffset;
|
||||
int ret = strcasecmp(remoteName, name);
|
||||
if (ret == 0) {
|
||||
service_id_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#ifndef ACP_ASSERT_INTERFACE_MISMATCH
|
||||
if (service_id_index >= (int)acpIdMapSize) {
|
||||
service_id_index = -ACP_ERR_UNKNOWN_SERVICE_NAME;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return service_id_index;
|
||||
}
|
||||
|
||||
static int acpGetIndexFrom_name(const char* name)
|
||||
{
|
||||
// TODO: better search
|
||||
for (unsigned int i = 0; i < acpIdMapSize; i++) {
|
||||
if (strcasecmp(acpIdMap[i].name, name) == 0) {
|
||||
return (int)i;
|
||||
}
|
||||
}
|
||||
return -ACP_ERR_UNKNOWN_SERVICE_NAME;
|
||||
}
|
||||
|
||||
int acpCtxGetMsgUserId(struct acpCtx* ctx, unsigned int type)
|
||||
{
|
||||
for (unsigned int i = 0; i < ctx->userIdMapSize; i++) {
|
||||
if (acpIdMap[ctx->userIdMap[i].id_index].remote_id == type) {
|
||||
return ctx->userIdMap[i].user_id;
|
||||
}
|
||||
}
|
||||
return -ACP_ERR_SERVICE_NOT_MAPPED;
|
||||
}
|
||||
|
||||
static int acpCtxSetMsgUserIdFromIndex(struct acpCtx* ctx, int index, int userId)
|
||||
{
|
||||
if (ctx->userIdMapSize == ctx->userIdMapMaxSize) {
|
||||
struct acpUserService* userIdMap = (struct acpUserService*)acpMalloc((ctx->userIdMapMaxSize + ACP_USER_ID_DEFAULT_MAP_SIZE) * sizeof(struct acpUserService));
|
||||
SIDL_ASSERT(userIdMap);
|
||||
|
||||
memcpy(userIdMap, ctx->userIdMap, ctx->userIdMapSize * sizeof(struct acpUserService));
|
||||
|
||||
acpFree(ctx->userIdMap);
|
||||
|
||||
ctx->userIdMap = userIdMap;
|
||||
ctx->userIdMapMaxSize += ACP_USER_ID_DEFAULT_MAP_SIZE;
|
||||
}
|
||||
|
||||
int userIdIndex = ctx->userIdMapSize++;
|
||||
|
||||
ctx->userIdMap[userIdIndex].user_id = userId;
|
||||
ctx->userIdMap[userIdIndex].id_index = index;
|
||||
acpIdMap[index].remote_id = acpIdMap[index].local_id; // TODO: implement
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int acpCtxSetMsgUserId(struct acpCtx* ctx, const char* name, int userId)
|
||||
{
|
||||
int index = acpGetIndexFrom_name(name);
|
||||
if (index < 0) return index;
|
||||
SIDL_ASSERT(index < (int)acpIdMapSize);
|
||||
|
||||
return acpCtxSetMsgUserIdFromIndex(ctx, index, userId);
|
||||
}
|
||||
|
||||
int acpCtxSetMsgUserIdById(struct acpCtx* ctx, enum acpMsgLocalId lid, int userId)
|
||||
{
|
||||
int index = acpGetIndexFrom_localId_name(lid, NULL);
|
||||
if (index < 0) return index;
|
||||
SIDL_ASSERT(index < (int)acpIdMapSize);
|
||||
|
||||
return acpCtxSetMsgUserIdFromIndex(ctx, index, userId);
|
||||
}
|
||||
|
||||
bool acpCtxIsValid(acpCtx_t ctx)
|
||||
{
|
||||
struct acpCtx* c = ACP_CTX_CAST(ctx);
|
||||
if (c && (c->ptr == ctx)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int acpCtxResolveId(int id, const char* name)
|
||||
{
|
||||
int index = acpGetIndexFrom_localId_name(id, name);
|
||||
if (index < 0) return index;
|
||||
SIDL_ASSERT(index < (int)acpIdMapSize);
|
||||
|
||||
acpIdMap[index].remote_id = id;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
const char* acpCtxGetMsgNameFromId(int id)
|
||||
{
|
||||
if (id == (int)ACP_SERVICE_PUSH_TYPE) return "SERVICE_PUSH";
|
||||
int index = acpGetIndexFrom_localId_name(id, NULL);
|
||||
if (index < 0 || index >= (int)acpIdMapSize) return "UNKNOWN";
|
||||
return acpIdMap[index].name;
|
||||
}
|
||||
|
||||
int acpCtxGetMsgKindFromId(int id)
|
||||
{
|
||||
if (id == (int)ACP_SERVICE_PUSH_TYPE) return -1;
|
||||
int index = acpGetIndexFrom_localId_name(id, NULL);
|
||||
if (index < 0 || index >= (int)acpIdMapSize) return -ACP_ERR_SIDL_FAILURE;
|
||||
return acpIdMap[index].kind;
|
||||
}
|
||||
|
||||
|
||||
int acpCtxGetMsgKindFromName(const char* name)
|
||||
{
|
||||
int id = acpGetIndexFrom_name(name);
|
||||
if (id < 0) return id;
|
||||
return acpIdMap[id].kind;
|
||||
}
|
||||
75
openair3/SS/Sidl/lib/acp/src/acpDrb.c
Normal file
75
openair3/SS/Sidl/lib/acp/src/acpDrb.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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 "acpDrb.h"
|
||||
#include "acpCtx.h"
|
||||
#include "acpProto.h"
|
||||
#include "acpMsgIds.h"
|
||||
#include "serDrb.h"
|
||||
|
||||
int acpDrbProcessFromSSEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct DRB_COMMON_REQ* FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serDrbProcessFromSSEncClt(_buffer, *_size, &_lidx, FromSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_DrbProcessFromSS, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpDrbProcessFromSSDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct DRB_COMMON_REQ** FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serDrbProcessFromSSDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, FromSS);
|
||||
}
|
||||
|
||||
void acpDrbProcessFromSSFreeSrv(struct DRB_COMMON_REQ* FromSS)
|
||||
{
|
||||
serDrbProcessFromSSFreeSrv(FromSS);
|
||||
}
|
||||
|
||||
int acpDrbProcessToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct DRB_COMMON_IND* ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serDrbProcessToSSEncSrv(_buffer, *_size, &_lidx, ToSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_DrbProcessToSS, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpDrbProcessToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct DRB_COMMON_IND** ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serDrbProcessToSSDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, ToSS);
|
||||
}
|
||||
|
||||
void acpDrbProcessToSSFreeClt(struct DRB_COMMON_IND* ToSS)
|
||||
{
|
||||
serDrbProcessToSSFreeClt(ToSS);
|
||||
}
|
||||
75
openair3/SS/Sidl/lib/acp/src/acpHandshake.c
Normal file
75
openair3/SS/Sidl/lib/acp/src/acpHandshake.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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 "acpHandshake.h"
|
||||
#include "acpCtx.h"
|
||||
#include "acpProto.h"
|
||||
#include "acpMsgIds.h"
|
||||
#include "serHandshake.h"
|
||||
|
||||
int acpHandshakeHandleFromSSEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct AcpHandshake_Type* fromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serHandshakeHandleFromSSEncClt(_buffer, *_size, &_lidx, fromSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_HandshakeHandleFromSS, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpHandshakeHandleFromSSDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct AcpHandshake_Type** fromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serHandshakeHandleFromSSDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, fromSS);
|
||||
}
|
||||
|
||||
void acpHandshakeHandleFromSSFreeSrv(struct AcpHandshake_Type* fromSS)
|
||||
{
|
||||
serHandshakeHandleFromSSFreeSrv(fromSS);
|
||||
}
|
||||
|
||||
int acpHandshakeHandleToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct AcpHandshakeRsp_Type* toSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serHandshakeHandleToSSEncSrv(_buffer, *_size, &_lidx, toSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_HandshakeHandleToSS, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpHandshakeHandleToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct AcpHandshakeRsp_Type** toSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serHandshakeHandleToSSDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, toSS);
|
||||
}
|
||||
|
||||
void acpHandshakeHandleToSSFreeClt(struct AcpHandshakeRsp_Type* toSS)
|
||||
{
|
||||
serHandshakeHandleToSSFreeClt(toSS);
|
||||
}
|
||||
77
openair3/SS/Sidl/lib/acp/src/acpIdMap.c
Normal file
77
openair3/SS/Sidl/lib/acp/src/acpIdMap.c
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* 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 "acpIdMap.h"
|
||||
|
||||
const struct acpIdMapItf acpItfMap[] = {
|
||||
{ "Test", 1, 0, 7 },
|
||||
{ "Sys", 2, 7, 1 },
|
||||
{ "SysVT", 3, 8, 2 },
|
||||
{ "Srb", 4, 10, 2 },
|
||||
{ "Vng", 5, 12, 1 },
|
||||
{ "Drb", 6, 13, 2 },
|
||||
{ "Handshake", 7, 15, 2 },
|
||||
{ "SysInd", 8, 17, 1 },
|
||||
{ "NrSysSrb", 9, 18, 2 },
|
||||
};
|
||||
|
||||
const unsigned int acpItfMapSize = sizeof(acpItfMap) / sizeof(acpItfMap[0]);
|
||||
|
||||
// local_id (second field) has the following format:
|
||||
// 0x9004XXYY,
|
||||
// where XX is the interface number (from acpItfMap second field),
|
||||
// and YY is the number of service (sequence of 00..NN) in the interface.
|
||||
struct acpIdMapService acpIdMap[] = {
|
||||
// Test part
|
||||
{ "TestHelloFromSS", 0x90040100, (unsigned int)-1, 1 },
|
||||
{ "TestHelloToSS", 0x90040101, (unsigned int)-1, 0 },
|
||||
{ "TestPing", 0x90040102, (unsigned int)-1, 2 },
|
||||
{ "TestEcho", 0x90040103, (unsigned int)-1, 2 },
|
||||
{ "TestTest1", 0x90040104, (unsigned int)-1, 2 },
|
||||
{ "TestTest2", 0x90040105, (unsigned int)-1, 2 },
|
||||
{ "TestOther", 0x90040106, (unsigned int)-1, 2 },
|
||||
|
||||
// Sys part
|
||||
{ "SysProcess", 0x90040200, (unsigned int)-1, 2 },
|
||||
|
||||
// SysVT (internal) part
|
||||
{ "SysVTEnquireTimingAck", 0x90040300, (unsigned int)-1, 1 },
|
||||
{ "SysVTEnquireTimingUpd", 0x90040301, (unsigned int)-1, 0 },
|
||||
|
||||
// SysSrb part
|
||||
{ "SysSrbProcessFromSS", 0x90040400, (unsigned int)-1, 1 },
|
||||
{ "SysSrbProcessToSS", 0x90040401, (unsigned int)-1, 0 },
|
||||
|
||||
// Vng part
|
||||
{ "VngProcess", 0x90040500, (unsigned int)-1, 2 },
|
||||
|
||||
// Drb part
|
||||
{ "DrbProcessFromSS", 0x90040600, (unsigned int)-1, 1 },
|
||||
{ "DrbProcessToSS", 0x90040601, (unsigned int)-1, 0 },
|
||||
|
||||
// Handshake (internale) part
|
||||
{ "HandshakeHandleFromSS", 0x90040700, (unsigned int)-1, 1 },
|
||||
{ "HandshakeHandleToSS", 0x90040701, (unsigned int)-1, 0 },
|
||||
|
||||
// SysInd part
|
||||
{ "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]);
|
||||
21
openair3/SS/Sidl/lib/acp/src/acpInternal.c
Normal file
21
openair3/SS/Sidl/lib/acp/src/acpInternal.c
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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 "acpInternal.h"
|
||||
|
||||
#include "acpProto.h"
|
||||
|
||||
#include "acpMsgIds.h"
|
||||
79
openair3/SS/Sidl/lib/acp/src/acpProto.c
Normal file
79
openair3/SS/Sidl/lib/acp/src/acpProto.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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 <stdint.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
// Internal includes
|
||||
#include "acpProto.h"
|
||||
#include "acpCtx.h"
|
||||
|
||||
void acpProcessPushMsg(acpCtx_t ctx, size_t size, const unsigned char* buffer)
|
||||
{
|
||||
struct acpCtx* c = ACP_CTX_CAST(ctx);
|
||||
|
||||
c->handle = (void*)(uintptr_t)((buffer[8] << 24) | (buffer[9] << 16) | (buffer[10] << 8) | (buffer[11]));
|
||||
|
||||
size -= ACP_HEADER_SIZE;
|
||||
|
||||
struct acpWklmServicePushMessage* m = (struct acpWklmServicePushMessage*)&buffer[ACP_HEADER_SIZE];
|
||||
|
||||
size_t serviceQty = ntohl(m->serviceQty);
|
||||
const uint8_t* p = (uint8_t*)m + 4;
|
||||
size_t offset = 0;
|
||||
size -= 4;
|
||||
for (size_t i = 0; i < serviceQty; i++) {
|
||||
const struct acpWklmService* s = (struct acpWklmService*)&p[offset];
|
||||
const char* name = (char*)&p[offset + 4];
|
||||
|
||||
offset += 4;
|
||||
while ((offset < size) && p[offset]) {
|
||||
offset++;
|
||||
}
|
||||
offset++;
|
||||
if (offset >= size) {
|
||||
break;
|
||||
}
|
||||
acpCtxResolveId(ntohl(s->id), name);
|
||||
}
|
||||
}
|
||||
|
||||
void acpBuildHeader(acpCtx_t ctx, unsigned int type, size_t size, unsigned char* buffer)
|
||||
{
|
||||
struct acpCtx* c = ACP_CTX_CAST(ctx);
|
||||
|
||||
uint32_t handle = (uint32_t)(uintptr_t)(c->sHandle ? c->sHandle : c->handle);
|
||||
uint32_t status = 0;
|
||||
|
||||
size_t payloadSize = size - ACP_HEADER_SIZE; // payload size
|
||||
|
||||
buffer[0] = 0x01;
|
||||
buffer[1] = 0x06;
|
||||
buffer[2] = (payloadSize >> 8) & 0xFF;
|
||||
buffer[3] = payloadSize & 0xFF;
|
||||
buffer[4] = (type >> 24) & 0xFF;
|
||||
buffer[5] = (type >> 16) & 0xFF;
|
||||
buffer[6] = (type >> 8) & 0xFF;
|
||||
buffer[7] = type & 0xFF;
|
||||
buffer[8] = (handle >> 24) & 0xFF;
|
||||
buffer[9] = (handle >> 16) & 0xFF;
|
||||
buffer[10] = (handle >> 8) & 0xFF;
|
||||
buffer[11] = handle & 0xFF;
|
||||
buffer[12] = (status >> 24) & 0xFF;
|
||||
buffer[13] = (status >> 16) & 0xFF;
|
||||
buffer[14] = (status >> 8) & 0xFF;
|
||||
buffer[15] = status & 0xFF;
|
||||
}
|
||||
47
openair3/SS/Sidl/lib/acp/src/acpProto.h
Normal file
47
openair3/SS/Sidl/lib/acp/src/acpProto.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// System includes
|
||||
#include <stdbool.h>
|
||||
|
||||
// Internal includes
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct acpWklmService {
|
||||
unsigned int id; // Service ID
|
||||
/*const char name[];*/ // NULL terminated service name
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct acpWklmServicePushMessage {
|
||||
unsigned int serviceQty; // Number of pushed services
|
||||
/*struct dcxWklmService services[];*/ // Array of services
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
/** Process push message and resolve ids. */
|
||||
void acpProcessPushMsg(acpCtx_t ctx, size_t size, const unsigned char* buffer);
|
||||
|
||||
/** Add ACP header in the begining of the buffer. */
|
||||
void acpBuildHeader(acpCtx_t ctx, unsigned int type, size_t size, unsigned char* buffer);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
505
openair3/SS/Sidl/lib/acp/src/acpSocket.c
Normal file
505
openair3/SS/Sidl/lib/acp/src/acpSocket.c
Normal file
@@ -0,0 +1,505 @@
|
||||
/*
|
||||
* 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 <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
// Internal includes
|
||||
#include "acpSocket.h"
|
||||
#include "adbg.h"
|
||||
|
||||
int acpSocketConnect(IpAddress_t ipaddr, int port)
|
||||
{
|
||||
ACP_DEBUG_ENTER_LOG();
|
||||
|
||||
struct sockaddr_in sin;
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(port);
|
||||
sin.sin_addr.s_addr = ntohl(ipaddr.v.ipv4);
|
||||
int client_fd = -1;
|
||||
int sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (sock < 0) {
|
||||
ACP_DEBUG_EXIT_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Configure KEEPALIVE
|
||||
const int keepalive = 1;
|
||||
const int keepalive_time = 30;
|
||||
const int keepalive_intvl = 2;
|
||||
const int keepalive_probes = 5;
|
||||
const int syn_retries = 2; // Send a total of 3 SYN packets => Timeout ~7s
|
||||
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &keepalive, (socklen_t)sizeof(keepalive)) == -1) {
|
||||
goto _error;
|
||||
}
|
||||
if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPIDLE, &keepalive_time, (socklen_t)sizeof(keepalive_time)) == -1) {
|
||||
goto _error;
|
||||
}
|
||||
if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPINTVL, &keepalive_intvl, (socklen_t)sizeof(keepalive_intvl)) == -1) {
|
||||
goto _error;
|
||||
}
|
||||
if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPCNT, &keepalive_probes, (socklen_t)sizeof(keepalive_probes)) == -1) {
|
||||
goto _error;
|
||||
}
|
||||
|
||||
if (setsockopt(sock, IPPROTO_TCP, TCP_SYNCNT, &syn_retries, (socklen_t)sizeof(syn_retries)) == -1) {
|
||||
goto _error;
|
||||
}
|
||||
|
||||
client_fd = connect(sock, (struct sockaddr*)&sin, sizeof(sin));
|
||||
if (client_fd == -1) {
|
||||
int myerrno = errno;
|
||||
if (myerrno == EINPROGRESS || myerrno == EAGAIN) {
|
||||
fd_set fdset;
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(sock, &fdset);
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = 2;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
if (select(sock + 1, NULL, &fdset, NULL, &tv) == 1) {
|
||||
socklen_t optlen = sizeof(int);
|
||||
int valopt;
|
||||
if ((getsockopt(sock, SOL_SOCKET, SO_ERROR, (void*)&valopt, &optlen) == 0) && !valopt) {
|
||||
ACP_DEBUG_LOG("Connected to server: %s:%d", inet_ntoa(sin.sin_addr), port);
|
||||
ACP_DEBUG_EXIT_LOG(NULL);
|
||||
return sock;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (myerrno) {
|
||||
goto _error;
|
||||
}
|
||||
}
|
||||
|
||||
int arg = fcntl(sock, F_GETFL, NULL);
|
||||
arg |= O_NONBLOCK;
|
||||
fcntl(sock, F_SETFL, arg);
|
||||
|
||||
ACP_DEBUG_LOG("Connected to server: %s:%d", inet_ntoa(sin.sin_addr), port);
|
||||
ACP_DEBUG_EXIT_LOG(NULL);
|
||||
return sock;
|
||||
|
||||
_error:
|
||||
close(sock);
|
||||
ACP_DEBUG_EXIT_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
int acpSocketListen(IpAddress_t ipaddr, int port)
|
||||
{
|
||||
ACP_DEBUG_ENTER_LOG();
|
||||
|
||||
struct sockaddr_in sin;
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(port);
|
||||
sin.sin_addr.s_addr = ntohl(ipaddr.v.ipv4);
|
||||
|
||||
int sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (sock < 0) {
|
||||
ACP_DEBUG_EXIT_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Configure KEEPALIVE
|
||||
const int keepalive = 1;
|
||||
const int keepalive_time = 30;
|
||||
const int keepalive_intvl = 2;
|
||||
const int keepalive_probes = 5;
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &keepalive, (socklen_t)sizeof(keepalive)) == -1) {
|
||||
close(sock);
|
||||
ACP_DEBUG_EXIT_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPIDLE, &keepalive_time, (socklen_t)sizeof(keepalive_time)) == -1) {
|
||||
close(sock);
|
||||
ACP_DEBUG_EXIT_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPINTVL, &keepalive_intvl, (socklen_t)sizeof(keepalive_intvl)) == -1) {
|
||||
close(sock);
|
||||
ACP_DEBUG_EXIT_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
if (setsockopt(sock, IPPROTO_TCP, TCP_KEEPCNT, &keepalive_probes, (socklen_t)sizeof(keepalive_probes)) == -1) {
|
||||
close(sock);
|
||||
ACP_DEBUG_EXIT_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
const int reuse = 1;
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &reuse, (socklen_t)sizeof(reuse)) == -1) {
|
||||
close(sock);
|
||||
ACP_DEBUG_EXIT_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
int arg = fcntl(sock, F_GETFL, NULL);
|
||||
arg |= O_NONBLOCK;
|
||||
fcntl(sock, F_SETFL, arg);
|
||||
|
||||
if (bind(sock, (struct sockaddr*)&sin, sizeof(sin)) == -1) {
|
||||
int myerrno = errno;
|
||||
if (myerrno == EINPROGRESS) {
|
||||
fd_set fdset;
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(sock, &fdset);
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = 2;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
if (select(sock + 1, NULL, &fdset, NULL, &tv) == 1) {
|
||||
socklen_t optlen = sizeof(int);
|
||||
int valopt;
|
||||
if ((getsockopt(sock, SOL_SOCKET, SO_ERROR, (void*)&valopt, &optlen) == 0) && !valopt) {
|
||||
return sock;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(sock);
|
||||
ACP_DEBUG_EXIT_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (listen(sock, 3) == -1) {
|
||||
close(sock);
|
||||
ACP_DEBUG_EXIT_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
ACP_DEBUG_EXIT_LOG(NULL);
|
||||
return sock;
|
||||
}
|
||||
|
||||
int acpSocketSelect(int sock, MSec_t socketTimeout)
|
||||
{
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_ENTER_TRACE_LOG();
|
||||
#endif
|
||||
|
||||
if (sock < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG("invalid socket argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int attemps = 3;
|
||||
int available;
|
||||
|
||||
do {
|
||||
fd_set fdset;
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(sock, &fdset);
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = socketTimeout / 1000;
|
||||
tv.tv_usec = (socketTimeout % 1000) * 1000;
|
||||
|
||||
available = select(sock + 1, &fdset, NULL, NULL, &tv);
|
||||
if (available < 0) {
|
||||
if ((errno == EINTR) || (errno == EAGAIN)) {
|
||||
available = 0;
|
||||
} else {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
if (--attemps <= 0) break;
|
||||
|
||||
} while (available == 0);
|
||||
|
||||
if (available == 0) {
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(NULL);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(NULL);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
int acpSocketSelectMulti(int* sock, MSec_t socketTimeout, size_t peersSize, int* peers)
|
||||
{
|
||||
SIDL_ASSERT(sock);
|
||||
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_ENTER_TRACE_LOG();
|
||||
#endif
|
||||
|
||||
if (*sock < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG("invalid socket argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int attemps = 3;
|
||||
int available;
|
||||
|
||||
fd_set fdset;
|
||||
|
||||
do {
|
||||
FD_ZERO(&fdset);
|
||||
|
||||
int maxSock = 0;
|
||||
|
||||
if (*sock != -1) {
|
||||
FD_SET(*sock, &fdset);
|
||||
maxSock = *sock;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < peersSize; i++) {
|
||||
if (peers[i] != -1) {
|
||||
FD_SET(peers[i], &fdset);
|
||||
if (peers[i] > maxSock) {
|
||||
maxSock = peers[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = socketTimeout / 1000;
|
||||
tv.tv_usec = (socketTimeout % 1000) * 1000;
|
||||
|
||||
available = select(maxSock + 1, &fdset, NULL, NULL, &tv);
|
||||
if (available < 0) {
|
||||
if ((errno == EINTR) || (errno == EAGAIN)) {
|
||||
available = 0;
|
||||
} else {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
if (--attemps <= 0) break;
|
||||
|
||||
} while (available == 0);
|
||||
|
||||
if (available == 0) {
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(NULL);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int retSock = -1;
|
||||
|
||||
if (*sock != -1 && FD_ISSET(*sock, &fdset)) {
|
||||
retSock = *sock;
|
||||
} else {
|
||||
for (size_t i = 0; i < peersSize; i++) {
|
||||
if (peers[i] != -1 && FD_ISSET(peers[i], &fdset)) {
|
||||
retSock = peers[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SIDL_ASSERT(retSock != -1);
|
||||
*sock = retSock;
|
||||
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(NULL);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
int acpSocketAccept(int sock)
|
||||
{
|
||||
struct sockaddr_in sin;
|
||||
int sinSize = sizeof(struct sockaddr_in);
|
||||
return accept(sock, (struct sockaddr*)&sin, (socklen_t*)&sinSize);
|
||||
}
|
||||
|
||||
int acpSocketSend(int sock, size_t size, const unsigned char* buffer)
|
||||
{
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_ENTER_TRACE_LOG();
|
||||
#endif
|
||||
|
||||
if (sock < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG("invalid socket argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t index = 0;
|
||||
size_t dataToWrite = size;
|
||||
|
||||
do {
|
||||
ssize_t bytes = send(sock, buffer + index, dataToWrite, MSG_DONTWAIT);
|
||||
if (bytes <= 0) {
|
||||
int err = errno;
|
||||
if ((bytes < 0) && (err == EPIPE)) {
|
||||
// TODO: fix infinite loop between select() > 0 and send() <= 0
|
||||
} else if (bytes < 0) {
|
||||
if ((err != EAGAIN) && (err != EPIPE)) {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if ((bytes == 0) || (err == EAGAIN)) {
|
||||
fd_set fdset;
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(sock, &fdset);
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
int ret = select(sock + 1, NULL, &fdset, NULL, &tv);
|
||||
if (ret > 0) {
|
||||
continue;
|
||||
} else if (ret == 0) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
index += bytes;
|
||||
dataToWrite = size - (size_t)index;
|
||||
|
||||
} while ((size_t)index < size);
|
||||
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(NULL);
|
||||
#endif
|
||||
return (int)(size - dataToWrite);
|
||||
}
|
||||
|
||||
int acpSocketReceive(int sock, size_t size, unsigned char* buffer, MSec_t socketTimeout, bool* disconnected)
|
||||
{
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_ENTER_TRACE_LOG();
|
||||
#endif
|
||||
|
||||
if (sock < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG("invalid socket argument");
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t bytes = 0;
|
||||
int available = 0;
|
||||
|
||||
if (disconnected) {
|
||||
*disconnected = false;
|
||||
}
|
||||
|
||||
while ((size_t)bytes < size) {
|
||||
int attemps = 3;
|
||||
|
||||
do {
|
||||
fd_set fdset;
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(sock, &fdset);
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = socketTimeout / 1000;
|
||||
tv.tv_usec = (socketTimeout % 1000) * 1000;
|
||||
|
||||
available = select(sock + 1, &fdset, NULL, NULL, &tv);
|
||||
if (available < 0) {
|
||||
if ((errno == EINTR) || (errno == EAGAIN)) {
|
||||
available = 0;
|
||||
} else {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
if (--attemps <= 0) break;
|
||||
|
||||
} while (available == 0);
|
||||
|
||||
if (available == 0) {
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(NULL);
|
||||
#endif
|
||||
return bytes;
|
||||
}
|
||||
|
||||
ssize_t ret = recv(sock, buffer + bytes, size - bytes, 0);
|
||||
if (disconnected) {
|
||||
if (ret == 0) {
|
||||
*disconnected = true;
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(NULL);
|
||||
return 0;
|
||||
} else if (ret < 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (ret <= 0) {
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
bytes += ret;
|
||||
}
|
||||
|
||||
#ifdef ACP_DEBUG_TRACE_FLOOD
|
||||
ACP_DEBUG_EXIT_TRACE_LOG(NULL);
|
||||
#endif
|
||||
return (int)bytes;
|
||||
}
|
||||
|
||||
int acpSocketClose(int sock)
|
||||
{
|
||||
return sock >= 0 ? close(sock) : -1;
|
||||
}
|
||||
|
||||
bool acpConvertIp(const char* ipstr, IpAddress_t* ipaddr)
|
||||
{
|
||||
unsigned int b0, b1, b2, b3;
|
||||
|
||||
int count = sscanf(ipstr, "%u.%u.%u.%u", &b0, &b1, &b2, &b3);
|
||||
|
||||
if (count == 4) {
|
||||
ipaddr->d = IP_V4;
|
||||
if (b0 > 255 || b1 > 255 || b2 > 255 || b3 > 255) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ipaddr->v.ipv4 = ((Ip4Address_t)(b0 & 0xFF) << 24 |
|
||||
(Ip4Address_t)(b1 & 0xFF) << 16 |
|
||||
(Ip4Address_t)(b2 & 0xFF) << 8 |
|
||||
(Ip4Address_t)(b3 & 0xFF) << 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
75
openair3/SS/Sidl/lib/acp/src/acpSys.c
Normal file
75
openair3/SS/Sidl/lib/acp/src/acpSys.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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 "acpSys.h"
|
||||
#include "acpCtx.h"
|
||||
#include "acpProto.h"
|
||||
#include "acpMsgIds.h"
|
||||
#include "serSys.h"
|
||||
|
||||
int acpSysProcessEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct SYSTEM_CTRL_REQ* FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serSysProcessEncClt(_buffer, *_size, &_lidx, FromSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_SysProcess, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpSysProcessDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct SYSTEM_CTRL_REQ** FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serSysProcessDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, FromSS);
|
||||
}
|
||||
|
||||
void acpSysProcessFreeSrv(struct SYSTEM_CTRL_REQ* FromSS)
|
||||
{
|
||||
serSysProcessFreeSrv(FromSS);
|
||||
}
|
||||
|
||||
int acpSysProcessEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct SYSTEM_CTRL_CNF* ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serSysProcessEncSrv(_buffer, *_size, &_lidx, ToSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_SysProcess, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpSysProcessDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct SYSTEM_CTRL_CNF** ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serSysProcessDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, ToSS);
|
||||
}
|
||||
|
||||
void acpSysProcessFreeClt(struct SYSTEM_CTRL_CNF* ToSS)
|
||||
{
|
||||
serSysProcessFreeClt(ToSS);
|
||||
}
|
||||
48
openair3/SS/Sidl/lib/acp/src/acpSysInd.c
Normal file
48
openair3/SS/Sidl/lib/acp/src/acpSysInd.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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 "acpSysInd.h"
|
||||
#include "acpCtx.h"
|
||||
#include "acpProto.h"
|
||||
#include "acpMsgIds.h"
|
||||
#include "serSysInd.h"
|
||||
|
||||
int acpSysIndProcessToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct SYSTEM_IND* ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serSysIndProcessToSSEncSrv(_buffer, *_size, &_lidx, ToSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_SysIndProcessToSS, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpSysIndProcessToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct SYSTEM_IND** ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serSysIndProcessToSSDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, ToSS);
|
||||
}
|
||||
|
||||
void acpSysIndProcessToSSFreeClt(struct SYSTEM_IND* ToSS)
|
||||
{
|
||||
serSysIndProcessToSSFreeClt(ToSS);
|
||||
}
|
||||
75
openair3/SS/Sidl/lib/acp/src/acpSysSrb.c
Normal file
75
openair3/SS/Sidl/lib/acp/src/acpSysSrb.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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 "acpSysSrb.h"
|
||||
#include "acpCtx.h"
|
||||
#include "acpProto.h"
|
||||
#include "acpMsgIds.h"
|
||||
#include "serSysSrb.h"
|
||||
|
||||
int acpSysSrbProcessToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EUTRA_RRC_PDU_IND* ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serSysSrbProcessToSSEncSrv(_buffer, *_size, &_lidx, ToSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_SysSrbProcessToSS, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpSysSrbProcessToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EUTRA_RRC_PDU_IND** ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serSysSrbProcessToSSDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, ToSS);
|
||||
}
|
||||
|
||||
void acpSysSrbProcessToSSFreeClt(struct EUTRA_RRC_PDU_IND* ToSS)
|
||||
{
|
||||
serSysSrbProcessToSSFreeClt(ToSS);
|
||||
}
|
||||
|
||||
int acpSysSrbProcessFromSSEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EUTRA_RRC_PDU_REQ* FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serSysSrbProcessFromSSEncClt(_buffer, *_size, &_lidx, FromSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_SysSrbProcessFromSS, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpSysSrbProcessFromSSDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EUTRA_RRC_PDU_REQ** FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serSysSrbProcessFromSSDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, FromSS);
|
||||
}
|
||||
|
||||
void acpSysSrbProcessFromSSFreeSrv(struct EUTRA_RRC_PDU_REQ* FromSS)
|
||||
{
|
||||
serSysSrbProcessFromSSFreeSrv(FromSS);
|
||||
}
|
||||
75
openair3/SS/Sidl/lib/acp/src/acpSysVT.c
Normal file
75
openair3/SS/Sidl/lib/acp/src/acpSysVT.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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 "acpSysVT.h"
|
||||
#include "acpCtx.h"
|
||||
#include "acpProto.h"
|
||||
#include "acpMsgIds.h"
|
||||
#include "serSysVT.h"
|
||||
|
||||
int acpSysVTEnquireTimingUpdEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct VirtualTimeInfo_Type* TimingInfoToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serSysVTEnquireTimingUpdEncSrv(_buffer, *_size, &_lidx, TimingInfoToSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_SysVTEnquireTimingUpd, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpSysVTEnquireTimingUpdDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct VirtualTimeInfo_Type** TimingInfoToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serSysVTEnquireTimingUpdDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, TimingInfoToSS);
|
||||
}
|
||||
|
||||
void acpSysVTEnquireTimingUpdFreeClt(struct VirtualTimeInfo_Type* TimingInfoToSS)
|
||||
{
|
||||
serSysVTEnquireTimingUpdFreeClt(TimingInfoToSS);
|
||||
}
|
||||
|
||||
int acpSysVTEnquireTimingAckEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct VirtualTimeInfo_Type* TimingInfoFromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serSysVTEnquireTimingAckEncClt(_buffer, *_size, &_lidx, TimingInfoFromSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_SysVTEnquireTimingAck, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpSysVTEnquireTimingAckDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct VirtualTimeInfo_Type** TimingInfoFromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serSysVTEnquireTimingAckDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, TimingInfoFromSS);
|
||||
}
|
||||
|
||||
void acpSysVTEnquireTimingAckFreeSrv(struct VirtualTimeInfo_Type* TimingInfoFromSS)
|
||||
{
|
||||
serSysVTEnquireTimingAckFreeSrv(TimingInfoFromSS);
|
||||
}
|
||||
281
openair3/SS/Sidl/lib/acp/src/acpTest.c
Normal file
281
openair3/SS/Sidl/lib/acp/src/acpTest.c
Normal file
@@ -0,0 +1,281 @@
|
||||
/*
|
||||
* 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 "acpTest.h"
|
||||
#include "acpCtx.h"
|
||||
#include "acpProto.h"
|
||||
#include "acpMsgIds.h"
|
||||
#include "serTest.h"
|
||||
|
||||
int acpTestHelloFromSSEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, size_t StrQty, const char* StrArray)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serTestHelloFromSSEncClt(_buffer, *_size, &_lidx, StrQty, StrArray);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_TestHelloFromSS, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpTestHelloFromSSDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, size_t* StrQty, char** StrArray)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serTestHelloFromSSDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, StrQty, StrArray);
|
||||
}
|
||||
|
||||
void acpTestHelloFromSSFreeSrv(char* StrArray)
|
||||
{
|
||||
serTestHelloFromSSFreeSrv(StrArray);
|
||||
}
|
||||
|
||||
int acpTestHelloToSSEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, size_t StrQty, const char* StrArray)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serTestHelloToSSEncSrv(_buffer, *_size, &_lidx, StrQty, StrArray);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_TestHelloToSS, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpTestHelloToSSDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, size_t* StrQty, char** StrArray)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serTestHelloToSSDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, StrQty, StrArray);
|
||||
}
|
||||
|
||||
void acpTestHelloToSSFreeClt(char* StrArray)
|
||||
{
|
||||
serTestHelloToSSFreeClt(StrArray);
|
||||
}
|
||||
|
||||
int acpTestPingEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, uint32_t FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serTestPingEncClt(_buffer, *_size, &_lidx, FromSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_TestPing, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpTestPingDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, uint32_t* FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serTestPingDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, FromSS);
|
||||
}
|
||||
|
||||
int acpTestPingEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, uint32_t ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serTestPingEncSrv(_buffer, *_size, &_lidx, ToSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_TestPing, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpTestPingDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, uint32_t* ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serTestPingDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ToSS);
|
||||
}
|
||||
|
||||
int acpTestEchoEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EchoData* FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serTestEchoEncClt(_buffer, *_size, &_lidx, FromSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_TestEcho, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpTestEchoDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EchoData** FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serTestEchoDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, FromSS);
|
||||
}
|
||||
|
||||
void acpTestEchoFreeSrv(struct EchoData* FromSS)
|
||||
{
|
||||
serTestEchoFreeSrv(FromSS);
|
||||
}
|
||||
|
||||
int acpTestEchoEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EchoData* ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serTestEchoEncSrv(_buffer, *_size, &_lidx, ToSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_TestEcho, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpTestEchoDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EchoData** ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serTestEchoDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, ToSS);
|
||||
}
|
||||
|
||||
void acpTestEchoFreeClt(struct EchoData* ToSS)
|
||||
{
|
||||
serTestEchoFreeClt(ToSS);
|
||||
}
|
||||
|
||||
int acpTestTest1EncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct Output* out)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serTestTest1EncClt(_buffer, *_size, &_lidx, out);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_TestTest1, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpTestTest1DecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct Output** out)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serTestTest1DecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, out);
|
||||
}
|
||||
|
||||
void acpTestTest1FreeSrv(struct Output* out)
|
||||
{
|
||||
serTestTest1FreeSrv(out);
|
||||
}
|
||||
|
||||
int acpTestTest2EncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct Output* out)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serTestTest2EncSrv(_buffer, *_size, &_lidx, out);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_TestTest2, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpTestTest2DecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct Output** out)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serTestTest2DecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, out);
|
||||
}
|
||||
|
||||
void acpTestTest2FreeClt(struct Output* out)
|
||||
{
|
||||
serTestTest2FreeClt(out);
|
||||
}
|
||||
|
||||
int acpTestOtherEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct Empty* in1, uint32_t in2, size_t in3Qty, const char* in3Array, const char* in4, bool in5, int in6, float in7, SomeEnum in8, size_t in9Qty, const struct Empty* in9Array, const struct Empty2* in10, const struct New* in11)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serTestOtherEncClt(_buffer, *_size, &_lidx, in1, in2, in3Qty, in3Array, in4, in5, in6, in7, in8, in9Qty, in9Array, in10, in11);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_TestOther, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpTestOtherDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct Empty** in1, uint32_t* in2, size_t* in3Qty, char** in3Array, char** in4, bool* in5, int* in6, float* in7, SomeEnum* in8, size_t* in9Qty, struct Empty** in9Array, struct Empty2** in10, struct New** in11)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serTestOtherDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, in1, in2, in3Qty, in3Array, in4, in5, in6, in7, in8, in9Qty, in9Array, in10, in11);
|
||||
}
|
||||
|
||||
void acpTestOtherFreeSrv(struct Empty* in1, char* in3Array, char* in4, struct Empty* in9Array, size_t in9Qty, struct Empty2* in10, struct New* in11)
|
||||
{
|
||||
serTestOtherFreeSrv(in1, in3Array, in4, in9Array, in9Qty, in10, in11);
|
||||
}
|
||||
|
||||
int acpTestOtherEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct Empty* out1, uint32_t out2, size_t out3Qty, const char* out3Array, const char* out4, bool out5, int out6, float out7, SomeEnum out8, size_t out9Qty, const struct Empty* out9Array, const struct Empty2* out10, const struct New* out11)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serTestOtherEncSrv(_buffer, *_size, &_lidx, out1, out2, out3Qty, out3Array, out4, out5, out6, out7, out8, out9Qty, out9Array, out10, out11);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_TestOther, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpTestOtherDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct Empty** out1, uint32_t* out2, size_t* out3Qty, char** out3Array, char** out4, bool* out5, int* out6, float* out7, SomeEnum* out8, size_t* out9Qty, struct Empty** out9Array, struct Empty2** out10, struct New** out11)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serTestOtherDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, out1, out2, out3Qty, out3Array, out4, out5, out6, out7, out8, out9Qty, out9Array, out10, out11);
|
||||
}
|
||||
|
||||
void acpTestOtherFreeClt(struct Empty* out1, char* out3Array, char* out4, struct Empty* out9Array, size_t out9Qty, struct Empty2* out10, struct New* out11)
|
||||
{
|
||||
serTestOtherFreeClt(out1, out3Array, out4, out9Array, out9Qty, out10, out11);
|
||||
}
|
||||
75
openair3/SS/Sidl/lib/acp/src/acpVng.c
Normal file
75
openair3/SS/Sidl/lib/acp/src/acpVng.c
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* 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 "acpVng.h"
|
||||
#include "acpCtx.h"
|
||||
#include "acpProto.h"
|
||||
#include "acpMsgIds.h"
|
||||
#include "serVng.h"
|
||||
|
||||
int acpVngProcessEncClt(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EUTRA_VNG_CTRL_REQ* FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serVngProcessEncClt(_buffer, *_size, &_lidx, FromSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_VngProcess, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpVngProcessDecSrv(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EUTRA_VNG_CTRL_REQ** FromSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serVngProcessDecSrv(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, FromSS);
|
||||
}
|
||||
|
||||
void acpVngProcessFreeSrv(struct EUTRA_VNG_CTRL_REQ* FromSS)
|
||||
{
|
||||
serVngProcessFreeSrv(FromSS);
|
||||
}
|
||||
|
||||
int acpVngProcessEncSrv(acpCtx_t _ctx, unsigned char* _buffer, size_t* _size, const struct EUTRA_VNG_CTRL_CNF* ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
size_t _lidx = ACP_HEADER_SIZE;
|
||||
int _ret = serVngProcessEncSrv(_buffer, *_size, &_lidx, ToSS);
|
||||
if (_ret == SIDL_STATUS_OK) {
|
||||
acpBuildHeader(_ctx, ACP_LID_VngProcess, _lidx, _buffer);
|
||||
}
|
||||
*_size = _lidx;
|
||||
return _ret;
|
||||
}
|
||||
|
||||
int acpVngProcessDecClt(acpCtx_t _ctx, const unsigned char* _buffer, size_t _size, struct EUTRA_VNG_CTRL_CNF** ToSS)
|
||||
{
|
||||
if (!acpCtxIsValid(_ctx)) {
|
||||
return -ACP_ERR_INVALID_CTX;
|
||||
}
|
||||
return serVngProcessDecClt(_buffer + ACP_HEADER_SIZE, _size - ACP_HEADER_SIZE, ACP_CTX_CAST(_ctx)->arena, ACP_CTX_CAST(_ctx)->aSize, ToSS);
|
||||
}
|
||||
|
||||
void acpVngProcessFreeClt(struct EUTRA_VNG_CTRL_CNF* ToSS)
|
||||
{
|
||||
serVngProcessFreeClt(ToSS);
|
||||
}
|
||||
130
openair3/SS/Sidl/lib/adbg/api/adbg.h
Normal file
130
openair3/SS/Sidl/lib/adbg/api/adbg.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// System includes
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// Internal includes
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
// clang-format off
|
||||
|
||||
#ifdef ACP_DEBUG
|
||||
#define ACP_DEBUG_PREFIX_CLOG(ctx, fmt, args...) do { adbgPrintLog(ctx, "=== ACP_DEBUG: [%s:%d] " fmt ": ", __FILE__, __LINE__, ##args); } while (false)
|
||||
#define ACP_DEBUG_CLOG(ctx, fmt, args...) do { adbgPrintLog(ctx, "=== ACP_DEBUG: [%s:%d] " fmt, __FILE__, __LINE__, ##args); adbgPrintLog(ctx, NULL); } while (false)
|
||||
#define ACP_DEBUG_ENTER_CLOG(ctx) do { adbgPrintLog(ctx, ">>> ACP_DEBUG: Entering %s at [%s:%d]", __FUNCTION__, __FILE__, __LINE__); adbgPrintLog(ctx, NULL); } while (false)
|
||||
#define ACP_DEBUG_EXIT_CLOG(ctx, val) do { \
|
||||
if (val != NULL) adbgPrintLog(ctx, "<<< ACP_DEBUG: Exiting %s at [%s:%d] with return code '%s'", __FUNCTION__, __FILE__, __LINE__, val); \
|
||||
else adbgPrintLog(ctx, "<<< ACP_DEBUG: Exiting %s at %s:%d", __FUNCTION__, __FILE__, __LINE__); \
|
||||
adbgPrintLog(ctx, NULL); \
|
||||
} while (false)
|
||||
#define ACP_DEBUG_LOG(fmt, args...) do { adbgCheckAndSetGlobalLogger(); adbgGlobalLogger("=== ACP_DEBUG: [%s:%d] " fmt, __FILE__, __LINE__, ##args); } while (false)
|
||||
#define ACP_DEBUG_ENTER_LOG() do { adbgCheckAndSetGlobalLogger(); adbgGlobalLogger(">>> ACP_DEBUG: Entering %s at [%s:%d]", __FUNCTION__, __FILE__, __LINE__); } while (false)
|
||||
#define ACP_DEBUG_EXIT_LOG(val) do { \
|
||||
adbgCheckAndSetGlobalLogger(); \
|
||||
if (val != NULL) adbgGlobalLogger("<<< ACP_DEBUG: Exiting %s at [%s:%d] with return code '%s'", __FUNCTION__, __FILE__, __LINE__, val); \
|
||||
else adbgGlobalLogger("<<< ACP_DEBUG: Exiting %s at [%s:%d]", __FUNCTION__, __FILE__, __LINE__); \
|
||||
} while (false)
|
||||
|
||||
#ifdef ACP_DEBUG_TRACE
|
||||
#define ACP_DEBUG_PREFIX_TRACE_CLOG(ctx, fmt, args...) ACP_DEBUG_PREFIX_CLOG(ctx, fmt, args)
|
||||
#define ACP_DEBUG_TRACE_CLOG(ctx, fmt, args...) ACP_DEBUG_CLOG(ctx, fmt, args)
|
||||
#define ACP_DEBUG_ENTER_TRACE_CLOG(ctx) ACP_DEBUG_ENTER_CLOG(ctx)
|
||||
#define ACP_DEBUG_EXIT_TRACE_CLOG(ctx, val) ACP_DEBUG_EXIT_CLOG(ctx, val)
|
||||
#define ACP_DEBUG_TRACE_LOG(fmt, args...) ACP_DEBUG_LOG(fmt, args)
|
||||
#define ACP_DEBUG_ENTER_TRACE_LOG() ACP_DEBUG_ENTER_LOG()
|
||||
#define ACP_DEBUG_EXIT_TRACE_LOG(val) ACP_DEBUG_EXIT_LOG(val)
|
||||
#else //!ACP_DEBUG_TRACE
|
||||
#define ACP_DEBUG_PREFIX_TRACE_CLOG(ctx, fmt, args...) do {} while (false)
|
||||
#define ACP_DEBUG_TRACE_CLOG(ctx, fmt, args...) do {} while (false)
|
||||
#define ACP_DEBUG_ENTER_TRACE_CLOG(ctx) do {} while (false)
|
||||
#define ACP_DEBUG_EXIT_TRACE_CLOG(ctx, val) do {} while (false)
|
||||
#define ACP_DEBUG_TRACE_LOG(fmt, args...) do {} while (false)
|
||||
#define ACP_DEBUG_ENTER_TRACE_LOG() do {} while (false)
|
||||
#define ACP_DEBUG_EXIT_TRACE_LOG(val) do {} while (false)
|
||||
#endif // ACP_DEBUG_TRACE
|
||||
|
||||
#else // !ACP_DEBUG
|
||||
#define ACP_DEBUG_PREFIX_CLOG(ctx, fmt, args...) do {} while (false)
|
||||
#define ACP_DEBUG_CLOG(ctx, fmt, args...) do {} while (false)
|
||||
#define ACP_DEBUG_ENTER_CLOG(ctx) do {} while (false)
|
||||
#define ACP_DEBUG_EXIT_CLOG(ctx, val) do {} while (false)
|
||||
#define ACP_DEBUG_LOG(fmt, args...) do {} while (false)
|
||||
#define ACP_DEBUG_ENTER_LOG() do {} while (false)
|
||||
#define ACP_DEBUG_EXIT_LOG(val) do {} while (false)
|
||||
|
||||
#define ACP_DEBUG_PREFIX_TRACE_CLOG(ctx, fmt, args...) do {} while (false)
|
||||
#define ACP_DEBUG_TRACE_CLOG(ctx, fmt, args...) do {} while (false)
|
||||
#define ACP_DEBUG_ENTER_TRACE_CLOG(ctx) do {} while (false)
|
||||
#define ACP_DEBUG_EXIT_TRACE_CLOG(ctx, val) do {} while (false)
|
||||
#define ACP_DEBUG_TRACE_LOG(fmt, args...) do {} while (false)
|
||||
#define ACP_DEBUG_ENTER_TRACE_LOG() do {} while (false)
|
||||
#define ACP_DEBUG_EXIT_TRACE_LOG(val) do {} while (false)
|
||||
#endif // ACP_DEBUG
|
||||
|
||||
// clang-format on
|
||||
|
||||
/** Default size for log buffer. */
|
||||
#define ADBG_DEFAULT_LOG_BUFFER_SIZE (1 * 1024 * 1024) // 1MB
|
||||
|
||||
/** Default global logger (printf). */
|
||||
void adbgDefaultGlobalLogger(const char* fmt, ...);
|
||||
|
||||
/** Default logger (printf). */
|
||||
void adbgDefaultLogger(const char* str);
|
||||
|
||||
/** Type of global logger. Syntax similar to printf. */
|
||||
typedef void (*adbgGlobalLogger_t)(const char* fmt, ...);
|
||||
|
||||
/** Type of logger. Should print the string. */
|
||||
typedef void (*adbgLogger_t)(const char* str);
|
||||
|
||||
/** Global logger. */
|
||||
extern adbgGlobalLogger_t adbgGlobalLogger;
|
||||
|
||||
/** Global context logger. */
|
||||
extern adbgLogger_t adbgLogger;
|
||||
|
||||
/** Sets the global loggers.
|
||||
* If any argument is NULL then sets it to the default.
|
||||
*/
|
||||
void adbgSetGlobalLoggers(adbgGlobalLogger_t globalLogger, adbgLogger_t logger);
|
||||
|
||||
/** Checks the global logger and sets it to the default if NULL. */
|
||||
void adbgCheckAndSetGlobalLogger();
|
||||
|
||||
/** Sets the context logger and log buffer.
|
||||
* If any argument is NULL then sets it to the default.
|
||||
*/
|
||||
void adbgSetLogger(acpCtx_t ctx, adbgLogger_t logger, size_t size);
|
||||
|
||||
/** Prints to the log buffer,
|
||||
* if argument fmt is NULL then flushes the log buffer to the context logger.
|
||||
*/
|
||||
void adbgPrintLog(acpCtx_t ctx, const char* fmt, ...);
|
||||
|
||||
/** Flushes the log buffer to the context logger with formatting. */
|
||||
void adbgPrintFormatLog(acpCtx_t ctx);
|
||||
|
||||
/** Enables/disables log formatting. */
|
||||
void adbgSetPrintLogFormat(acpCtx_t ctx, bool format);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
28
openair3/SS/Sidl/lib/adbg/api/adbgDrb.h
Normal file
28
openair3/SS/Sidl/lib/adbg/api/adbgDrb.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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_EUTRA_DRB_PORT.h"
|
||||
#include "adbg.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
void adbgDrbProcessFromSSLogIn(acpCtx_t _ctx, const struct DRB_COMMON_REQ* FromSS);
|
||||
|
||||
void adbgDrbProcessToSSLogOut(acpCtx_t _ctx, const struct DRB_COMMON_IND* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
28
openair3/SS/Sidl/lib/adbg/api/adbgHandshake.h
Normal file
28
openair3/SS/Sidl/lib/adbg/api/adbgHandshake.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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_Handshake.h"
|
||||
#include "adbg.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
void adbgHandshakeHandleFromSSLogIn(acpCtx_t _ctx, const struct AcpHandshake_Type* fromSS);
|
||||
|
||||
void adbgHandshakeHandleToSSLogOut(acpCtx_t _ctx, const struct AcpHandshakeRsp_Type* toSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
31
openair3/SS/Sidl/lib/adbg/api/adbgMsg.h
Normal file
31
openair3/SS/Sidl/lib/adbg/api/adbgMsg.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// Internal includes
|
||||
#include "acp.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
enum adbgMsgLogDir {
|
||||
ADBG_MSG_LOG_RECV_DIR,
|
||||
ADBG_MSG_LOG_SEND_DIR
|
||||
};
|
||||
|
||||
void adbgMsgLog(acpCtx_t ctx, enum adbgMsgLogDir dir, size_t size, const unsigned char* buffer);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
28
openair3/SS/Sidl/lib/adbg/api/adbgSys.h
Normal file
28
openair3/SS/Sidl/lib/adbg/api/adbgSys.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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_EUTRA_SYSTEM_PORT.h"
|
||||
#include "adbg.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
void adbgSysProcessLogIn(acpCtx_t _ctx, const struct SYSTEM_CTRL_REQ* FromSS);
|
||||
|
||||
void adbgSysProcessLogOut(acpCtx_t _ctx, const struct SYSTEM_CTRL_CNF* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
26
openair3/SS/Sidl/lib/adbg/api/adbgSysInd.h
Normal file
26
openair3/SS/Sidl/lib/adbg/api/adbgSysInd.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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_EUTRA_SYSIND_PORT.h"
|
||||
#include "adbg.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
void adbgSysIndProcessToSSLogOut(acpCtx_t _ctx, const struct SYSTEM_IND* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
28
openair3/SS/Sidl/lib/adbg/api/adbgSysSrb.h
Normal file
28
openair3/SS/Sidl/lib/adbg/api/adbgSysSrb.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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_EUTRA_SYSTEM_PORT.h"
|
||||
#include "adbg.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
void adbgSysSrbProcessToSSLogOut(acpCtx_t _ctx, const struct EUTRA_RRC_PDU_IND* ToSS);
|
||||
|
||||
void adbgSysSrbProcessFromSSLogIn(acpCtx_t _ctx, const struct EUTRA_RRC_PDU_REQ* FromSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
28
openair3/SS/Sidl/lib/adbg/api/adbgSysVT.h
Normal file
28
openair3/SS/Sidl/lib/adbg/api/adbgSysVT.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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_VIRTUAL_TIME_PORT.h"
|
||||
#include "adbg.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
void adbgSysVTEnquireTimingUpdLogOut(acpCtx_t _ctx, const struct VirtualTimeInfo_Type* TimingInfoToSS);
|
||||
|
||||
void adbgSysVTEnquireTimingAckLogIn(acpCtx_t _ctx, const struct VirtualTimeInfo_Type* TimingInfoFromSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
44
openair3/SS/Sidl/lib/adbg/api/adbgTest.h
Normal file
44
openair3/SS/Sidl/lib/adbg/api/adbgTest.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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_Test.h"
|
||||
#include "adbg.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
void adbgTestHelloFromSSLogIn(acpCtx_t _ctx, size_t StrQty, const char* StrArray);
|
||||
|
||||
void adbgTestHelloToSSLogOut(acpCtx_t _ctx, size_t StrQty, const char* StrArray);
|
||||
|
||||
void adbgTestPingLogIn(acpCtx_t _ctx, uint32_t FromSS);
|
||||
|
||||
void adbgTestPingLogOut(acpCtx_t _ctx, uint32_t ToSS);
|
||||
|
||||
void adbgTestEchoLogIn(acpCtx_t _ctx, const struct EchoData* FromSS);
|
||||
|
||||
void adbgTestEchoLogOut(acpCtx_t _ctx, const struct EchoData* ToSS);
|
||||
|
||||
void adbgTestTest1LogIn(acpCtx_t _ctx, const struct Output* out);
|
||||
|
||||
void adbgTestTest2LogOut(acpCtx_t _ctx, const struct Output* out);
|
||||
|
||||
void adbgTestOtherLogIn(acpCtx_t _ctx, const struct Empty* in1, uint32_t in2, size_t in3Qty, const char* in3Array, const char* in4, bool in5, int in6, float in7, SomeEnum in8, size_t in9Qty, const struct Empty* in9Array, const struct Empty2* in10, const struct New* in11);
|
||||
|
||||
void adbgTestOtherLogOut(acpCtx_t _ctx, const struct Empty* out1, uint32_t out2, size_t out3Qty, const char* out3Array, const char* out4, bool out5, int out6, float out7, SomeEnum out8, size_t out9Qty, const struct Empty* out9Array, const struct Empty2* out10, const struct New* out11);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
28
openair3/SS/Sidl/lib/adbg/api/adbgVng.h
Normal file
28
openair3/SS/Sidl/lib/adbg/api/adbgVng.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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_EUTRA_VNG_PORT.h"
|
||||
#include "adbg.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
void adbgVngProcessLogIn(acpCtx_t _ctx, const struct EUTRA_VNG_CTRL_REQ* FromSS);
|
||||
|
||||
void adbgVngProcessLogOut(acpCtx_t _ctx, const struct EUTRA_VNG_CTRL_CNF* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
226
openair3/SS/Sidl/lib/adbg/src/adbg.c
Normal file
226
openair3/SS/Sidl/lib/adbg/src/adbg.c
Normal file
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
* 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 <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <ctype.h>
|
||||
|
||||
// Internal includes
|
||||
#include "adbg.h"
|
||||
#include "acpCtx.h"
|
||||
|
||||
adbgGlobalLogger_t adbgGlobalLogger = NULL;
|
||||
|
||||
adbgLogger_t adbgLogger = NULL;
|
||||
|
||||
void adbgDefaultGlobalLogger(const char* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
int rc = vprintf(fmt, ap);
|
||||
rc = printf("\n");
|
||||
(void)rc;
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void adbgDefaultLogger(const char* str)
|
||||
{
|
||||
int rc = printf("%s\n", str);
|
||||
(void)rc; // ignore
|
||||
}
|
||||
|
||||
void adbgSetGlobalLoggers(adbgGlobalLogger_t globalLogger, adbgLogger_t logger)
|
||||
{
|
||||
adbgGlobalLogger = globalLogger;
|
||||
adbgLogger = logger;
|
||||
}
|
||||
|
||||
void adbgCheckAndSetGlobalLogger()
|
||||
{
|
||||
if (!adbgGlobalLogger) {
|
||||
adbgGlobalLogger = adbgDefaultGlobalLogger;
|
||||
}
|
||||
}
|
||||
|
||||
void adbgSetLogger(acpCtx_t ctx, adbgLogger_t logger, size_t size)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
ACP_DEBUG_LOG("Invalid context");
|
||||
SIDL_ASSERT(ctx != ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
if (logger) {
|
||||
if (ACP_CTX_CAST(ctx)->logger) {
|
||||
SIDL_ASSERT(!ACP_CTX_CAST(ctx)->logger);
|
||||
}
|
||||
ACP_CTX_CAST(ctx)->logger = logger;
|
||||
}
|
||||
|
||||
if (size) {
|
||||
if (ACP_CTX_CAST(ctx)->logBuf) {
|
||||
SIDL_ASSERT(!ACP_CTX_CAST(ctx)->logBuf);
|
||||
}
|
||||
ACP_CTX_CAST(ctx)->logBuf = (unsigned char*)acpMalloc(size);
|
||||
SIDL_ASSERT(ACP_CTX_CAST(ctx)->logBuf);
|
||||
ACP_CTX_CAST(ctx)->logBufMaxSize = size;
|
||||
ACP_CTX_CAST(ctx)->logBufSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void adbgCheckAndSetLogger(acpCtx_t ctx)
|
||||
{
|
||||
if (!ACP_CTX_CAST(ctx)->logger) {
|
||||
ACP_CTX_CAST(ctx)->logger = adbgLogger ? adbgLogger : adbgDefaultLogger;
|
||||
}
|
||||
|
||||
if (!ACP_CTX_CAST(ctx)->logBuf) {
|
||||
ACP_CTX_CAST(ctx)->logBuf = (unsigned char*)acpMalloc(ADBG_DEFAULT_LOG_BUFFER_SIZE);
|
||||
SIDL_ASSERT(ACP_CTX_CAST(ctx)->logBuf);
|
||||
ACP_CTX_CAST(ctx)->logBufMaxSize = ADBG_DEFAULT_LOG_BUFFER_SIZE;
|
||||
ACP_CTX_CAST(ctx)->logBufSize = 0;
|
||||
}
|
||||
|
||||
if (ACP_CTX_CAST(ctx)->logFormat) {
|
||||
if (ACP_CTX_CAST(ctx)->logFormatBufMaxSize != (ACP_CTX_CAST(ctx)->logBufMaxSize + 1024)) {
|
||||
if (ACP_CTX_CAST(ctx)->logFormatBuf) {
|
||||
acpFree(ACP_CTX_CAST(ctx)->logFormatBuf);
|
||||
}
|
||||
ACP_CTX_CAST(ctx)->logFormatBufMaxSize = ACP_CTX_CAST(ctx)->logBufMaxSize + 1024;
|
||||
ACP_CTX_CAST(ctx)->logFormatBuf = (unsigned char*)acpMalloc(ACP_CTX_CAST(ctx)->logFormatBufMaxSize);
|
||||
SIDL_ASSERT(ACP_CTX_CAST(ctx)->logFormatBuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void adbgPrintLog(acpCtx_t ctx, const char* fmt, ...)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
ACP_DEBUG_LOG("Invalid context");
|
||||
SIDL_ASSERT(ctx != ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
adbgCheckAndSetLogger(ctx);
|
||||
|
||||
if (fmt) {
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
int rc = vsnprintf((char*)(&ACP_CTX_CAST(ctx)->logBuf[ACP_CTX_CAST(ctx)->logBufSize]), ACP_CTX_CAST(ctx)->logBufMaxSize - ACP_CTX_CAST(ctx)->logBufSize, fmt, ap);
|
||||
va_end(ap);
|
||||
SIDL_ASSERT(rc >= 0);
|
||||
ACP_CTX_CAST(ctx)->logBufSize += rc;
|
||||
SIDL_ASSERT(ACP_CTX_CAST(ctx)->logBufMaxSize > ACP_CTX_CAST(ctx)->logBufSize);
|
||||
} else {
|
||||
if (ACP_CTX_CAST(ctx)->logBufSize) {
|
||||
ACP_CTX_CAST(ctx)->logger((const char*)ACP_CTX_CAST(ctx)->logBuf);
|
||||
ACP_CTX_CAST(ctx)->logBufSize = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void adbgPrintFormatLog(acpCtx_t ctx)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
ACP_DEBUG_LOG("Invalid context");
|
||||
SIDL_ASSERT(ctx != ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ACP_CTX_CAST(ctx)->logBufSize) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ACP_CTX_CAST(ctx)->logFormat) {
|
||||
ACP_CTX_CAST(ctx)->logger((const char*)ACP_CTX_CAST(ctx)->logBuf);
|
||||
ACP_CTX_CAST(ctx)->logBufSize = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
adbgCheckAndSetLogger(ctx);
|
||||
|
||||
size_t sz = 0;
|
||||
size_t lead = 0;
|
||||
bool trim = false;
|
||||
char ch;
|
||||
size_t i;
|
||||
|
||||
const char* src = (const char*)ACP_CTX_CAST(ctx)->logBuf;
|
||||
char* res = (char*)ACP_CTX_CAST(ctx)->logFormatBuf;
|
||||
|
||||
while ((ch = *src++)) {
|
||||
if (ch == '{') {
|
||||
trim = true;
|
||||
lead += 4;
|
||||
*res++ = '{';
|
||||
*res++ = '\n';
|
||||
for (i = 0; i < lead; i++) *res++ = ' ';
|
||||
sz += lead + 2;
|
||||
} else if (ch == '}') {
|
||||
lead -= 4;
|
||||
*res++ = '\n';
|
||||
for (i = 0; i < lead; i++) *res++ = ' ';
|
||||
*res++ = '}';
|
||||
sz += lead + 2;
|
||||
} else if (ch == ',') {
|
||||
trim = true;
|
||||
*res++ = ',';
|
||||
*res++ = '\n';
|
||||
for (i = 0; i < lead; i++) *res++ = ' ';
|
||||
sz += lead + 2;
|
||||
} else {
|
||||
if (trim) {
|
||||
if (isspace(ch)) {
|
||||
continue;
|
||||
} else {
|
||||
trim = false;
|
||||
}
|
||||
}
|
||||
|
||||
*res++ = ch;
|
||||
sz++;
|
||||
}
|
||||
}
|
||||
|
||||
*res = '\0';
|
||||
sz++;
|
||||
|
||||
SIDL_ASSERT(ACP_CTX_CAST(ctx)->logFormatBufMaxSize > sz);
|
||||
|
||||
ACP_CTX_CAST(ctx)->logger((const char*)ACP_CTX_CAST(ctx)->logFormatBuf);
|
||||
ACP_CTX_CAST(ctx)->logBufSize = 0;
|
||||
}
|
||||
|
||||
void adbgSetPrintLogFormat(acpCtx_t ctx, bool format)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
ACP_DEBUG_LOG("Invalid context");
|
||||
SIDL_ASSERT(ctx != ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
ACP_CTX_CAST(ctx)->logFormat = format;
|
||||
|
||||
if (!format) {
|
||||
if (ACP_CTX_CAST(ctx)->logFormatBuf) {
|
||||
acpFree(ACP_CTX_CAST(ctx)->logFormatBuf);
|
||||
ACP_CTX_CAST(ctx)->logFormatBuf = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
2732
openair3/SS/Sidl/lib/adbg/src/adbgDrb.c
Normal file
2732
openair3/SS/Sidl/lib/adbg/src/adbgDrb.c
Normal file
File diff suppressed because it is too large
Load Diff
73
openair3/SS/Sidl/lib/adbg/src/adbgHandshake.c
Normal file
73
openair3/SS/Sidl/lib/adbg/src/adbgHandshake.c
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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 "adbgHandshake.h"
|
||||
|
||||
static void _adbgHandshake__AcpHandshake_Type(acpCtx_t _ctx, const struct AcpHandshake_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "acpVersion := '");
|
||||
for (size_t i1 = 0; i1 < 32; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->acpVersion[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "acpVerCksm := '");
|
||||
for (size_t i1 = 0; i1 < 64; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->acpVerCksm[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
void adbgHandshakeHandleFromSSLogIn(acpCtx_t _ctx, const struct AcpHandshake_Type* fromSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@HandshakeHandleFromSS In Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "fromSS := { ");
|
||||
_adbgHandshake__AcpHandshake_Type(_ctx, fromSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
static void _adbgHandshake__AcpHandshakeRsp_Type(acpCtx_t _ctx, const struct AcpHandshakeRsp_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "acpVersionChk := %s", (p->acpVersionChk ? "true" : "false"));
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "acpVersion := '");
|
||||
for (size_t i1 = 0; i1 < 32; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->acpVersion[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "acpVerCksm := '");
|
||||
for (size_t i1 = 0; i1 < 64; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->acpVerCksm[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
void adbgHandshakeHandleToSSLogOut(acpCtx_t _ctx, const struct AcpHandshakeRsp_Type* toSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@HandshakeHandleToSS Out Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "toSS := { ");
|
||||
_adbgHandshake__AcpHandshakeRsp_Type(_ctx, toSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
66
openair3/SS/Sidl/lib/adbg/src/adbgMsg.c
Normal file
66
openair3/SS/Sidl/lib/adbg/src/adbgMsg.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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 "adbgMsg.h"
|
||||
#include "acpCtx.h"
|
||||
#include "adbg.h"
|
||||
#include "adbgMsgMap.h"
|
||||
|
||||
void adbgMsgLog(acpCtx_t ctx, enum adbgMsgLogDir dir, size_t size, const unsigned char* buffer)
|
||||
{
|
||||
if (!acpCtxIsValid(ctx)) {
|
||||
SIDL_ASSERT(ctx != ctx);
|
||||
ACP_DEBUG_LOG("invalid context");
|
||||
return;
|
||||
}
|
||||
|
||||
bool isServer = ACP_CTX_CAST(ctx)->isServer;
|
||||
|
||||
enum acpMsgLocalId localId;
|
||||
|
||||
if (acpGetMsgLocalId(size, buffer, &localId) < -1) {
|
||||
adbgPrintLog(ctx, "invalid buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((int)localId == (int)ACP_SERVICE_PUSH_TYPE) {
|
||||
adbgPrintLog(ctx, "ACP_SERVICE_PUSH_TYPE");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// Service kind (0 - NTF, 1 - ONEWAY, 2 - CMD)
|
||||
int kind = acpCtxGetMsgKindFromId(localId);
|
||||
SIDL_ASSERT(kind != -1);
|
||||
if (kind < -1) {
|
||||
adbgPrintLog(ctx, "cannot find service");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((kind == 1 || kind == 2) && dir == ADBG_MSG_LOG_RECV_DIR && isServer) {
|
||||
adbgMsgLogInArgs(ctx, localId, size - ACP_HEADER_SIZE, buffer + ACP_HEADER_SIZE);
|
||||
} else if ((kind == 0 || kind == 2) && dir == ADBG_MSG_LOG_SEND_DIR && isServer) {
|
||||
adbgMsgLogOutArgs(ctx, localId, size - ACP_HEADER_SIZE, buffer + ACP_HEADER_SIZE);
|
||||
} else if ((kind == 1 || kind == 2) && dir == ADBG_MSG_LOG_SEND_DIR && !isServer) {
|
||||
adbgMsgLogInArgs(ctx, localId, size - ACP_HEADER_SIZE, buffer + ACP_HEADER_SIZE);
|
||||
} else if ((kind == 0 || kind == 2) && dir == ADBG_MSG_LOG_RECV_DIR && !isServer) {
|
||||
adbgMsgLogOutArgs(ctx, localId, size - ACP_HEADER_SIZE, buffer + ACP_HEADER_SIZE);
|
||||
} else {
|
||||
SIDL_ASSERT(0);
|
||||
}
|
||||
}
|
||||
236
openair3/SS/Sidl/lib/adbg/src/adbgMsgMap.c
Normal file
236
openair3/SS/Sidl/lib/adbg/src/adbgMsgMap.c
Normal file
@@ -0,0 +1,236 @@
|
||||
/*
|
||||
* 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 "adbgMsgMap.h"
|
||||
|
||||
#include "serTest.h"
|
||||
#include "serHandshake.h"
|
||||
#if defined(PROJECT_HAS_RAT_EUTRA)
|
||||
#include "serSys.h"
|
||||
#include "serSysInd.h"
|
||||
#include "serSysSrb.h"
|
||||
#include "serVng.h"
|
||||
#include "serDrb.h"
|
||||
#endif
|
||||
#if defined(PROJECT_HAS_RAT_NR)
|
||||
#include "serNrSysSrb.h"
|
||||
#endif
|
||||
|
||||
#include "adbgTest.h"
|
||||
#include "adbgHandshake.h"
|
||||
#if defined(PROJECT_HAS_RAT_EUTRA)
|
||||
#include "adbgSys.h"
|
||||
#include "adbgSysInd.h"
|
||||
#include "adbgSysSrb.h"
|
||||
#include "adbgVng.h"
|
||||
#include "adbgDrb.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)
|
||||
{
|
||||
if (id == ACP_LID_TestHelloFromSS) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_TestPing) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_TestEcho) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_TestTest1) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_TestTest2) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_TestOther) {
|
||||
return;
|
||||
}
|
||||
#if defined(PROJECT_HAS_RAT_EUTRA)
|
||||
if (id == ACP_LID_SysProcess) {
|
||||
struct SYSTEM_CTRL_REQ* FromSS;
|
||||
if (serSysProcessDecSrv(buffer, size, NULL, 0, &FromSS) == 0) {
|
||||
adbgSysProcessLogIn(ctx, FromSS);
|
||||
serSysProcessFreeSrv(FromSS);
|
||||
} else {
|
||||
adbgPrintLog(ctx, "cannot decode buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_SysVTEnquireTimingAck) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_SysSrbProcessFromSS) {
|
||||
struct EUTRA_RRC_PDU_REQ* FromSS;
|
||||
if (serSysSrbProcessFromSSDecSrv(buffer, size, NULL, 0, &FromSS) == 0) {
|
||||
adbgSysSrbProcessFromSSLogIn(ctx, FromSS);
|
||||
|
||||
serSysSrbProcessFromSSFreeSrv(FromSS);
|
||||
} else {
|
||||
adbgPrintLog(ctx, "cannot decode buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_VngProcess) {
|
||||
struct EUTRA_VNG_CTRL_REQ* FromSS;
|
||||
if (serVngProcessDecSrv(buffer, size, NULL, 0, &FromSS) == 0) {
|
||||
adbgVngProcessLogIn(ctx, FromSS);
|
||||
serVngProcessFreeSrv(FromSS);
|
||||
} else {
|
||||
adbgPrintLog(ctx, "cannot decode buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_DrbProcessFromSS) {
|
||||
struct DRB_COMMON_REQ* FromSS;
|
||||
if (serDrbProcessFromSSDecSrv(buffer, size, NULL, 0, &FromSS) == 0) {
|
||||
adbgDrbProcessFromSSLogIn(ctx, FromSS);
|
||||
|
||||
serDrbProcessFromSSFreeSrv(FromSS);
|
||||
} else {
|
||||
adbgPrintLog(ctx, "cannot decode buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
}
|
||||
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);
|
||||
|
||||
serNrSysSrbProcessFromSSFreeSrv(FromSS);
|
||||
} else {
|
||||
adbgPrintLog(ctx, "cannot decode buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
SIDL_ASSERT(0);
|
||||
}
|
||||
|
||||
void adbgMsgLogOutArgs(acpCtx_t ctx, enum acpMsgLocalId id, size_t size, const unsigned char* buffer)
|
||||
{
|
||||
if (id == ACP_LID_TestHelloToSS) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_TestPing) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_TestEcho) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_TestTest1) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_TestTest2) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_TestOther) {
|
||||
return;
|
||||
}
|
||||
#if defined(PROJECT_HAS_RAT_EUTRA)
|
||||
if (id == ACP_LID_SysProcess) {
|
||||
struct SYSTEM_CTRL_CNF* ToSS;
|
||||
if (serSysProcessDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
|
||||
adbgSysProcessLogOut(ctx, ToSS);
|
||||
serSysProcessFreeClt(ToSS);
|
||||
} else {
|
||||
adbgPrintLog(ctx, "cannot decode buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_SysVTEnquireTimingUpd) {
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_SysSrbProcessToSS) {
|
||||
struct EUTRA_RRC_PDU_IND* ToSS;
|
||||
if (serSysSrbProcessToSSDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
|
||||
adbgSysSrbProcessToSSLogOut(ctx, ToSS);
|
||||
serSysSrbProcessToSSFreeClt(ToSS);
|
||||
} else {
|
||||
adbgPrintLog(ctx, "cannot decode buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == ACP_LID_VngProcess) {
|
||||
struct EUTRA_VNG_CTRL_CNF* ToSS;
|
||||
if (serVngProcessDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
|
||||
adbgVngProcessLogOut(ctx, ToSS);
|
||||
serVngProcessFreeClt(ToSS);
|
||||
} else {
|
||||
adbgPrintLog(ctx, "cannot decode buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_DrbProcessToSS) {
|
||||
struct DRB_COMMON_IND* ToSS;
|
||||
if (serDrbProcessToSSDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
|
||||
adbgDrbProcessToSSLogOut(ctx, ToSS);
|
||||
serDrbProcessToSSFreeClt(ToSS);
|
||||
} else {
|
||||
adbgPrintLog(ctx, "cannot decode buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (id == ACP_LID_SysIndProcessToSS /* SysIndProccessToSS */) {
|
||||
struct SYSTEM_IND* ToSS = NULL;
|
||||
if (serSysIndProcessToSSDecClt(buffer, size, NULL, 0, &ToSS) == 0) {
|
||||
adbgSysIndProcessToSSLogOut(ctx, ToSS);
|
||||
serSysIndProcessToSSFreeClt(ToSS);
|
||||
} else {
|
||||
adbgPrintLog(ctx, "cannot decode buffer");
|
||||
adbgPrintLog(ctx, NULL);
|
||||
}
|
||||
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);
|
||||
}
|
||||
28
openair3/SS/Sidl/lib/adbg/src/adbgMsgMap.h
Normal file
28
openair3/SS/Sidl/lib/adbg/src/adbgMsgMap.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// Internal includes
|
||||
#include "acp.h"
|
||||
#include "acpMsgIds.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
void adbgMsgLogInArgs(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);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
30103
openair3/SS/Sidl/lib/adbg/src/adbgSys.c
Normal file
30103
openair3/SS/Sidl/lib/adbg/src/adbgSys.c
Normal file
File diff suppressed because it is too large
Load Diff
834
openair3/SS/Sidl/lib/adbg/src/adbgSysInd.c
Normal file
834
openair3/SS/Sidl/lib/adbg/src/adbgSysInd.c
Normal file
@@ -0,0 +1,834 @@
|
||||
/*
|
||||
* 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 "adbgSysInd.h"
|
||||
|
||||
static const char* adbgSysInd__EUTRA_CellId_Type__ToString(EUTRA_CellId_Type v)
|
||||
{
|
||||
switch(v) {
|
||||
case eutra_Cell_NonSpecific: return "eutra_Cell_NonSpecific";
|
||||
case eutra_Cell1: return "eutra_Cell1";
|
||||
case eutra_Cell2: return "eutra_Cell2";
|
||||
case eutra_Cell3: return "eutra_Cell3";
|
||||
case eutra_Cell4: return "eutra_Cell4";
|
||||
case eutra_Cell6: return "eutra_Cell6";
|
||||
case eutra_Cell10: return "eutra_Cell10";
|
||||
case eutra_Cell11: return "eutra_Cell11";
|
||||
case eutra_Cell12: return "eutra_Cell12";
|
||||
case eutra_Cell13: return "eutra_Cell13";
|
||||
case eutra_Cell14: return "eutra_Cell14";
|
||||
case eutra_Cell23: return "eutra_Cell23";
|
||||
case eutra_Cell28: return "eutra_Cell28";
|
||||
case eutra_Cell29: return "eutra_Cell29";
|
||||
case eutra_Cell30: return "eutra_Cell30";
|
||||
case eutra_Cell31: return "eutra_Cell31";
|
||||
case eutra_CellA: return "eutra_CellA";
|
||||
case eutra_CellB: return "eutra_CellB";
|
||||
case eutra_CellC: return "eutra_CellC";
|
||||
case eutra_CellD: return "eutra_CellD";
|
||||
case eutra_CellE: return "eutra_CellE";
|
||||
case eutra_CellG: return "eutra_CellG";
|
||||
case eutra_CellH: return "eutra_CellH";
|
||||
case eutra_CellI: return "eutra_CellI";
|
||||
case eutra_CellJ: return "eutra_CellJ";
|
||||
case eutra_CellK: return "eutra_CellK";
|
||||
case eutra_CellL: return "eutra_CellL";
|
||||
case eutra_CellM: return "eutra_CellM";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgSysInd__PmchLogicalChannel_Type(acpCtx_t _ctx, const struct PmchLogicalChannel_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Pmch_InfoIndex := %u", (unsigned int)p->Pmch_InfoIndex);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "LogicalChannelIdentity := %u", (unsigned int)p->LogicalChannelIdentity);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__MRB_Identity_Type(acpCtx_t _ctx, const struct MRB_Identity_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Mbsfn_AreaId := %u", (unsigned int)p->Mbsfn_AreaId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "PmchLogicalChannel := { ");
|
||||
_adbgSysInd__PmchLogicalChannel_Type(_ctx, &p->PmchLogicalChannel);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__MCC_PLMN_Identity_mcc_Optional(acpCtx_t _ctx, const struct MCC_PLMN_Identity_mcc_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < 3; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__PLMN_Identity(acpCtx_t _ctx, const struct PLMN_Identity* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "mcc := ");
|
||||
_adbgSysInd__MCC_PLMN_Identity_mcc_Optional(_ctx, &p->mcc);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "mnc := '");
|
||||
for (size_t i1 = 0; i1 < p->mnc.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->mnc.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__TMGI_r9_plmn_Id_r9_Value(acpCtx_t _ctx, const union TMGI_r9_plmn_Id_r9_Value* p, enum TMGI_r9_plmn_Id_r9_Sel d)
|
||||
{
|
||||
if (d == TMGI_r9_plmn_Id_r9_plmn_Index_r9) {
|
||||
adbgPrintLog(_ctx, "plmn_Index_r9 := %u", (unsigned int)p->plmn_Index_r9);
|
||||
return;
|
||||
}
|
||||
if (d == TMGI_r9_plmn_Id_r9_explicitValue_r9) {
|
||||
adbgPrintLog(_ctx, "explicitValue_r9 := { ");
|
||||
_adbgSysInd__PLMN_Identity(_ctx, &p->explicitValue_r9);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__TMGI_r9_plmn_Id_r9(acpCtx_t _ctx, const struct TMGI_r9_plmn_Id_r9* p)
|
||||
{
|
||||
_adbgSysInd__TMGI_r9_plmn_Id_r9_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__TMGI_r9(acpCtx_t _ctx, const struct TMGI_r9* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "plmn_Id_r9 := { ");
|
||||
_adbgSysInd__TMGI_r9_plmn_Id_r9(_ctx, &p->plmn_Id_r9);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "serviceId_r9 := '");
|
||||
for (size_t i1 = 0; i1 < 3; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->serviceId_r9[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__O1_MBMSSessionInfo_r13_sessionId_r13_Optional(acpCtx_t _ctx, const struct O1_MBMSSessionInfo_r13_sessionId_r13_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < 1; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__MBMSSessionInfo_r13(acpCtx_t _ctx, const struct MBMSSessionInfo_r13* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "tmgi_r13 := { ");
|
||||
_adbgSysInd__TMGI_r9(_ctx, &p->tmgi_r13);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "sessionId_r13 := ");
|
||||
_adbgSysInd__O1_MBMSSessionInfo_r13_sessionId_r13_Optional(_ctx, &p->sessionId_r13);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SC_MRB_Identity_Type(acpCtx_t _ctx, const struct SC_MRB_Identity_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "MbmsSessionInfo := { ");
|
||||
_adbgSysInd__MBMSSessionInfo_r13(_ctx, &p->MbmsSessionInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__RadioBearerId_Type_Value(acpCtx_t _ctx, const union RadioBearerId_Type_Value* p, enum RadioBearerId_Type_Sel d)
|
||||
{
|
||||
if (d == RadioBearerId_Type_Srb) {
|
||||
adbgPrintLog(_ctx, "Srb := %u", (unsigned int)p->Srb);
|
||||
return;
|
||||
}
|
||||
if (d == RadioBearerId_Type_Drb) {
|
||||
adbgPrintLog(_ctx, "Drb := %u", (unsigned int)p->Drb);
|
||||
return;
|
||||
}
|
||||
if (d == RadioBearerId_Type_Mrb) {
|
||||
adbgPrintLog(_ctx, "Mrb := { ");
|
||||
_adbgSysInd__MRB_Identity_Type(_ctx, &p->Mrb);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == RadioBearerId_Type_ScMrb) {
|
||||
adbgPrintLog(_ctx, "ScMrb := { ");
|
||||
_adbgSysInd__SC_MRB_Identity_Type(_ctx, &p->ScMrb);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__RadioBearerId_Type(acpCtx_t _ctx, const struct RadioBearerId_Type* p)
|
||||
{
|
||||
_adbgSysInd__RadioBearerId_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__QosFlow_Identification_Type(acpCtx_t _ctx, const struct QosFlow_Identification_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "PDU_SessionId := %d", (int)p->PDU_SessionId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "QFI := %d", (int)p->QFI);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__RoutingInfo_Type_Value(acpCtx_t _ctx, const union RoutingInfo_Type_Value* p, enum RoutingInfo_Type_Sel d)
|
||||
{
|
||||
if (d == RoutingInfo_Type_None) {
|
||||
adbgPrintLog(_ctx, "None := %s", (p->None ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == RoutingInfo_Type_RadioBearerId) {
|
||||
adbgPrintLog(_ctx, "RadioBearerId := { ");
|
||||
_adbgSysInd__RadioBearerId_Type(_ctx, &p->RadioBearerId);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == RoutingInfo_Type_QosFlow) {
|
||||
adbgPrintLog(_ctx, "QosFlow := { ");
|
||||
_adbgSysInd__QosFlow_Identification_Type(_ctx, &p->QosFlow);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__RoutingInfo_Type(acpCtx_t _ctx, const struct RoutingInfo_Type* p)
|
||||
{
|
||||
_adbgSysInd__RoutingInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SystemFrameNumberInfo_Type_Value(acpCtx_t _ctx, const union SystemFrameNumberInfo_Type_Value* p, enum SystemFrameNumberInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SystemFrameNumberInfo_Type_Number) {
|
||||
adbgPrintLog(_ctx, "Number := %u", (unsigned int)p->Number);
|
||||
return;
|
||||
}
|
||||
if (d == SystemFrameNumberInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SystemFrameNumberInfo_Type(acpCtx_t _ctx, const struct SystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
_adbgSysInd__SystemFrameNumberInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SubFrameInfo_Type_Value(acpCtx_t _ctx, const union SubFrameInfo_Type_Value* p, enum SubFrameInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SubFrameInfo_Type_Number) {
|
||||
adbgPrintLog(_ctx, "Number := %u", (unsigned int)p->Number);
|
||||
return;
|
||||
}
|
||||
if (d == SubFrameInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SubFrameInfo_Type(acpCtx_t _ctx, const struct SubFrameInfo_Type* p)
|
||||
{
|
||||
_adbgSysInd__SubFrameInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__HyperSystemFrameNumberInfo_Type(acpCtx_t _ctx, const HyperSystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
_adbgSysInd__SystemFrameNumberInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SlotOffset_Type_Value(acpCtx_t _ctx, const union SlotOffset_Type_Value* p, enum SlotOffset_Type_Sel d)
|
||||
{
|
||||
if (d == SlotOffset_Type_Numerology0) {
|
||||
adbgPrintLog(_ctx, "Numerology0 := %s", (p->Numerology0 ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology1) {
|
||||
adbgPrintLog(_ctx, "Numerology1 := %u", (unsigned int)p->Numerology1);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology2) {
|
||||
adbgPrintLog(_ctx, "Numerology2 := %u", (unsigned int)p->Numerology2);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology3) {
|
||||
adbgPrintLog(_ctx, "Numerology3 := %u", (unsigned int)p->Numerology3);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology4) {
|
||||
adbgPrintLog(_ctx, "Numerology4 := %u", (unsigned int)p->Numerology4);
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SlotOffset_Type(acpCtx_t _ctx, const struct SlotOffset_Type* p)
|
||||
{
|
||||
_adbgSysInd__SlotOffset_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SlotTimingInfo_Type_Value(acpCtx_t _ctx, const union SlotTimingInfo_Type_Value* p, enum SlotTimingInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SlotTimingInfo_Type_SlotOffset) {
|
||||
adbgPrintLog(_ctx, "SlotOffset := { ");
|
||||
_adbgSysInd__SlotOffset_Type(_ctx, &p->SlotOffset);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_FirstSlot) {
|
||||
adbgPrintLog(_ctx, "FirstSlot := %s", (p->FirstSlot ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SlotTimingInfo_Type(acpCtx_t _ctx, const struct SlotTimingInfo_Type* p)
|
||||
{
|
||||
_adbgSysInd__SlotTimingInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SubFrameTiming_Type(acpCtx_t _ctx, const struct SubFrameTiming_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "SFN := { ");
|
||||
_adbgSysInd__SystemFrameNumberInfo_Type(_ctx, &p->SFN);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Subframe := { ");
|
||||
_adbgSysInd__SubFrameInfo_Type(_ctx, &p->Subframe);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "HSFN := { ");
|
||||
_adbgSysInd__HyperSystemFrameNumberInfo_Type(_ctx, &p->HSFN);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Slot := { ");
|
||||
_adbgSysInd__SlotTimingInfo_Type(_ctx, &p->Slot);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__TimingInfo_Type_Value(acpCtx_t _ctx, const union TimingInfo_Type_Value* p, enum TimingInfo_Type_Sel d)
|
||||
{
|
||||
if (d == TimingInfo_Type_SubFrame) {
|
||||
adbgPrintLog(_ctx, "SubFrame := { ");
|
||||
_adbgSysInd__SubFrameTiming_Type(_ctx, &p->SubFrame);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == TimingInfo_Type_Now) {
|
||||
adbgPrintLog(_ctx, "Now := %s", (p->Now ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == TimingInfo_Type_None) {
|
||||
adbgPrintLog(_ctx, "None := %s", (p->None ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__TimingInfo_Type(acpCtx_t _ctx, const struct TimingInfo_Type* p)
|
||||
{
|
||||
_adbgSysInd__TimingInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__IntegrityErrorIndication_Type(acpCtx_t _ctx, const struct IntegrityErrorIndication_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Nas := %s", (p->Nas ? "true" : "false"));
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Pdcp := %s", (p->Pdcp ? "true" : "false"));
|
||||
}
|
||||
|
||||
static void _adbgSysInd__ErrorIndication_Type(acpCtx_t _ctx, const struct ErrorIndication_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Integrity := { ");
|
||||
_adbgSysInd__IntegrityErrorIndication_Type(_ctx, &p->Integrity);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "System := %d", (int)p->System);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__IndicationStatus_Type_Value(acpCtx_t _ctx, const union IndicationStatus_Type_Value* p, enum IndicationStatus_Type_Sel d)
|
||||
{
|
||||
if (d == IndicationStatus_Type_Ok) {
|
||||
adbgPrintLog(_ctx, "Ok := %s", (p->Ok ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == IndicationStatus_Type_Error) {
|
||||
adbgPrintLog(_ctx, "Error := { ");
|
||||
_adbgSysInd__ErrorIndication_Type(_ctx, &p->Error);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__IndicationStatus_Type(acpCtx_t _ctx, const struct IndicationStatus_Type* p)
|
||||
{
|
||||
_adbgSysInd__IndicationStatus_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static const char* adbgSysInd__NR_CellId_Type__ToString(NR_CellId_Type v)
|
||||
{
|
||||
switch(v) {
|
||||
case nr_Cell_NonSpecific: return "nr_Cell_NonSpecific";
|
||||
case nr_Cell1: return "nr_Cell1";
|
||||
case nr_Cell2: return "nr_Cell2";
|
||||
case nr_Cell3: return "nr_Cell3";
|
||||
case nr_Cell4: return "nr_Cell4";
|
||||
case nr_Cell6: return "nr_Cell6";
|
||||
case nr_Cell10: return "nr_Cell10";
|
||||
case nr_Cell11: return "nr_Cell11";
|
||||
case nr_Cell12: return "nr_Cell12";
|
||||
case nr_Cell13: return "nr_Cell13";
|
||||
case nr_Cell14: return "nr_Cell14";
|
||||
case nr_Cell23: return "nr_Cell23";
|
||||
case nr_Cell28: return "nr_Cell28";
|
||||
case nr_Cell29: return "nr_Cell29";
|
||||
case nr_Cell30: return "nr_Cell30";
|
||||
case nr_Cell31: return "nr_Cell31";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgSysInd__RlcBearerRouting_Type_Value(acpCtx_t _ctx, const union RlcBearerRouting_Type_Value* p, enum RlcBearerRouting_Type_Sel d)
|
||||
{
|
||||
if (d == RlcBearerRouting_Type_EUTRA) {
|
||||
adbgPrintLog(_ctx, "EUTRA := %s (%d)", adbgSysInd__EUTRA_CellId_Type__ToString(p->EUTRA), (int)p->EUTRA);
|
||||
return;
|
||||
}
|
||||
if (d == RlcBearerRouting_Type_NR) {
|
||||
adbgPrintLog(_ctx, "NR := %s (%d)", adbgSysInd__NR_CellId_Type__ToString(p->NR), (int)p->NR);
|
||||
return;
|
||||
}
|
||||
if (d == RlcBearerRouting_Type_None) {
|
||||
adbgPrintLog(_ctx, "None := %s", (p->None ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__RlcBearerRouting_Type(acpCtx_t _ctx, const struct RlcBearerRouting_Type* p)
|
||||
{
|
||||
_adbgSysInd__RlcBearerRouting_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__RlcBearerRouting_Type_IndAspCommonPart_Type_RlcBearerRouting_Optional(acpCtx_t _ctx, const struct RlcBearerRouting_Type_IndAspCommonPart_Type_RlcBearerRouting_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
_adbgSysInd__RlcBearerRouting_Type(_ctx, &p->v);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__IndAspCommonPart_Type(acpCtx_t _ctx, const struct IndAspCommonPart_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "CellId := %s (%d)", adbgSysInd__EUTRA_CellId_Type__ToString(p->CellId), (int)p->CellId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RoutingInfo := { ");
|
||||
_adbgSysInd__RoutingInfo_Type(_ctx, &p->RoutingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "TimingInfo := { ");
|
||||
_adbgSysInd__TimingInfo_Type(_ctx, &p->TimingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Status := { ");
|
||||
_adbgSysInd__IndicationStatus_Type(_ctx, &p->Status);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RlcBearerRouting := ");
|
||||
if (p->RlcBearerRouting.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgSysInd__RlcBearerRouting_Type_IndAspCommonPart_Type_RlcBearerRouting_Optional(_ctx, &p->RlcBearerRouting);
|
||||
if (p->RlcBearerRouting.d) { adbgPrintLog(_ctx, " }"); };
|
||||
}
|
||||
|
||||
static void _adbgSysInd__Int_RepetitionsPerPreambleAttempt_Optional(acpCtx_t _ctx, const struct int_RepetitionsPerPreambleAttempt_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "%d", (int)p->v);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__RachPreamble_Type(acpCtx_t _ctx, const struct RachPreamble_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "RAPID := %u", (unsigned int)p->RAPID);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "PRTPower := %s", (p->PRTPower ? "true" : "false"));
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RepetitionsPerPreambleAttempt := ");
|
||||
_adbgSysInd__Int_RepetitionsPerPreambleAttempt_Optional(_ctx, &p->RepetitionsPerPreambleAttempt);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__Short_BSR_Type(acpCtx_t _ctx, const struct Short_BSR_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "LCG := %d", (int)p->LCG);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Value := %d", (int)p->Value);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__Long_BSR_Type(acpCtx_t _ctx, const struct Long_BSR_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Value_LCG1 := %d", (int)p->Value_LCG1);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Value_LCG2 := %d", (int)p->Value_LCG2);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Value_LCG3 := %d", (int)p->Value_LCG3);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Value_LCG4 := %d", (int)p->Value_LCG4);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SL_BSR_Value_Type(acpCtx_t _ctx, const struct SL_BSR_Value_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "DestinationIndex := '");
|
||||
for (size_t i2 = 0; i2 < 4; i2++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->DestinationIndex[i2]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "LCG_ID := '");
|
||||
for (size_t i2 = 0; i2 < 2; i2++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->LCG_ID[i2]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "BufferSize := '");
|
||||
for (size_t i2 = 0; i2 < 6; i2++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->BufferSize[i2]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SL_BSR_MACHeader_Type(acpCtx_t _ctx, const struct SL_BSR_MACHeader_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "HeaderFieldLCID := '");
|
||||
for (size_t i1 = 0; i1 < 5; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->HeaderFieldLCID[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "HeaderFieldE := '");
|
||||
for (size_t i1 = 0; i1 < 1; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->HeaderFieldE[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "HeaderFieldF := '");
|
||||
for (size_t i1 = 0; i1 < 1; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->HeaderFieldF[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "SL_BSR_Value := { ");
|
||||
for (size_t i1 = 0; i1 < p->SL_BSR_Value.d; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgSysInd__SL_BSR_Value_Type(_ctx, &p->SL_BSR_Value.v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != p->SL_BSR_Value.d - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__BSR_Type_Value(acpCtx_t _ctx, const union BSR_Type_Value* p, enum BSR_Type_Sel d)
|
||||
{
|
||||
if (d == BSR_Type_Short) {
|
||||
adbgPrintLog(_ctx, "Short := { ");
|
||||
_adbgSysInd__Short_BSR_Type(_ctx, &p->Short);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == BSR_Type_Truncated) {
|
||||
adbgPrintLog(_ctx, "Truncated := { ");
|
||||
_adbgSysInd__Short_BSR_Type(_ctx, &p->Truncated);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == BSR_Type_Long) {
|
||||
adbgPrintLog(_ctx, "Long := { ");
|
||||
_adbgSysInd__Long_BSR_Type(_ctx, &p->Long);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == BSR_Type_Sidelink) {
|
||||
adbgPrintLog(_ctx, "Sidelink := { ");
|
||||
_adbgSysInd__SL_BSR_MACHeader_Type(_ctx, &p->Sidelink);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__BSR_Type(acpCtx_t _ctx, const struct BSR_Type* p)
|
||||
{
|
||||
_adbgSysInd__BSR_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static const char* adbgSysInd__HARQ_Type__ToString(HARQ_Type v)
|
||||
{
|
||||
switch(v) {
|
||||
case HARQ_Type_ack: return "HARQ_Type_ack";
|
||||
case HARQ_Type_nack: return "HARQ_Type_nack";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgSysInd__HarqProcessInfo_Type(acpCtx_t _ctx, const struct HarqProcessInfo_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Id := %u", (unsigned int)p->Id);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "CURRENT_TX_NB := %d", (int)p->CURRENT_TX_NB);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__HarqError_Type_Value(acpCtx_t _ctx, const union HarqError_Type_Value* p, enum HarqError_Type_Sel d)
|
||||
{
|
||||
if (d == HarqError_Type_UL) {
|
||||
adbgPrintLog(_ctx, "UL := { ");
|
||||
_adbgSysInd__HarqProcessInfo_Type(_ctx, &p->UL);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == HarqError_Type_DL) {
|
||||
adbgPrintLog(_ctx, "DL := { ");
|
||||
_adbgSysInd__HarqProcessInfo_Type(_ctx, &p->DL);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__HarqError_Type(acpCtx_t _ctx, const struct HarqError_Type* p)
|
||||
{
|
||||
_adbgSysInd__HarqError_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__RlcDiscardInd_Type(acpCtx_t _ctx, const struct RlcDiscardInd_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "SequenceNumber := %d", (int)p->SequenceNumber);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__ScellBitMap_Type(acpCtx_t _ctx, const struct ScellBitMap_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Value := '");
|
||||
for (size_t i1 = 0; i1 < 7; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->Value[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Reserved := '");
|
||||
for (size_t i1 = 0; i1 < 1; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->Reserved[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__B2_Type_Reserved_Optional(acpCtx_t _ctx, const struct B2_Type_Reserved_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i2 = 0; i2 < 2; i2++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i2]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__B6_Type_PCMaxc_Optional(acpCtx_t _ctx, const struct B6_Type_PCMaxc_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i2 = 0; i2 < 6; i2++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i2]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__PH_Record_Type(acpCtx_t _ctx, const struct PH_Record_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "P_Bit := '");
|
||||
for (size_t i2 = 0; i2 < 1; i2++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->P_Bit[i2]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "V_Bit := '");
|
||||
for (size_t i2 = 0; i2 < 1; i2++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->V_Bit[i2]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Valve := '");
|
||||
for (size_t i2 = 0; i2 < 6; i2++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->Valve[i2]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Reserved := ");
|
||||
_adbgSysInd__B2_Type_Reserved_Optional(_ctx, &p->Reserved);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "PCMaxc := ");
|
||||
_adbgSysInd__B6_Type_PCMaxc_Optional(_ctx, &p->PCMaxc);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__MAC_CTRL_ExtPowerHeadRoom_Type(acpCtx_t _ctx, const struct MAC_CTRL_ExtPowerHeadRoom_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "EPH_Octet1 := { ");
|
||||
_adbgSysInd__ScellBitMap_Type(_ctx, &p->EPH_Octet1);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "PH_RecordList := { ");
|
||||
for (size_t i1 = 0; i1 < p->PH_RecordList.d; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgSysInd__PH_Record_Type(_ctx, &p->PH_RecordList.v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != p->PH_RecordList.d - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static const char* adbgSysInd__SRSInd_Type__ToString(SRSInd_Type v)
|
||||
{
|
||||
switch(v) {
|
||||
case SRSInd_Type_SRS_Start: return "SRSInd_Type_SRS_Start";
|
||||
case SRSInd_Type_SRS_Stop: return "SRSInd_Type_SRS_Stop";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgSysInd__MAC_CTRL_DC_PowerHeadRoom_Type(acpCtx_t _ctx, const struct MAC_CTRL_DC_PowerHeadRoom_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "DC_PH_Octet1 := { ");
|
||||
_adbgSysInd__ScellBitMap_Type(_ctx, &p->DC_PH_Octet1);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "DC_PH_RecordList := { ");
|
||||
for (size_t i1 = 0; i1 < p->DC_PH_RecordList.d; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgSysInd__PH_Record_Type(_ctx, &p->DC_PH_RecordList.v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != p->DC_PH_RecordList.d - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SystemIndication_Type_Value(acpCtx_t _ctx, const union SystemIndication_Type_Value* p, enum SystemIndication_Type_Sel d)
|
||||
{
|
||||
if (d == SystemIndication_Type_Error) {
|
||||
adbgPrintLog(_ctx, "Error := '");
|
||||
for (size_t i1 = 0; i1 < p->Error.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->Error.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_RachPreamble) {
|
||||
adbgPrintLog(_ctx, "RachPreamble := { ");
|
||||
_adbgSysInd__RachPreamble_Type(_ctx, &p->RachPreamble);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_SchedReq) {
|
||||
adbgPrintLog(_ctx, "SchedReq := %s", (p->SchedReq ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_BSR) {
|
||||
adbgPrintLog(_ctx, "BSR := { ");
|
||||
_adbgSysInd__BSR_Type(_ctx, &p->BSR);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_UL_HARQ) {
|
||||
adbgPrintLog(_ctx, "UL_HARQ := %s (%d)", adbgSysInd__HARQ_Type__ToString(p->UL_HARQ), (int)p->UL_HARQ);
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_C_RNTI) {
|
||||
adbgPrintLog(_ctx, "C_RNTI := '");
|
||||
for (size_t i1 = 0; i1 < 16; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->C_RNTI[i1]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
if (d == SystemIndication_Type_PHR) {
|
||||
adbgPrintLog(_ctx, "PHR := %u", (unsigned int)p->PHR);
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_HarqError) {
|
||||
adbgPrintLog(_ctx, "HarqError := { ");
|
||||
_adbgSysInd__HarqError_Type(_ctx, &p->HarqError);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_RlcDiscardInd) {
|
||||
adbgPrintLog(_ctx, "RlcDiscardInd := { ");
|
||||
_adbgSysInd__RlcDiscardInd_Type(_ctx, &p->RlcDiscardInd);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_PeriodicRI) {
|
||||
adbgPrintLog(_ctx, "PeriodicRI := %u", (unsigned int)p->PeriodicRI);
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_EPHR) {
|
||||
adbgPrintLog(_ctx, "EPHR := { ");
|
||||
_adbgSysInd__MAC_CTRL_ExtPowerHeadRoom_Type(_ctx, &p->EPHR);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_CqiInd) {
|
||||
adbgPrintLog(_ctx, "CqiInd := %s", (p->CqiInd ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_SrsInd) {
|
||||
adbgPrintLog(_ctx, "SrsInd := %s (%d)", adbgSysInd__SRSInd_Type__ToString(p->SrsInd), (int)p->SrsInd);
|
||||
return;
|
||||
}
|
||||
if (d == SystemIndication_Type_DC_PHR) {
|
||||
adbgPrintLog(_ctx, "DC_PHR := { ");
|
||||
_adbgSysInd__MAC_CTRL_DC_PowerHeadRoom_Type(_ctx, &p->DC_PHR);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SystemIndication_Type(acpCtx_t _ctx, const struct SystemIndication_Type* p)
|
||||
{
|
||||
_adbgSysInd__SystemIndication_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysInd__SYSTEM_IND(acpCtx_t _ctx, const struct SYSTEM_IND* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Common := { ");
|
||||
_adbgSysInd__IndAspCommonPart_Type(_ctx, &p->Common);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Indication := { ");
|
||||
_adbgSysInd__SystemIndication_Type(_ctx, &p->Indication);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
void adbgSysIndProcessToSSLogOut(acpCtx_t _ctx, const struct SYSTEM_IND* ToSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@SysIndProcessToSS Out Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "ToSS := { ");
|
||||
_adbgSysInd__SYSTEM_IND(_ctx, ToSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
593
openair3/SS/Sidl/lib/adbg/src/adbgSysSrb.c
Normal file
593
openair3/SS/Sidl/lib/adbg/src/adbgSysSrb.c
Normal file
@@ -0,0 +1,593 @@
|
||||
/*
|
||||
* 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 "adbgSysSrb.h"
|
||||
|
||||
static const char* adbgSysSrb__EUTRA_CellId_Type__ToString(EUTRA_CellId_Type v)
|
||||
{
|
||||
switch(v) {
|
||||
case eutra_Cell_NonSpecific: return "eutra_Cell_NonSpecific";
|
||||
case eutra_Cell1: return "eutra_Cell1";
|
||||
case eutra_Cell2: return "eutra_Cell2";
|
||||
case eutra_Cell3: return "eutra_Cell3";
|
||||
case eutra_Cell4: return "eutra_Cell4";
|
||||
case eutra_Cell6: return "eutra_Cell6";
|
||||
case eutra_Cell10: return "eutra_Cell10";
|
||||
case eutra_Cell11: return "eutra_Cell11";
|
||||
case eutra_Cell12: return "eutra_Cell12";
|
||||
case eutra_Cell13: return "eutra_Cell13";
|
||||
case eutra_Cell14: return "eutra_Cell14";
|
||||
case eutra_Cell23: return "eutra_Cell23";
|
||||
case eutra_Cell28: return "eutra_Cell28";
|
||||
case eutra_Cell29: return "eutra_Cell29";
|
||||
case eutra_Cell30: return "eutra_Cell30";
|
||||
case eutra_Cell31: return "eutra_Cell31";
|
||||
case eutra_CellA: return "eutra_CellA";
|
||||
case eutra_CellB: return "eutra_CellB";
|
||||
case eutra_CellC: return "eutra_CellC";
|
||||
case eutra_CellD: return "eutra_CellD";
|
||||
case eutra_CellE: return "eutra_CellE";
|
||||
case eutra_CellG: return "eutra_CellG";
|
||||
case eutra_CellH: return "eutra_CellH";
|
||||
case eutra_CellI: return "eutra_CellI";
|
||||
case eutra_CellJ: return "eutra_CellJ";
|
||||
case eutra_CellK: return "eutra_CellK";
|
||||
case eutra_CellL: return "eutra_CellL";
|
||||
case eutra_CellM: return "eutra_CellM";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__PmchLogicalChannel_Type(acpCtx_t _ctx, const struct PmchLogicalChannel_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Pmch_InfoIndex := %u", (unsigned int)p->Pmch_InfoIndex);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "LogicalChannelIdentity := %u", (unsigned int)p->LogicalChannelIdentity);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__MRB_Identity_Type(acpCtx_t _ctx, const struct MRB_Identity_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Mbsfn_AreaId := %u", (unsigned int)p->Mbsfn_AreaId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "PmchLogicalChannel := { ");
|
||||
_adbgSysSrb__PmchLogicalChannel_Type(_ctx, &p->PmchLogicalChannel);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__MCC_PLMN_Identity_mcc_Optional(acpCtx_t _ctx, const struct MCC_PLMN_Identity_mcc_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < 3; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__PLMN_Identity(acpCtx_t _ctx, const struct PLMN_Identity* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "mcc := ");
|
||||
_adbgSysSrb__MCC_PLMN_Identity_mcc_Optional(_ctx, &p->mcc);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "mnc := '");
|
||||
for (size_t i1 = 0; i1 < p->mnc.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->mnc.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__TMGI_r9_plmn_Id_r9_Value(acpCtx_t _ctx, const union TMGI_r9_plmn_Id_r9_Value* p, enum TMGI_r9_plmn_Id_r9_Sel d)
|
||||
{
|
||||
if (d == TMGI_r9_plmn_Id_r9_plmn_Index_r9) {
|
||||
adbgPrintLog(_ctx, "plmn_Index_r9 := %u", (unsigned int)p->plmn_Index_r9);
|
||||
return;
|
||||
}
|
||||
if (d == TMGI_r9_plmn_Id_r9_explicitValue_r9) {
|
||||
adbgPrintLog(_ctx, "explicitValue_r9 := { ");
|
||||
_adbgSysSrb__PLMN_Identity(_ctx, &p->explicitValue_r9);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__TMGI_r9_plmn_Id_r9(acpCtx_t _ctx, const struct TMGI_r9_plmn_Id_r9* p)
|
||||
{
|
||||
_adbgSysSrb__TMGI_r9_plmn_Id_r9_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__TMGI_r9(acpCtx_t _ctx, const struct TMGI_r9* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "plmn_Id_r9 := { ");
|
||||
_adbgSysSrb__TMGI_r9_plmn_Id_r9(_ctx, &p->plmn_Id_r9);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "serviceId_r9 := '");
|
||||
for (size_t i1 = 0; i1 < 3; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->serviceId_r9[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__O1_MBMSSessionInfo_r13_sessionId_r13_Optional(acpCtx_t _ctx, const struct O1_MBMSSessionInfo_r13_sessionId_r13_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < 1; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__MBMSSessionInfo_r13(acpCtx_t _ctx, const struct MBMSSessionInfo_r13* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "tmgi_r13 := { ");
|
||||
_adbgSysSrb__TMGI_r9(_ctx, &p->tmgi_r13);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "sessionId_r13 := ");
|
||||
_adbgSysSrb__O1_MBMSSessionInfo_r13_sessionId_r13_Optional(_ctx, &p->sessionId_r13);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__SC_MRB_Identity_Type(acpCtx_t _ctx, const struct SC_MRB_Identity_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "MbmsSessionInfo := { ");
|
||||
_adbgSysSrb__MBMSSessionInfo_r13(_ctx, &p->MbmsSessionInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RadioBearerId_Type_Value(acpCtx_t _ctx, const union RadioBearerId_Type_Value* p, enum RadioBearerId_Type_Sel d)
|
||||
{
|
||||
if (d == RadioBearerId_Type_Srb) {
|
||||
adbgPrintLog(_ctx, "Srb := %u", (unsigned int)p->Srb);
|
||||
return;
|
||||
}
|
||||
if (d == RadioBearerId_Type_Drb) {
|
||||
adbgPrintLog(_ctx, "Drb := %u", (unsigned int)p->Drb);
|
||||
return;
|
||||
}
|
||||
if (d == RadioBearerId_Type_Mrb) {
|
||||
adbgPrintLog(_ctx, "Mrb := { ");
|
||||
_adbgSysSrb__MRB_Identity_Type(_ctx, &p->Mrb);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == RadioBearerId_Type_ScMrb) {
|
||||
adbgPrintLog(_ctx, "ScMrb := { ");
|
||||
_adbgSysSrb__SC_MRB_Identity_Type(_ctx, &p->ScMrb);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RadioBearerId_Type(acpCtx_t _ctx, const struct RadioBearerId_Type* p)
|
||||
{
|
||||
_adbgSysSrb__RadioBearerId_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__QosFlow_Identification_Type(acpCtx_t _ctx, const struct QosFlow_Identification_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "PDU_SessionId := %d", (int)p->PDU_SessionId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "QFI := %d", (int)p->QFI);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RoutingInfo_Type_Value(acpCtx_t _ctx, const union RoutingInfo_Type_Value* p, enum RoutingInfo_Type_Sel d)
|
||||
{
|
||||
if (d == RoutingInfo_Type_None) {
|
||||
adbgPrintLog(_ctx, "None := %s", (p->None ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == RoutingInfo_Type_RadioBearerId) {
|
||||
adbgPrintLog(_ctx, "RadioBearerId := { ");
|
||||
_adbgSysSrb__RadioBearerId_Type(_ctx, &p->RadioBearerId);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == RoutingInfo_Type_QosFlow) {
|
||||
adbgPrintLog(_ctx, "QosFlow := { ");
|
||||
_adbgSysSrb__QosFlow_Identification_Type(_ctx, &p->QosFlow);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RoutingInfo_Type(acpCtx_t _ctx, const struct RoutingInfo_Type* p)
|
||||
{
|
||||
_adbgSysSrb__RoutingInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__SystemFrameNumberInfo_Type_Value(acpCtx_t _ctx, const union SystemFrameNumberInfo_Type_Value* p, enum SystemFrameNumberInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SystemFrameNumberInfo_Type_Number) {
|
||||
adbgPrintLog(_ctx, "Number := %u", (unsigned int)p->Number);
|
||||
return;
|
||||
}
|
||||
if (d == SystemFrameNumberInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__SystemFrameNumberInfo_Type(acpCtx_t _ctx, const struct SystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
_adbgSysSrb__SystemFrameNumberInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__SubFrameInfo_Type_Value(acpCtx_t _ctx, const union SubFrameInfo_Type_Value* p, enum SubFrameInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SubFrameInfo_Type_Number) {
|
||||
adbgPrintLog(_ctx, "Number := %u", (unsigned int)p->Number);
|
||||
return;
|
||||
}
|
||||
if (d == SubFrameInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__SubFrameInfo_Type(acpCtx_t _ctx, const struct SubFrameInfo_Type* p)
|
||||
{
|
||||
_adbgSysSrb__SubFrameInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__HyperSystemFrameNumberInfo_Type(acpCtx_t _ctx, const HyperSystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
_adbgSysSrb__SystemFrameNumberInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__SlotOffset_Type_Value(acpCtx_t _ctx, const union SlotOffset_Type_Value* p, enum SlotOffset_Type_Sel d)
|
||||
{
|
||||
if (d == SlotOffset_Type_Numerology0) {
|
||||
adbgPrintLog(_ctx, "Numerology0 := %s", (p->Numerology0 ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology1) {
|
||||
adbgPrintLog(_ctx, "Numerology1 := %u", (unsigned int)p->Numerology1);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology2) {
|
||||
adbgPrintLog(_ctx, "Numerology2 := %u", (unsigned int)p->Numerology2);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology3) {
|
||||
adbgPrintLog(_ctx, "Numerology3 := %u", (unsigned int)p->Numerology3);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology4) {
|
||||
adbgPrintLog(_ctx, "Numerology4 := %u", (unsigned int)p->Numerology4);
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__SlotOffset_Type(acpCtx_t _ctx, const struct SlotOffset_Type* p)
|
||||
{
|
||||
_adbgSysSrb__SlotOffset_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__SlotTimingInfo_Type_Value(acpCtx_t _ctx, const union SlotTimingInfo_Type_Value* p, enum SlotTimingInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SlotTimingInfo_Type_SlotOffset) {
|
||||
adbgPrintLog(_ctx, "SlotOffset := { ");
|
||||
_adbgSysSrb__SlotOffset_Type(_ctx, &p->SlotOffset);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_FirstSlot) {
|
||||
adbgPrintLog(_ctx, "FirstSlot := %s", (p->FirstSlot ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__SlotTimingInfo_Type(acpCtx_t _ctx, const struct SlotTimingInfo_Type* p)
|
||||
{
|
||||
_adbgSysSrb__SlotTimingInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__SubFrameTiming_Type(acpCtx_t _ctx, const struct SubFrameTiming_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "SFN := { ");
|
||||
_adbgSysSrb__SystemFrameNumberInfo_Type(_ctx, &p->SFN);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Subframe := { ");
|
||||
_adbgSysSrb__SubFrameInfo_Type(_ctx, &p->Subframe);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "HSFN := { ");
|
||||
_adbgSysSrb__HyperSystemFrameNumberInfo_Type(_ctx, &p->HSFN);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Slot := { ");
|
||||
_adbgSysSrb__SlotTimingInfo_Type(_ctx, &p->Slot);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__TimingInfo_Type_Value(acpCtx_t _ctx, const union TimingInfo_Type_Value* p, enum TimingInfo_Type_Sel d)
|
||||
{
|
||||
if (d == TimingInfo_Type_SubFrame) {
|
||||
adbgPrintLog(_ctx, "SubFrame := { ");
|
||||
_adbgSysSrb__SubFrameTiming_Type(_ctx, &p->SubFrame);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == TimingInfo_Type_Now) {
|
||||
adbgPrintLog(_ctx, "Now := %s", (p->Now ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == TimingInfo_Type_None) {
|
||||
adbgPrintLog(_ctx, "None := %s", (p->None ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__TimingInfo_Type(acpCtx_t _ctx, const struct TimingInfo_Type* p)
|
||||
{
|
||||
_adbgSysSrb__TimingInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__IntegrityErrorIndication_Type(acpCtx_t _ctx, const struct IntegrityErrorIndication_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Nas := %s", (p->Nas ? "true" : "false"));
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Pdcp := %s", (p->Pdcp ? "true" : "false"));
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__ErrorIndication_Type(acpCtx_t _ctx, const struct ErrorIndication_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Integrity := { ");
|
||||
_adbgSysSrb__IntegrityErrorIndication_Type(_ctx, &p->Integrity);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "System := %d", (int)p->System);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__IndicationStatus_Type_Value(acpCtx_t _ctx, const union IndicationStatus_Type_Value* p, enum IndicationStatus_Type_Sel d)
|
||||
{
|
||||
if (d == IndicationStatus_Type_Ok) {
|
||||
adbgPrintLog(_ctx, "Ok := %s", (p->Ok ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == IndicationStatus_Type_Error) {
|
||||
adbgPrintLog(_ctx, "Error := { ");
|
||||
_adbgSysSrb__ErrorIndication_Type(_ctx, &p->Error);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__IndicationStatus_Type(acpCtx_t _ctx, const struct IndicationStatus_Type* p)
|
||||
{
|
||||
_adbgSysSrb__IndicationStatus_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static const char* adbgSysSrb__NR_CellId_Type__ToString(NR_CellId_Type v)
|
||||
{
|
||||
switch(v) {
|
||||
case nr_Cell_NonSpecific: return "nr_Cell_NonSpecific";
|
||||
case nr_Cell1: return "nr_Cell1";
|
||||
case nr_Cell2: return "nr_Cell2";
|
||||
case nr_Cell3: return "nr_Cell3";
|
||||
case nr_Cell4: return "nr_Cell4";
|
||||
case nr_Cell6: return "nr_Cell6";
|
||||
case nr_Cell10: return "nr_Cell10";
|
||||
case nr_Cell11: return "nr_Cell11";
|
||||
case nr_Cell12: return "nr_Cell12";
|
||||
case nr_Cell13: return "nr_Cell13";
|
||||
case nr_Cell14: return "nr_Cell14";
|
||||
case nr_Cell23: return "nr_Cell23";
|
||||
case nr_Cell28: return "nr_Cell28";
|
||||
case nr_Cell29: return "nr_Cell29";
|
||||
case nr_Cell30: return "nr_Cell30";
|
||||
case nr_Cell31: return "nr_Cell31";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RlcBearerRouting_Type_Value(acpCtx_t _ctx, const union RlcBearerRouting_Type_Value* p, enum RlcBearerRouting_Type_Sel d)
|
||||
{
|
||||
if (d == RlcBearerRouting_Type_EUTRA) {
|
||||
adbgPrintLog(_ctx, "EUTRA := %s (%d)", adbgSysSrb__EUTRA_CellId_Type__ToString(p->EUTRA), (int)p->EUTRA);
|
||||
return;
|
||||
}
|
||||
if (d == RlcBearerRouting_Type_NR) {
|
||||
adbgPrintLog(_ctx, "NR := %s (%d)", adbgSysSrb__NR_CellId_Type__ToString(p->NR), (int)p->NR);
|
||||
return;
|
||||
}
|
||||
if (d == RlcBearerRouting_Type_None) {
|
||||
adbgPrintLog(_ctx, "None := %s", (p->None ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RlcBearerRouting_Type(acpCtx_t _ctx, const struct RlcBearerRouting_Type* p)
|
||||
{
|
||||
_adbgSysSrb__RlcBearerRouting_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RlcBearerRouting_Type_IndAspCommonPart_Type_RlcBearerRouting_Optional(acpCtx_t _ctx, const struct RlcBearerRouting_Type_IndAspCommonPart_Type_RlcBearerRouting_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
_adbgSysSrb__RlcBearerRouting_Type(_ctx, &p->v);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__IndAspCommonPart_Type(acpCtx_t _ctx, const struct IndAspCommonPart_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "CellId := %s (%d)", adbgSysSrb__EUTRA_CellId_Type__ToString(p->CellId), (int)p->CellId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RoutingInfo := { ");
|
||||
_adbgSysSrb__RoutingInfo_Type(_ctx, &p->RoutingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "TimingInfo := { ");
|
||||
_adbgSysSrb__TimingInfo_Type(_ctx, &p->TimingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Status := { ");
|
||||
_adbgSysSrb__IndicationStatus_Type(_ctx, &p->Status);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RlcBearerRouting := ");
|
||||
if (p->RlcBearerRouting.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgSysSrb__RlcBearerRouting_Type_IndAspCommonPart_Type_RlcBearerRouting_Optional(_ctx, &p->RlcBearerRouting);
|
||||
if (p->RlcBearerRouting.d) { adbgPrintLog(_ctx, " }"); };
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RRC_MSG_Indication_Type_Value(acpCtx_t _ctx, const union RRC_MSG_Indication_Type_Value* p, enum RRC_MSG_Indication_Type_Sel d)
|
||||
{
|
||||
if (d == RRC_MSG_Indication_Type_Ccch) {
|
||||
adbgPrintLog(_ctx, "Ccch := '");
|
||||
for (size_t i1 = 0; i1 < p->Ccch.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->Ccch.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
return;
|
||||
}
|
||||
if (d == RRC_MSG_Indication_Type_Dcch) {
|
||||
adbgPrintLog(_ctx, "Dcch := '");
|
||||
for (size_t i1 = 0; i1 < p->Dcch.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->Dcch.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RRC_MSG_Indication_Type(acpCtx_t _ctx, const struct RRC_MSG_Indication_Type* p)
|
||||
{
|
||||
_adbgSysSrb__RRC_MSG_Indication_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__EUTRA_RRC_PDU_IND(acpCtx_t _ctx, const struct EUTRA_RRC_PDU_IND* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Common := { ");
|
||||
_adbgSysSrb__IndAspCommonPart_Type(_ctx, &p->Common);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RrcPdu := { ");
|
||||
_adbgSysSrb__RRC_MSG_Indication_Type(_ctx, &p->RrcPdu);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
void adbgSysSrbProcessToSSLogOut(acpCtx_t _ctx, const struct EUTRA_RRC_PDU_IND* ToSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@SysSrbProcessToSS Out Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "ToSS := { ");
|
||||
_adbgSysSrb__EUTRA_RRC_PDU_IND(_ctx, ToSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__ReqAspControlInfo_Type(acpCtx_t _ctx, const struct ReqAspControlInfo_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "CnfFlag := %s", (p->CnfFlag ? "true" : "false"));
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "FollowOnFlag := %s", (p->FollowOnFlag ? "true" : "false"));
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RlcBearerRouting_Type_ReqAspCommonPart_Type_RlcBearerRouting_Optional(acpCtx_t _ctx, const struct RlcBearerRouting_Type_ReqAspCommonPart_Type_RlcBearerRouting_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
_adbgSysSrb__RlcBearerRouting_Type(_ctx, &p->v);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__ReqAspCommonPart_Type(acpCtx_t _ctx, const struct ReqAspCommonPart_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "CellId := %s (%d)", adbgSysSrb__EUTRA_CellId_Type__ToString(p->CellId), (int)p->CellId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RoutingInfo := { ");
|
||||
_adbgSysSrb__RoutingInfo_Type(_ctx, &p->RoutingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "TimingInfo := { ");
|
||||
_adbgSysSrb__TimingInfo_Type(_ctx, &p->TimingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "ControlInfo := { ");
|
||||
_adbgSysSrb__ReqAspControlInfo_Type(_ctx, &p->ControlInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RlcBearerRouting := ");
|
||||
if (p->RlcBearerRouting.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgSysSrb__RlcBearerRouting_Type_ReqAspCommonPart_Type_RlcBearerRouting_Optional(_ctx, &p->RlcBearerRouting);
|
||||
if (p->RlcBearerRouting.d) { adbgPrintLog(_ctx, " }"); };
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RRC_MSG_Request_Type_Value(acpCtx_t _ctx, const union RRC_MSG_Request_Type_Value* p, enum RRC_MSG_Request_Type_Sel d)
|
||||
{
|
||||
if (d == RRC_MSG_Request_Type_Ccch) {
|
||||
adbgPrintLog(_ctx, "Ccch := '");
|
||||
for (size_t i1 = 0; i1 < p->Ccch.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->Ccch.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
return;
|
||||
}
|
||||
if (d == RRC_MSG_Request_Type_Dcch) {
|
||||
adbgPrintLog(_ctx, "Dcch := '");
|
||||
for (size_t i1 = 0; i1 < p->Dcch.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->Dcch.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__RRC_MSG_Request_Type(acpCtx_t _ctx, const struct RRC_MSG_Request_Type* p)
|
||||
{
|
||||
_adbgSysSrb__RRC_MSG_Request_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysSrb__EUTRA_RRC_PDU_REQ(acpCtx_t _ctx, const struct EUTRA_RRC_PDU_REQ* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Common := { ");
|
||||
_adbgSysSrb__ReqAspCommonPart_Type(_ctx, &p->Common);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RrcPdu := { ");
|
||||
_adbgSysSrb__RRC_MSG_Request_Type(_ctx, &p->RrcPdu);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
void adbgSysSrbProcessFromSSLogIn(acpCtx_t _ctx, const struct EUTRA_RRC_PDU_REQ* FromSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@SysSrbProcessFromSS In Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "FromSS := { ");
|
||||
_adbgSysSrb__EUTRA_RRC_PDU_REQ(_ctx, FromSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
164
openair3/SS/Sidl/lib/adbg/src/adbgSysVT.c
Normal file
164
openair3/SS/Sidl/lib/adbg/src/adbgSysVT.c
Normal file
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* 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 "adbgSysVT.h"
|
||||
|
||||
static void _adbgSysVT__SystemFrameNumberInfo_Type_Value(acpCtx_t _ctx, const union SystemFrameNumberInfo_Type_Value* p, enum SystemFrameNumberInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SystemFrameNumberInfo_Type_Number) {
|
||||
adbgPrintLog(_ctx, "Number := %u", (unsigned int)p->Number);
|
||||
return;
|
||||
}
|
||||
if (d == SystemFrameNumberInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysVT__SystemFrameNumberInfo_Type(acpCtx_t _ctx, const struct SystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
_adbgSysVT__SystemFrameNumberInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysVT__SubFrameInfo_Type_Value(acpCtx_t _ctx, const union SubFrameInfo_Type_Value* p, enum SubFrameInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SubFrameInfo_Type_Number) {
|
||||
adbgPrintLog(_ctx, "Number := %u", (unsigned int)p->Number);
|
||||
return;
|
||||
}
|
||||
if (d == SubFrameInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysVT__SubFrameInfo_Type(acpCtx_t _ctx, const struct SubFrameInfo_Type* p)
|
||||
{
|
||||
_adbgSysVT__SubFrameInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysVT__HyperSystemFrameNumberInfo_Type(acpCtx_t _ctx, const HyperSystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
_adbgSysVT__SystemFrameNumberInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysVT__SlotOffset_Type_Value(acpCtx_t _ctx, const union SlotOffset_Type_Value* p, enum SlotOffset_Type_Sel d)
|
||||
{
|
||||
if (d == SlotOffset_Type_Numerology0) {
|
||||
adbgPrintLog(_ctx, "Numerology0 := %s", (p->Numerology0 ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology1) {
|
||||
adbgPrintLog(_ctx, "Numerology1 := %u", (unsigned int)p->Numerology1);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology2) {
|
||||
adbgPrintLog(_ctx, "Numerology2 := %u", (unsigned int)p->Numerology2);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology3) {
|
||||
adbgPrintLog(_ctx, "Numerology3 := %u", (unsigned int)p->Numerology3);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology4) {
|
||||
adbgPrintLog(_ctx, "Numerology4 := %u", (unsigned int)p->Numerology4);
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysVT__SlotOffset_Type(acpCtx_t _ctx, const struct SlotOffset_Type* p)
|
||||
{
|
||||
_adbgSysVT__SlotOffset_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysVT__SlotTimingInfo_Type_Value(acpCtx_t _ctx, const union SlotTimingInfo_Type_Value* p, enum SlotTimingInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SlotTimingInfo_Type_SlotOffset) {
|
||||
adbgPrintLog(_ctx, "SlotOffset := { ");
|
||||
_adbgSysVT__SlotOffset_Type(_ctx, &p->SlotOffset);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_FirstSlot) {
|
||||
adbgPrintLog(_ctx, "FirstSlot := %s", (p->FirstSlot ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgSysVT__SlotTimingInfo_Type(acpCtx_t _ctx, const struct SlotTimingInfo_Type* p)
|
||||
{
|
||||
_adbgSysVT__SlotTimingInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgSysVT__SubFrameTiming_Type(acpCtx_t _ctx, const struct SubFrameTiming_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "SFN := { ");
|
||||
_adbgSysVT__SystemFrameNumberInfo_Type(_ctx, &p->SFN);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Subframe := { ");
|
||||
_adbgSysVT__SubFrameInfo_Type(_ctx, &p->Subframe);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "HSFN := { ");
|
||||
_adbgSysVT__HyperSystemFrameNumberInfo_Type(_ctx, &p->HSFN);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Slot := { ");
|
||||
_adbgSysVT__SlotTimingInfo_Type(_ctx, &p->Slot);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgSysVT__VirtualTimeInfo_Type(acpCtx_t _ctx, const struct VirtualTimeInfo_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Enable := %s", (p->Enable ? "true" : "false"));
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "TimingInfo := { ");
|
||||
_adbgSysVT__SubFrameTiming_Type(_ctx, &p->TimingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
void adbgSysVTEnquireTimingUpdLogOut(acpCtx_t _ctx, const struct VirtualTimeInfo_Type* TimingInfoToSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@SysVTEnquireTimingUpd Out Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "TimingInfoToSS := { ");
|
||||
_adbgSysVT__VirtualTimeInfo_Type(_ctx, TimingInfoToSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
void adbgSysVTEnquireTimingAckLogIn(acpCtx_t _ctx, const struct VirtualTimeInfo_Type* TimingInfoFromSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@SysVTEnquireTimingAck In Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "TimingInfoFromSS := { ");
|
||||
_adbgSysVT__VirtualTimeInfo_Type(_ctx, TimingInfoFromSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
624
openair3/SS/Sidl/lib/adbg/src/adbgTest.c
Normal file
624
openair3/SS/Sidl/lib/adbg/src/adbgTest.c
Normal file
@@ -0,0 +1,624 @@
|
||||
/*
|
||||
* 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 "adbgTest.h"
|
||||
|
||||
void adbgTestHelloFromSSLogIn(acpCtx_t _ctx, size_t StrQty, const char* StrArray)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@TestHelloFromSS In Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "Str := '");
|
||||
for (size_t i1 = 0; i1 < StrQty; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", StrArray[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
void adbgTestHelloToSSLogOut(acpCtx_t _ctx, size_t StrQty, const char* StrArray)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@TestHelloToSS Out Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "Str := '");
|
||||
for (size_t i1 = 0; i1 < StrQty; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", StrArray[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
void adbgTestPingLogIn(acpCtx_t _ctx, uint32_t FromSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@TestPing In Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "FromSS := %u", (unsigned int)FromSS);
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
void adbgTestPingLogOut(acpCtx_t _ctx, uint32_t ToSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@TestPing Out Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "ToSS := %u", (unsigned int)ToSS);
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
static void _adbgTest__Empty(acpCtx_t _ctx, const struct Empty* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "dummy := %d", (int)p->dummy);
|
||||
}
|
||||
|
||||
static void _adbgTest__EchoData(acpCtx_t _ctx, const struct EchoData* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "str := \"%s\"", p->str);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "empty := { ");
|
||||
for (size_t i1 = 0; i1 < p->emptyQty; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__Empty(_ctx, &p->emptyArray[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != p->emptyQty - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "eee := { ");
|
||||
_adbgTest__Empty(_ctx, p->eee);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "sss := { ");
|
||||
_adbgTest__Empty(_ctx, &p->sss);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
void adbgTestEchoLogIn(acpCtx_t _ctx, const struct EchoData* FromSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@TestEcho In Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "FromSS := { ");
|
||||
_adbgTest__EchoData(_ctx, FromSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
void adbgTestEchoLogOut(acpCtx_t _ctx, const struct EchoData* ToSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@TestEcho Out Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "ToSS := { ");
|
||||
_adbgTest__EchoData(_ctx, ToSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
static void _adbgTest__Char_Foo_DynamicOptional(acpCtx_t _ctx, const struct char_Foo_DynamicOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < p->v.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgTest__Char_Koo_ArrayOptional(acpCtx_t _ctx, const struct char_Koo_ArrayOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < 25; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgTest__Int_Bar_Optional(acpCtx_t _ctx, const struct int_Bar_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "%d", (int)p->v);
|
||||
}
|
||||
|
||||
static void _adbgTest__Output(acpCtx_t _ctx, const struct Output* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Foo := ");
|
||||
_adbgTest__Char_Foo_DynamicOptional(_ctx, &p->Foo);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Koo := ");
|
||||
_adbgTest__Char_Koo_ArrayOptional(_ctx, &p->Koo);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Bar := ");
|
||||
_adbgTest__Int_Bar_Optional(_ctx, &p->Bar);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Zoo := '");
|
||||
for (size_t i1 = 0; i1 < p->Zoo.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->Zoo.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Z := '");
|
||||
for (size_t i1 = 0; i1 < p->ZQty; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->ZArray[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Far := { ");
|
||||
for (size_t i1 = 0; i1 < p->Far.d; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__Empty(_ctx, &p->Far.v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != p->Far.d - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
void adbgTestTest1LogIn(acpCtx_t _ctx, const struct Output* out)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@TestTest1 In Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "out := { ");
|
||||
_adbgTest__Output(_ctx, out);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
void adbgTestTest2LogOut(acpCtx_t _ctx, const struct Output* out)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@TestTest2 Out Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "out := { ");
|
||||
_adbgTest__Output(_ctx, out);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
static const char* adbgTest__SomeEnum__ToString(SomeEnum v)
|
||||
{
|
||||
switch(v) {
|
||||
case SomeEnum_Zero: return "SomeEnum_Zero";
|
||||
case SomeEnum_One: return "SomeEnum_One";
|
||||
case SomeEnum_Two: return "SomeEnum_Two";
|
||||
case SomeEnum_Three: return "SomeEnum_Three";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgTest__Complex(acpCtx_t _ctx, const struct Complex* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "val := %d", (int)p->val);
|
||||
}
|
||||
|
||||
static void _adbgTest__Empty2(acpCtx_t _ctx, const struct Empty2* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "dummy := %d", (int)p->dummy);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "simple := '");
|
||||
for (size_t i1 = 0; i1 < 3; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->simple[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "complex := { ");
|
||||
for (size_t i1 = 0; i1 < 3; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__Complex(_ctx, &p->complex[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != 3 - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgTest__Empty_optional_struct_1_Optional(acpCtx_t _ctx, const struct Empty_optional_struct_1_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
_adbgTest__Empty(_ctx, &p->v);
|
||||
}
|
||||
|
||||
static void _adbgTest__Empty_optional_struct_2_Optional(acpCtx_t _ctx, const struct Empty_optional_struct_2_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
_adbgTest__Empty(_ctx, &p->v);
|
||||
}
|
||||
|
||||
static void _adbgTest__Int_optional_int_1_Optional(acpCtx_t _ctx, const struct int_optional_int_1_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "%d", (int)p->v);
|
||||
}
|
||||
|
||||
static void _adbgTest__Int_optional_int_2_Optional(acpCtx_t _ctx, const struct int_optional_int_2_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "%d", (int)p->v);
|
||||
}
|
||||
|
||||
static void _adbgTest__Char_optional_string_1_Optional(acpCtx_t _ctx, const struct char_optional_string_1_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "\"%s\"", p->v);
|
||||
}
|
||||
|
||||
static void _adbgTest__Char_optional_string_2_Optional(acpCtx_t _ctx, const struct char_optional_string_2_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "\"%s\"", p->v);
|
||||
}
|
||||
|
||||
static void _adbgTest__Empty_optional_struct_array_1_ArrayOptional(acpCtx_t _ctx, const struct Empty_optional_struct_array_1_ArrayOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
for (size_t i1 = 0; i1 < 2; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__Empty(_ctx, &p->v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != 2 - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgTest__Empty_optional_struct_array_2_ArrayOptional(acpCtx_t _ctx, const struct Empty_optional_struct_array_2_ArrayOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
for (size_t i1 = 0; i1 < 2; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__Empty(_ctx, &p->v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != 2 - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgTest__Int_optional_int_array_1_ArrayOptional(acpCtx_t _ctx, const struct int_optional_int_array_1_ArrayOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < 2; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgTest__Int_optional_int_array_2_ArrayOptional(acpCtx_t _ctx, const struct int_optional_int_array_2_ArrayOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < 2; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgTest__Empty_dynamic_optional_struct_1_DynamicOptional(acpCtx_t _ctx, const struct Empty_dynamic_optional_struct_1_DynamicOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
for (size_t i1 = 0; i1 < p->v.d; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__Empty(_ctx, &p->v.v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != p->v.d - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgTest__Empty_dynamic_optional_struct_2_DynamicOptional(acpCtx_t _ctx, const struct Empty_dynamic_optional_struct_2_DynamicOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
for (size_t i1 = 0; i1 < p->v.d; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__Empty(_ctx, &p->v.v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != p->v.d - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgTest__Int_dynamic_optional_int_1_DynamicOptional(acpCtx_t _ctx, const struct int_dynamic_optional_int_1_DynamicOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < p->v.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgTest__Int_dynamic_optional_int_2_DynamicOptional(acpCtx_t _ctx, const struct int_dynamic_optional_int_2_DynamicOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < p->v.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgTest__TestUnion_Value(acpCtx_t _ctx, const union TestUnion_Value* p, enum TestUnion_Sel d)
|
||||
{
|
||||
if (d == TestUnion_Zero) {
|
||||
adbgPrintLog(_ctx, "Zero := %d", (int)p->Zero);
|
||||
return;
|
||||
}
|
||||
if (d == TestUnion_One) {
|
||||
adbgPrintLog(_ctx, "One := %d", (int)p->One);
|
||||
return;
|
||||
}
|
||||
if (d == TestUnion_Two) {
|
||||
adbgPrintLog(_ctx, "Two := { ");
|
||||
_adbgTest__Empty(_ctx, &p->Two);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == TestUnion_Three) {
|
||||
adbgPrintLog(_ctx, "Three := { ");
|
||||
_adbgTest__Empty(_ctx, &p->Three);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgTest__TestUnion(acpCtx_t _ctx, const struct TestUnion* p)
|
||||
{
|
||||
_adbgTest__TestUnion_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgTest__TestUnion_optional_union_1_Optional(acpCtx_t _ctx, const struct TestUnion_optional_union_1_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
_adbgTest__TestUnion(_ctx, &p->v);
|
||||
}
|
||||
|
||||
static void _adbgTest__TestUnion_optional_union_pointer_1_Optional(acpCtx_t _ctx, const struct TestUnion_optional_union_pointer_1_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
_adbgTest__TestUnion(_ctx, p->v);
|
||||
}
|
||||
|
||||
static void _adbgTest__TestUnion_optional_union_2_Optional(acpCtx_t _ctx, const struct TestUnion_optional_union_2_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
_adbgTest__TestUnion(_ctx, &p->v);
|
||||
}
|
||||
|
||||
static void _adbgTest__TestUnion_dynamic_optional_union_1_DynamicOptional(acpCtx_t _ctx, const struct TestUnion_dynamic_optional_union_1_DynamicOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
for (size_t i1 = 0; i1 < p->v.d; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__TestUnion(_ctx, &p->v.v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != p->v.d - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgTest__TestUnion_dynamic_optional_union_2_DynamicOptional(acpCtx_t _ctx, const struct TestUnion_dynamic_optional_union_2_DynamicOptional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
for (size_t i1 = 0; i1 < p->v.d; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__TestUnion(_ctx, &p->v.v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != p->v.d - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgTest__New(acpCtx_t _ctx, const struct New* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "dynamic_struct := { ");
|
||||
for (size_t i1 = 0; i1 < p->dynamic_struct.d; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__Empty(_ctx, &p->dynamic_struct.v[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != p->dynamic_struct.d - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "dynamic_ints := '");
|
||||
for (size_t i1 = 0; i1 < p->dynamic_ints.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->dynamic_ints.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_struct_1 := ");
|
||||
if (p->optional_struct_1.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__Empty_optional_struct_1_Optional(_ctx, &p->optional_struct_1);
|
||||
if (p->optional_struct_1.d) { adbgPrintLog(_ctx, " }"); };
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_struct_2 := ");
|
||||
if (p->optional_struct_2.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__Empty_optional_struct_2_Optional(_ctx, &p->optional_struct_2);
|
||||
if (p->optional_struct_2.d) { adbgPrintLog(_ctx, " }"); };
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_int_1 := ");
|
||||
_adbgTest__Int_optional_int_1_Optional(_ctx, &p->optional_int_1);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_int_2 := ");
|
||||
_adbgTest__Int_optional_int_2_Optional(_ctx, &p->optional_int_2);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_string_1 := ");
|
||||
_adbgTest__Char_optional_string_1_Optional(_ctx, &p->optional_string_1);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_string_2 := ");
|
||||
_adbgTest__Char_optional_string_2_Optional(_ctx, &p->optional_string_2);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_struct_array_1 := ");
|
||||
if (p->optional_struct_array_1.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__Empty_optional_struct_array_1_ArrayOptional(_ctx, &p->optional_struct_array_1);
|
||||
if (p->optional_struct_array_1.d) { adbgPrintLog(_ctx, " }"); };
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_struct_array_2 := ");
|
||||
if (p->optional_struct_array_2.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__Empty_optional_struct_array_2_ArrayOptional(_ctx, &p->optional_struct_array_2);
|
||||
if (p->optional_struct_array_2.d) { adbgPrintLog(_ctx, " }"); };
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_int_array_1 := ");
|
||||
_adbgTest__Int_optional_int_array_1_ArrayOptional(_ctx, &p->optional_int_array_1);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_int_array_2 := ");
|
||||
_adbgTest__Int_optional_int_array_2_ArrayOptional(_ctx, &p->optional_int_array_2);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "dynamic_optional_struct_1 := ");
|
||||
if (p->dynamic_optional_struct_1.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__Empty_dynamic_optional_struct_1_DynamicOptional(_ctx, &p->dynamic_optional_struct_1);
|
||||
if (p->dynamic_optional_struct_1.d) { adbgPrintLog(_ctx, " }"); };
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "dynamic_optional_struct_2 := ");
|
||||
if (p->dynamic_optional_struct_2.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__Empty_dynamic_optional_struct_2_DynamicOptional(_ctx, &p->dynamic_optional_struct_2);
|
||||
if (p->dynamic_optional_struct_2.d) { adbgPrintLog(_ctx, " }"); };
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "dynamic_optional_int_1 := ");
|
||||
_adbgTest__Int_dynamic_optional_int_1_DynamicOptional(_ctx, &p->dynamic_optional_int_1);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "dynamic_optional_int_2 := ");
|
||||
_adbgTest__Int_dynamic_optional_int_2_DynamicOptional(_ctx, &p->dynamic_optional_int_2);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "union_test_pointer := { ");
|
||||
_adbgTest__TestUnion(_ctx, p->union_test_pointer);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "union_test := { ");
|
||||
_adbgTest__TestUnion(_ctx, &p->union_test);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_union_1 := ");
|
||||
if (p->optional_union_1.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__TestUnion_optional_union_1_Optional(_ctx, &p->optional_union_1);
|
||||
if (p->optional_union_1.d) { adbgPrintLog(_ctx, " }"); };
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_union_pointer_1 := ");
|
||||
if (p->optional_union_pointer_1.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__TestUnion_optional_union_pointer_1_Optional(_ctx, &p->optional_union_pointer_1);
|
||||
if (p->optional_union_pointer_1.d) { adbgPrintLog(_ctx, " }"); };
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "optional_union_2 := ");
|
||||
if (p->optional_union_2.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__TestUnion_optional_union_2_Optional(_ctx, &p->optional_union_2);
|
||||
if (p->optional_union_2.d) { adbgPrintLog(_ctx, " }"); };
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "dynamic_optional_union_1 := ");
|
||||
if (p->dynamic_optional_union_1.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__TestUnion_dynamic_optional_union_1_DynamicOptional(_ctx, &p->dynamic_optional_union_1);
|
||||
if (p->dynamic_optional_union_1.d) { adbgPrintLog(_ctx, " }"); };
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "dynamic_optional_union_2 := ");
|
||||
if (p->dynamic_optional_union_2.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgTest__TestUnion_dynamic_optional_union_2_DynamicOptional(_ctx, &p->dynamic_optional_union_2);
|
||||
if (p->dynamic_optional_union_2.d) { adbgPrintLog(_ctx, " }"); };
|
||||
}
|
||||
|
||||
void adbgTestOtherLogIn(acpCtx_t _ctx, const struct Empty* in1, uint32_t in2, size_t in3Qty, const char* in3Array, const char* in4, bool in5, int in6, float in7, SomeEnum in8, size_t in9Qty, const struct Empty* in9Array, const struct Empty2* in10, const struct New* in11)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@TestOther In Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "in1 := { ");
|
||||
_adbgTest__Empty(_ctx, in1);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "in2 := %u", (unsigned int)in2);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "in3 := '");
|
||||
for (size_t i1 = 0; i1 < in3Qty; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", in3Array[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "in4 := \"%s\"", in4);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "in5 := %s", (in5 ? "true" : "false"));
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "in6 := %d", (int)in6);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "in7 := %.6f", (double)in7);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "in8 := %s (%d)", adbgTest__SomeEnum__ToString(in8), (int)in8);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "in9 := { ");
|
||||
for (size_t i1 = 0; i1 < in9Qty; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__Empty(_ctx, &in9Array[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != in9Qty - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "in10 := { ");
|
||||
_adbgTest__Empty2(_ctx, in10);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "in11 := { ");
|
||||
_adbgTest__New(_ctx, in11);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
void adbgTestOtherLogOut(acpCtx_t _ctx, const struct Empty* out1, uint32_t out2, size_t out3Qty, const char* out3Array, const char* out4, bool out5, int out6, float out7, SomeEnum out8, size_t out9Qty, const struct Empty* out9Array, const struct Empty2* out10, const struct New* out11)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@TestOther Out Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "out1 := { ");
|
||||
_adbgTest__Empty(_ctx, out1);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "out2 := %u", (unsigned int)out2);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "out3 := '");
|
||||
for (size_t i1 = 0; i1 < out3Qty; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", out3Array[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "out4 := \"%s\"", out4);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "out5 := %s", (out5 ? "true" : "false"));
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "out6 := %d", (int)out6);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "out7 := %.6f", (double)out7);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "out8 := %s (%d)", adbgTest__SomeEnum__ToString(out8), (int)out8);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "out9 := { ");
|
||||
for (size_t i1 = 0; i1 < out9Qty; i1++) {
|
||||
adbgPrintLog(_ctx, "{ ");
|
||||
_adbgTest__Empty(_ctx, &out9Array[i1]);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
if (i1 != out9Qty - 1) { adbgPrintLog(_ctx, ", "); }
|
||||
}
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "out10 := { ");
|
||||
_adbgTest__Empty2(_ctx, out10);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "out11 := { ");
|
||||
_adbgTest__New(_ctx, out11);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
564
openair3/SS/Sidl/lib/adbg/src/adbgVng.c
Normal file
564
openair3/SS/Sidl/lib/adbg/src/adbgVng.c
Normal file
@@ -0,0 +1,564 @@
|
||||
/*
|
||||
* 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 "adbgVng.h"
|
||||
|
||||
static const char* adbgVng__EUTRA_CellId_Type__ToString(EUTRA_CellId_Type v)
|
||||
{
|
||||
switch(v) {
|
||||
case eutra_Cell_NonSpecific: return "eutra_Cell_NonSpecific";
|
||||
case eutra_Cell1: return "eutra_Cell1";
|
||||
case eutra_Cell2: return "eutra_Cell2";
|
||||
case eutra_Cell3: return "eutra_Cell3";
|
||||
case eutra_Cell4: return "eutra_Cell4";
|
||||
case eutra_Cell6: return "eutra_Cell6";
|
||||
case eutra_Cell10: return "eutra_Cell10";
|
||||
case eutra_Cell11: return "eutra_Cell11";
|
||||
case eutra_Cell12: return "eutra_Cell12";
|
||||
case eutra_Cell13: return "eutra_Cell13";
|
||||
case eutra_Cell14: return "eutra_Cell14";
|
||||
case eutra_Cell23: return "eutra_Cell23";
|
||||
case eutra_Cell28: return "eutra_Cell28";
|
||||
case eutra_Cell29: return "eutra_Cell29";
|
||||
case eutra_Cell30: return "eutra_Cell30";
|
||||
case eutra_Cell31: return "eutra_Cell31";
|
||||
case eutra_CellA: return "eutra_CellA";
|
||||
case eutra_CellB: return "eutra_CellB";
|
||||
case eutra_CellC: return "eutra_CellC";
|
||||
case eutra_CellD: return "eutra_CellD";
|
||||
case eutra_CellE: return "eutra_CellE";
|
||||
case eutra_CellG: return "eutra_CellG";
|
||||
case eutra_CellH: return "eutra_CellH";
|
||||
case eutra_CellI: return "eutra_CellI";
|
||||
case eutra_CellJ: return "eutra_CellJ";
|
||||
case eutra_CellK: return "eutra_CellK";
|
||||
case eutra_CellL: return "eutra_CellL";
|
||||
case eutra_CellM: return "eutra_CellM";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgVng__PmchLogicalChannel_Type(acpCtx_t _ctx, const struct PmchLogicalChannel_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Pmch_InfoIndex := %u", (unsigned int)p->Pmch_InfoIndex);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "LogicalChannelIdentity := %u", (unsigned int)p->LogicalChannelIdentity);
|
||||
}
|
||||
|
||||
static void _adbgVng__MRB_Identity_Type(acpCtx_t _ctx, const struct MRB_Identity_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Mbsfn_AreaId := %u", (unsigned int)p->Mbsfn_AreaId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "PmchLogicalChannel := { ");
|
||||
_adbgVng__PmchLogicalChannel_Type(_ctx, &p->PmchLogicalChannel);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgVng__MCC_PLMN_Identity_mcc_Optional(acpCtx_t _ctx, const struct MCC_PLMN_Identity_mcc_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < 3; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgVng__PLMN_Identity(acpCtx_t _ctx, const struct PLMN_Identity* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "mcc := ");
|
||||
_adbgVng__MCC_PLMN_Identity_mcc_Optional(_ctx, &p->mcc);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "mnc := '");
|
||||
for (size_t i1 = 0; i1 < p->mnc.d; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->mnc.v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgVng__TMGI_r9_plmn_Id_r9_Value(acpCtx_t _ctx, const union TMGI_r9_plmn_Id_r9_Value* p, enum TMGI_r9_plmn_Id_r9_Sel d)
|
||||
{
|
||||
if (d == TMGI_r9_plmn_Id_r9_plmn_Index_r9) {
|
||||
adbgPrintLog(_ctx, "plmn_Index_r9 := %u", (unsigned int)p->plmn_Index_r9);
|
||||
return;
|
||||
}
|
||||
if (d == TMGI_r9_plmn_Id_r9_explicitValue_r9) {
|
||||
adbgPrintLog(_ctx, "explicitValue_r9 := { ");
|
||||
_adbgVng__PLMN_Identity(_ctx, &p->explicitValue_r9);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__TMGI_r9_plmn_Id_r9(acpCtx_t _ctx, const struct TMGI_r9_plmn_Id_r9* p)
|
||||
{
|
||||
_adbgVng__TMGI_r9_plmn_Id_r9_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__TMGI_r9(acpCtx_t _ctx, const struct TMGI_r9* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "plmn_Id_r9 := { ");
|
||||
_adbgVng__TMGI_r9_plmn_Id_r9(_ctx, &p->plmn_Id_r9);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "serviceId_r9 := '");
|
||||
for (size_t i1 = 0; i1 < 3; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->serviceId_r9[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgVng__O1_MBMSSessionInfo_r13_sessionId_r13_Optional(acpCtx_t _ctx, const struct O1_MBMSSessionInfo_r13_sessionId_r13_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
adbgPrintLog(_ctx, "'");
|
||||
for (size_t i1 = 0; i1 < 1; i1++) {
|
||||
adbgPrintLog(_ctx, "%02X", p->v[i1]);
|
||||
}
|
||||
adbgPrintLog(_ctx, "'O");
|
||||
}
|
||||
|
||||
static void _adbgVng__MBMSSessionInfo_r13(acpCtx_t _ctx, const struct MBMSSessionInfo_r13* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "tmgi_r13 := { ");
|
||||
_adbgVng__TMGI_r9(_ctx, &p->tmgi_r13);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "sessionId_r13 := ");
|
||||
_adbgVng__O1_MBMSSessionInfo_r13_sessionId_r13_Optional(_ctx, &p->sessionId_r13);
|
||||
}
|
||||
|
||||
static void _adbgVng__SC_MRB_Identity_Type(acpCtx_t _ctx, const struct SC_MRB_Identity_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "MbmsSessionInfo := { ");
|
||||
_adbgVng__MBMSSessionInfo_r13(_ctx, &p->MbmsSessionInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgVng__RadioBearerId_Type_Value(acpCtx_t _ctx, const union RadioBearerId_Type_Value* p, enum RadioBearerId_Type_Sel d)
|
||||
{
|
||||
if (d == RadioBearerId_Type_Srb) {
|
||||
adbgPrintLog(_ctx, "Srb := %u", (unsigned int)p->Srb);
|
||||
return;
|
||||
}
|
||||
if (d == RadioBearerId_Type_Drb) {
|
||||
adbgPrintLog(_ctx, "Drb := %u", (unsigned int)p->Drb);
|
||||
return;
|
||||
}
|
||||
if (d == RadioBearerId_Type_Mrb) {
|
||||
adbgPrintLog(_ctx, "Mrb := { ");
|
||||
_adbgVng__MRB_Identity_Type(_ctx, &p->Mrb);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == RadioBearerId_Type_ScMrb) {
|
||||
adbgPrintLog(_ctx, "ScMrb := { ");
|
||||
_adbgVng__SC_MRB_Identity_Type(_ctx, &p->ScMrb);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__RadioBearerId_Type(acpCtx_t _ctx, const struct RadioBearerId_Type* p)
|
||||
{
|
||||
_adbgVng__RadioBearerId_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__QosFlow_Identification_Type(acpCtx_t _ctx, const struct QosFlow_Identification_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "PDU_SessionId := %d", (int)p->PDU_SessionId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "QFI := %d", (int)p->QFI);
|
||||
}
|
||||
|
||||
static void _adbgVng__RoutingInfo_Type_Value(acpCtx_t _ctx, const union RoutingInfo_Type_Value* p, enum RoutingInfo_Type_Sel d)
|
||||
{
|
||||
if (d == RoutingInfo_Type_None) {
|
||||
adbgPrintLog(_ctx, "None := %s", (p->None ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == RoutingInfo_Type_RadioBearerId) {
|
||||
adbgPrintLog(_ctx, "RadioBearerId := { ");
|
||||
_adbgVng__RadioBearerId_Type(_ctx, &p->RadioBearerId);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == RoutingInfo_Type_QosFlow) {
|
||||
adbgPrintLog(_ctx, "QosFlow := { ");
|
||||
_adbgVng__QosFlow_Identification_Type(_ctx, &p->QosFlow);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__RoutingInfo_Type(acpCtx_t _ctx, const struct RoutingInfo_Type* p)
|
||||
{
|
||||
_adbgVng__RoutingInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__SystemFrameNumberInfo_Type_Value(acpCtx_t _ctx, const union SystemFrameNumberInfo_Type_Value* p, enum SystemFrameNumberInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SystemFrameNumberInfo_Type_Number) {
|
||||
adbgPrintLog(_ctx, "Number := %u", (unsigned int)p->Number);
|
||||
return;
|
||||
}
|
||||
if (d == SystemFrameNumberInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__SystemFrameNumberInfo_Type(acpCtx_t _ctx, const struct SystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
_adbgVng__SystemFrameNumberInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__SubFrameInfo_Type_Value(acpCtx_t _ctx, const union SubFrameInfo_Type_Value* p, enum SubFrameInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SubFrameInfo_Type_Number) {
|
||||
adbgPrintLog(_ctx, "Number := %u", (unsigned int)p->Number);
|
||||
return;
|
||||
}
|
||||
if (d == SubFrameInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__SubFrameInfo_Type(acpCtx_t _ctx, const struct SubFrameInfo_Type* p)
|
||||
{
|
||||
_adbgVng__SubFrameInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__HyperSystemFrameNumberInfo_Type(acpCtx_t _ctx, const HyperSystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
_adbgVng__SystemFrameNumberInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__SlotOffset_Type_Value(acpCtx_t _ctx, const union SlotOffset_Type_Value* p, enum SlotOffset_Type_Sel d)
|
||||
{
|
||||
if (d == SlotOffset_Type_Numerology0) {
|
||||
adbgPrintLog(_ctx, "Numerology0 := %s", (p->Numerology0 ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology1) {
|
||||
adbgPrintLog(_ctx, "Numerology1 := %u", (unsigned int)p->Numerology1);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology2) {
|
||||
adbgPrintLog(_ctx, "Numerology2 := %u", (unsigned int)p->Numerology2);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology3) {
|
||||
adbgPrintLog(_ctx, "Numerology3 := %u", (unsigned int)p->Numerology3);
|
||||
return;
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology4) {
|
||||
adbgPrintLog(_ctx, "Numerology4 := %u", (unsigned int)p->Numerology4);
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__SlotOffset_Type(acpCtx_t _ctx, const struct SlotOffset_Type* p)
|
||||
{
|
||||
_adbgVng__SlotOffset_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__SlotTimingInfo_Type_Value(acpCtx_t _ctx, const union SlotTimingInfo_Type_Value* p, enum SlotTimingInfo_Type_Sel d)
|
||||
{
|
||||
if (d == SlotTimingInfo_Type_SlotOffset) {
|
||||
adbgPrintLog(_ctx, "SlotOffset := { ");
|
||||
_adbgVng__SlotOffset_Type(_ctx, &p->SlotOffset);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_FirstSlot) {
|
||||
adbgPrintLog(_ctx, "FirstSlot := %s", (p->FirstSlot ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_Any) {
|
||||
adbgPrintLog(_ctx, "Any := %s", (p->Any ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__SlotTimingInfo_Type(acpCtx_t _ctx, const struct SlotTimingInfo_Type* p)
|
||||
{
|
||||
_adbgVng__SlotTimingInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__SubFrameTiming_Type(acpCtx_t _ctx, const struct SubFrameTiming_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "SFN := { ");
|
||||
_adbgVng__SystemFrameNumberInfo_Type(_ctx, &p->SFN);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Subframe := { ");
|
||||
_adbgVng__SubFrameInfo_Type(_ctx, &p->Subframe);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "HSFN := { ");
|
||||
_adbgVng__HyperSystemFrameNumberInfo_Type(_ctx, &p->HSFN);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Slot := { ");
|
||||
_adbgVng__SlotTimingInfo_Type(_ctx, &p->Slot);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgVng__TimingInfo_Type_Value(acpCtx_t _ctx, const union TimingInfo_Type_Value* p, enum TimingInfo_Type_Sel d)
|
||||
{
|
||||
if (d == TimingInfo_Type_SubFrame) {
|
||||
adbgPrintLog(_ctx, "SubFrame := { ");
|
||||
_adbgVng__SubFrameTiming_Type(_ctx, &p->SubFrame);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == TimingInfo_Type_Now) {
|
||||
adbgPrintLog(_ctx, "Now := %s", (p->Now ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == TimingInfo_Type_None) {
|
||||
adbgPrintLog(_ctx, "None := %s", (p->None ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__TimingInfo_Type(acpCtx_t _ctx, const struct TimingInfo_Type* p)
|
||||
{
|
||||
_adbgVng__TimingInfo_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__ReqAspControlInfo_Type(acpCtx_t _ctx, const struct ReqAspControlInfo_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "CnfFlag := %s", (p->CnfFlag ? "true" : "false"));
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "FollowOnFlag := %s", (p->FollowOnFlag ? "true" : "false"));
|
||||
}
|
||||
|
||||
static const char* adbgVng__NR_CellId_Type__ToString(NR_CellId_Type v)
|
||||
{
|
||||
switch(v) {
|
||||
case nr_Cell_NonSpecific: return "nr_Cell_NonSpecific";
|
||||
case nr_Cell1: return "nr_Cell1";
|
||||
case nr_Cell2: return "nr_Cell2";
|
||||
case nr_Cell3: return "nr_Cell3";
|
||||
case nr_Cell4: return "nr_Cell4";
|
||||
case nr_Cell6: return "nr_Cell6";
|
||||
case nr_Cell10: return "nr_Cell10";
|
||||
case nr_Cell11: return "nr_Cell11";
|
||||
case nr_Cell12: return "nr_Cell12";
|
||||
case nr_Cell13: return "nr_Cell13";
|
||||
case nr_Cell14: return "nr_Cell14";
|
||||
case nr_Cell23: return "nr_Cell23";
|
||||
case nr_Cell28: return "nr_Cell28";
|
||||
case nr_Cell29: return "nr_Cell29";
|
||||
case nr_Cell30: return "nr_Cell30";
|
||||
case nr_Cell31: return "nr_Cell31";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgVng__RlcBearerRouting_Type_Value(acpCtx_t _ctx, const union RlcBearerRouting_Type_Value* p, enum RlcBearerRouting_Type_Sel d)
|
||||
{
|
||||
if (d == RlcBearerRouting_Type_EUTRA) {
|
||||
adbgPrintLog(_ctx, "EUTRA := %s (%d)", adbgVng__EUTRA_CellId_Type__ToString(p->EUTRA), (int)p->EUTRA);
|
||||
return;
|
||||
}
|
||||
if (d == RlcBearerRouting_Type_NR) {
|
||||
adbgPrintLog(_ctx, "NR := %s (%d)", adbgVng__NR_CellId_Type__ToString(p->NR), (int)p->NR);
|
||||
return;
|
||||
}
|
||||
if (d == RlcBearerRouting_Type_None) {
|
||||
adbgPrintLog(_ctx, "None := %s", (p->None ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__RlcBearerRouting_Type(acpCtx_t _ctx, const struct RlcBearerRouting_Type* p)
|
||||
{
|
||||
_adbgVng__RlcBearerRouting_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__RlcBearerRouting_Type_ReqAspCommonPart_Type_RlcBearerRouting_Optional(acpCtx_t _ctx, const struct RlcBearerRouting_Type_ReqAspCommonPart_Type_RlcBearerRouting_Optional* p)
|
||||
{
|
||||
if (!p->d) { adbgPrintLog(_ctx, "omit"); return; }
|
||||
_adbgVng__RlcBearerRouting_Type(_ctx, &p->v);
|
||||
}
|
||||
|
||||
static void _adbgVng__ReqAspCommonPart_Type(acpCtx_t _ctx, const struct ReqAspCommonPart_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "CellId := %s (%d)", adbgVng__EUTRA_CellId_Type__ToString(p->CellId), (int)p->CellId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RoutingInfo := { ");
|
||||
_adbgVng__RoutingInfo_Type(_ctx, &p->RoutingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "TimingInfo := { ");
|
||||
_adbgVng__TimingInfo_Type(_ctx, &p->TimingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "ControlInfo := { ");
|
||||
_adbgVng__ReqAspControlInfo_Type(_ctx, &p->ControlInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RlcBearerRouting := ");
|
||||
if (p->RlcBearerRouting.d) { adbgPrintLog(_ctx, "{ "); };
|
||||
_adbgVng__RlcBearerRouting_Type_ReqAspCommonPart_Type_RlcBearerRouting_Optional(_ctx, &p->RlcBearerRouting);
|
||||
if (p->RlcBearerRouting.d) { adbgPrintLog(_ctx, " }"); };
|
||||
}
|
||||
|
||||
static const char* adbgVng__Dl_Bandwidth_Type__ToString(Dl_Bandwidth_Type v)
|
||||
{
|
||||
switch(v) {
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_n6: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_n6";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_n15: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_n15";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_n25: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_n25";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_n50: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_n50";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_n75: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_n75";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_n100: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_n100";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_spare10: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_spare10";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_spare9: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_spare9";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_spare8: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_spare8";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_spare7: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_spare7";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_spare6: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_spare6";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_spare5: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_spare5";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_spare4: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_spare4";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_spare3: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_spare3";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_spare2: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_spare2";
|
||||
case CarrierBandwidthEUTRA_dl_Bandwidth_e_spare1: return "CarrierBandwidthEUTRA_dl_Bandwidth_e_spare1";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void _adbgVng__EUTRA_VngConfigInfo_Type(acpCtx_t _ctx, const struct EUTRA_VngConfigInfo_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Bandwidth := %s (%d)", adbgVng__Dl_Bandwidth_Type__ToString(p->Bandwidth), (int)p->Bandwidth);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "NocLevel := %d", (int)p->NocLevel);
|
||||
}
|
||||
|
||||
static void _adbgVng__EUTRA_VngConfigRequest_Type_Value(acpCtx_t _ctx, const union EUTRA_VngConfigRequest_Type_Value* p, enum EUTRA_VngConfigRequest_Type_Sel d)
|
||||
{
|
||||
if (d == EUTRA_VngConfigRequest_Type_Configure) {
|
||||
adbgPrintLog(_ctx, "Configure := { ");
|
||||
_adbgVng__EUTRA_VngConfigInfo_Type(_ctx, &p->Configure);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
return;
|
||||
}
|
||||
if (d == EUTRA_VngConfigRequest_Type_Activate) {
|
||||
adbgPrintLog(_ctx, "Activate := %s", (p->Activate ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == EUTRA_VngConfigRequest_Type_Deactivate) {
|
||||
adbgPrintLog(_ctx, "Deactivate := %s", (p->Deactivate ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__EUTRA_VngConfigRequest_Type(acpCtx_t _ctx, const struct EUTRA_VngConfigRequest_Type* p)
|
||||
{
|
||||
_adbgVng__EUTRA_VngConfigRequest_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__EUTRA_VNG_CTRL_REQ(acpCtx_t _ctx, const struct EUTRA_VNG_CTRL_REQ* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Common := { ");
|
||||
_adbgVng__ReqAspCommonPart_Type(_ctx, &p->Common);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Request := { ");
|
||||
_adbgVng__EUTRA_VngConfigRequest_Type(_ctx, &p->Request);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
void adbgVngProcessLogIn(acpCtx_t _ctx, const struct EUTRA_VNG_CTRL_REQ* FromSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@VngProcess In Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "FromSS := { ");
|
||||
_adbgVng__EUTRA_VNG_CTRL_REQ(_ctx, FromSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
|
||||
static void _adbgVng__ConfirmationResult_Type_Value(acpCtx_t _ctx, const union ConfirmationResult_Type_Value* p, enum ConfirmationResult_Type_Sel d)
|
||||
{
|
||||
if (d == ConfirmationResult_Type_Success) {
|
||||
adbgPrintLog(_ctx, "Success := %s", (p->Success ? "true" : "false"));
|
||||
return;
|
||||
}
|
||||
if (d == ConfirmationResult_Type_Error) {
|
||||
adbgPrintLog(_ctx, "Error := %d", (int)p->Error);
|
||||
return;
|
||||
}
|
||||
adbgPrintLog(_ctx, "INVALID");
|
||||
}
|
||||
|
||||
static void _adbgVng__ConfirmationResult_Type(acpCtx_t _ctx, const struct ConfirmationResult_Type* p)
|
||||
{
|
||||
_adbgVng__ConfirmationResult_Type_Value(_ctx, &p->v, p->d);
|
||||
}
|
||||
|
||||
static void _adbgVng__CnfAspCommonPart_Type(acpCtx_t _ctx, const struct CnfAspCommonPart_Type* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "CellId := %s (%d)", adbgVng__EUTRA_CellId_Type__ToString(p->CellId), (int)p->CellId);
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "RoutingInfo := { ");
|
||||
_adbgVng__RoutingInfo_Type(_ctx, &p->RoutingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "TimingInfo := { ");
|
||||
_adbgVng__TimingInfo_Type(_ctx, &p->TimingInfo);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Result := { ");
|
||||
_adbgVng__ConfirmationResult_Type(_ctx, &p->Result);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
}
|
||||
|
||||
static void _adbgVng__EUTRA_VNG_CTRL_CNF(acpCtx_t _ctx, const struct EUTRA_VNG_CTRL_CNF* p)
|
||||
{
|
||||
adbgPrintLog(_ctx, "Common := { ");
|
||||
_adbgVng__CnfAspCommonPart_Type(_ctx, &p->Common);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintLog(_ctx, ", ");
|
||||
adbgPrintLog(_ctx, "Confirm := %s", (p->Confirm ? "true" : "false"));
|
||||
}
|
||||
|
||||
void adbgVngProcessLogOut(acpCtx_t _ctx, const struct EUTRA_VNG_CTRL_CNF* ToSS)
|
||||
{
|
||||
adbgPrintLog(_ctx, "@VngProcess Out Args : { ");
|
||||
|
||||
adbgPrintLog(_ctx, "ToSS := { ");
|
||||
_adbgVng__EUTRA_VNG_CTRL_CNF(_ctx, ToSS);
|
||||
adbgPrintLog(_ctx, " }");
|
||||
|
||||
adbgPrintLog(_ctx, " }");
|
||||
adbgPrintFormatLog(_ctx);
|
||||
}
|
||||
36
openair3/SS/Sidl/lib/ser/api/serDrb.h
Normal file
36
openair3/SS/Sidl/lib/ser/api/serDrb.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_EUTRA_DRB_PORT.h"
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int serDrbProcessFromSSEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct DRB_COMMON_REQ* FromSS);
|
||||
|
||||
int serDrbProcessFromSSDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct DRB_COMMON_REQ** FromSS);
|
||||
|
||||
void serDrbProcessFromSSFreeSrv(struct DRB_COMMON_REQ* FromSS);
|
||||
|
||||
int serDrbProcessToSSEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct DRB_COMMON_IND* ToSS);
|
||||
|
||||
int serDrbProcessToSSDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct DRB_COMMON_IND** ToSS);
|
||||
|
||||
void serDrbProcessToSSFreeClt(struct DRB_COMMON_IND* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
36
openair3/SS/Sidl/lib/ser/api/serHandshake.h
Normal file
36
openair3/SS/Sidl/lib/ser/api/serHandshake.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_Handshake.h"
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int serHandshakeHandleFromSSEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct AcpHandshake_Type* fromSS);
|
||||
|
||||
int serHandshakeHandleFromSSDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct AcpHandshake_Type** fromSS);
|
||||
|
||||
void serHandshakeHandleFromSSFreeSrv(struct AcpHandshake_Type* fromSS);
|
||||
|
||||
int serHandshakeHandleToSSEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct AcpHandshakeRsp_Type* toSS);
|
||||
|
||||
int serHandshakeHandleToSSDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct AcpHandshakeRsp_Type** toSS);
|
||||
|
||||
void serHandshakeHandleToSSFreeClt(struct AcpHandshakeRsp_Type* toSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
60
openair3/SS/Sidl/lib/ser/api/serMem.h
Normal file
60
openair3/SS/Sidl/lib/ser/api/serMem.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// System includes
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// Internal includes
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
/** Defines magic value for memory context.*/
|
||||
#define SER_MEM_MAGIC 0x0AC90AC9
|
||||
|
||||
/** Defines magic value for dynamic memory context.*/
|
||||
#define SER_MEM_DYNAMIC_MAGIC 0x1AC91AC9
|
||||
|
||||
/** Defines memory context. */
|
||||
struct serMemCtx {
|
||||
uint32_t magic;
|
||||
size_t size;
|
||||
size_t index;
|
||||
};
|
||||
|
||||
/** Memory context handle. */
|
||||
typedef struct serMemCtx* serMem_t;
|
||||
|
||||
/** Initialize memory context. */
|
||||
serMem_t serMemInit(unsigned char* arena, unsigned int aSize);
|
||||
|
||||
/** Allocates size bytes and returns a pointer to the allocated memory. */
|
||||
void* serMalloc(serMem_t mem, size_t size);
|
||||
|
||||
/** frees the memory space pointed to by ptr, which must have been returned
|
||||
* by a previous call serMalloc.*/
|
||||
void serFree(void* ptr);
|
||||
|
||||
/** Defines preinitialized memory context for dynamic memory allocation. */
|
||||
extern serMem_t serMemDyn;
|
||||
|
||||
/** Defines convenient way to allocate memory using dynamic allocation. */
|
||||
#define SER_DYN_ALLOC(sIZE) serMalloc(serMemDyn, (sIZE))
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
36
openair3/SS/Sidl/lib/ser/api/serSys.h
Normal file
36
openair3/SS/Sidl/lib/ser/api/serSys.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_EUTRA_SYSTEM_PORT.h"
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int serSysProcessEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct SYSTEM_CTRL_REQ* FromSS);
|
||||
|
||||
int serSysProcessDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct SYSTEM_CTRL_REQ** FromSS);
|
||||
|
||||
void serSysProcessFreeSrv(struct SYSTEM_CTRL_REQ* FromSS);
|
||||
|
||||
int serSysProcessEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct SYSTEM_CTRL_CNF* ToSS);
|
||||
|
||||
int serSysProcessDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct SYSTEM_CTRL_CNF** ToSS);
|
||||
|
||||
void serSysProcessFreeClt(struct SYSTEM_CTRL_CNF* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
30
openair3/SS/Sidl/lib/ser/api/serSysInd.h
Normal file
30
openair3/SS/Sidl/lib/ser/api/serSysInd.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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_EUTRA_SYSIND_PORT.h"
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int serSysIndProcessToSSEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct SYSTEM_IND* ToSS);
|
||||
|
||||
int serSysIndProcessToSSDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct SYSTEM_IND** ToSS);
|
||||
|
||||
void serSysIndProcessToSSFreeClt(struct SYSTEM_IND* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
36
openair3/SS/Sidl/lib/ser/api/serSysSrb.h
Normal file
36
openair3/SS/Sidl/lib/ser/api/serSysSrb.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_EUTRA_SYSTEM_PORT.h"
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int serSysSrbProcessToSSEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct EUTRA_RRC_PDU_IND* ToSS);
|
||||
|
||||
int serSysSrbProcessToSSDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct EUTRA_RRC_PDU_IND** ToSS);
|
||||
|
||||
void serSysSrbProcessToSSFreeClt(struct EUTRA_RRC_PDU_IND* ToSS);
|
||||
|
||||
int serSysSrbProcessFromSSEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct EUTRA_RRC_PDU_REQ* FromSS);
|
||||
|
||||
int serSysSrbProcessFromSSDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct EUTRA_RRC_PDU_REQ** FromSS);
|
||||
|
||||
void serSysSrbProcessFromSSFreeSrv(struct EUTRA_RRC_PDU_REQ* FromSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
36
openair3/SS/Sidl/lib/ser/api/serSysVT.h
Normal file
36
openair3/SS/Sidl/lib/ser/api/serSysVT.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_VIRTUAL_TIME_PORT.h"
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int serSysVTEnquireTimingUpdEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct VirtualTimeInfo_Type* TimingInfoToSS);
|
||||
|
||||
int serSysVTEnquireTimingUpdDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct VirtualTimeInfo_Type** TimingInfoToSS);
|
||||
|
||||
void serSysVTEnquireTimingUpdFreeClt(struct VirtualTimeInfo_Type* TimingInfoToSS);
|
||||
|
||||
int serSysVTEnquireTimingAckEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct VirtualTimeInfo_Type* TimingInfoFromSS);
|
||||
|
||||
int serSysVTEnquireTimingAckDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct VirtualTimeInfo_Type** TimingInfoFromSS);
|
||||
|
||||
void serSysVTEnquireTimingAckFreeSrv(struct VirtualTimeInfo_Type* TimingInfoFromSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
80
openair3/SS/Sidl/lib/ser/api/serTest.h
Normal file
80
openair3/SS/Sidl/lib/ser/api/serTest.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* 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_Test.h"
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int serTestHelloFromSSEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, size_t StrQty, const char* StrArray);
|
||||
|
||||
int serTestHelloFromSSDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, size_t* StrQty, char** StrArray);
|
||||
|
||||
void serTestHelloFromSSFreeSrv(char* StrArray);
|
||||
|
||||
int serTestHelloToSSEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, size_t StrQty, const char* StrArray);
|
||||
|
||||
int serTestHelloToSSDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, size_t* StrQty, char** StrArray);
|
||||
|
||||
void serTestHelloToSSFreeClt(char* StrArray);
|
||||
|
||||
int serTestPingEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, uint32_t FromSS);
|
||||
|
||||
int serTestPingDecSrv(const unsigned char* _buffer, size_t _size, uint32_t* FromSS);
|
||||
|
||||
int serTestPingEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, uint32_t ToSS);
|
||||
|
||||
int serTestPingDecClt(const unsigned char* _buffer, size_t _size, uint32_t* ToSS);
|
||||
|
||||
int serTestEchoEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct EchoData* FromSS);
|
||||
|
||||
int serTestEchoDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct EchoData** FromSS);
|
||||
|
||||
void serTestEchoFreeSrv(struct EchoData* FromSS);
|
||||
|
||||
int serTestEchoEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct EchoData* ToSS);
|
||||
|
||||
int serTestEchoDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct EchoData** ToSS);
|
||||
|
||||
void serTestEchoFreeClt(struct EchoData* ToSS);
|
||||
|
||||
int serTestTest1EncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct Output* out);
|
||||
|
||||
int serTestTest1DecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct Output** out);
|
||||
|
||||
void serTestTest1FreeSrv(struct Output* out);
|
||||
|
||||
int serTestTest2EncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct Output* out);
|
||||
|
||||
int serTestTest2DecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct Output** out);
|
||||
|
||||
void serTestTest2FreeClt(struct Output* out);
|
||||
|
||||
int serTestOtherEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct Empty* in1, uint32_t in2, size_t in3Qty, const char* in3Array, const char* in4, bool in5, int in6, float in7, SomeEnum in8, size_t in9Qty, const struct Empty* in9Array, const struct Empty2* in10, const struct New* in11);
|
||||
|
||||
int serTestOtherDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct Empty** in1, uint32_t* in2, size_t* in3Qty, char** in3Array, char** in4, bool* in5, int* in6, float* in7, SomeEnum* in8, size_t* in9Qty, struct Empty** in9Array, struct Empty2** in10, struct New** in11);
|
||||
|
||||
void serTestOtherFreeSrv(struct Empty* in1, char* in3Array, char* in4, struct Empty* in9Array, size_t in9Qty, struct Empty2* in10, struct New* in11);
|
||||
|
||||
int serTestOtherEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct Empty* out1, uint32_t out2, size_t out3Qty, const char* out3Array, const char* out4, bool out5, int out6, float out7, SomeEnum out8, size_t out9Qty, const struct Empty* out9Array, const struct Empty2* out10, const struct New* out11);
|
||||
|
||||
int serTestOtherDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct Empty** out1, uint32_t* out2, size_t* out3Qty, char** out3Array, char** out4, bool* out5, int* out6, float* out7, SomeEnum* out8, size_t* out9Qty, struct Empty** out9Array, struct Empty2** out10, struct New** out11);
|
||||
|
||||
void serTestOtherFreeClt(struct Empty* out1, char* out3Array, char* out4, struct Empty* out9Array, size_t out9Qty, struct Empty2* out10, struct New* out11);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
36
openair3/SS/Sidl/lib/ser/api/serVng.h
Normal file
36
openair3/SS/Sidl/lib/ser/api/serVng.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_EUTRA_VNG_PORT.h"
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
int serVngProcessEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct EUTRA_VNG_CTRL_REQ* FromSS);
|
||||
|
||||
int serVngProcessDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct EUTRA_VNG_CTRL_REQ** FromSS);
|
||||
|
||||
void serVngProcessFreeSrv(struct EUTRA_VNG_CTRL_REQ* FromSS);
|
||||
|
||||
int serVngProcessEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct EUTRA_VNG_CTRL_CNF* ToSS);
|
||||
|
||||
int serVngProcessDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct EUTRA_VNG_CTRL_CNF** ToSS);
|
||||
|
||||
void serVngProcessFreeClt(struct EUTRA_VNG_CTRL_CNF* ToSS);
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
5621
openair3/SS/Sidl/lib/ser/src/serDrb.c
Normal file
5621
openair3/SS/Sidl/lib/ser/src/serDrb.c
Normal file
File diff suppressed because it is too large
Load Diff
140
openair3/SS/Sidl/lib/ser/src/serHandshake.c
Normal file
140
openair3/SS/Sidl/lib/ser/src/serHandshake.c
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* 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 <string.h>
|
||||
#include "serHandshake.h"
|
||||
#include "serMem.h"
|
||||
#include "serUtils.h"
|
||||
|
||||
static int _serHandshakeEncAcpHandshake_Type(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct AcpHandshake_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
for (size_t i1 = 0; i1 < 32; i1++) {
|
||||
HTON_8(&_buffer[*_lidx], p->acpVersion[i1], _lidx);
|
||||
}
|
||||
for (size_t i1 = 0; i1 < 64; i1++) {
|
||||
HTON_8(&_buffer[*_lidx], p->acpVerCksm[i1], _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
int serHandshakeHandleFromSSEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct AcpHandshake_Type* fromSS)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
_serHandshakeEncAcpHandshake_Type(_buffer, _size, _lidx, fromSS);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serHandshakeDecAcpHandshake_Type(const unsigned char* _buffer, size_t _size, size_t* _lidx, struct AcpHandshake_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
for (size_t i1 = 0; i1 < 32; i1++) {
|
||||
NTOH_8(p->acpVersion[i1], &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
for (size_t i1 = 0; i1 < 64; i1++) {
|
||||
NTOH_8(p->acpVerCksm[i1], &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
int serHandshakeHandleFromSSDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct AcpHandshake_Type** fromSS)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
serMem_t _mem = serMemInit(_arena, _aSize);
|
||||
|
||||
size_t __lidx = 0;
|
||||
size_t* _lidx = &__lidx;
|
||||
|
||||
*fromSS = serMalloc(_mem, sizeof(struct AcpHandshake_Type));
|
||||
_serHandshakeDecAcpHandshake_Type(_buffer, _size, _lidx, *fromSS);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
void serHandshakeHandleFromSSFreeSrv(struct AcpHandshake_Type* fromSS)
|
||||
{
|
||||
if (fromSS) {
|
||||
serFree(fromSS);
|
||||
}
|
||||
}
|
||||
|
||||
static int _serHandshakeEncAcpHandshakeRsp_Type(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct AcpHandshakeRsp_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
HTON_8(&_buffer[*_lidx], p->acpVersionChk, _lidx);
|
||||
for (size_t i1 = 0; i1 < 32; i1++) {
|
||||
HTON_8(&_buffer[*_lidx], p->acpVersion[i1], _lidx);
|
||||
}
|
||||
for (size_t i1 = 0; i1 < 64; i1++) {
|
||||
HTON_8(&_buffer[*_lidx], p->acpVerCksm[i1], _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
int serHandshakeHandleToSSEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct AcpHandshakeRsp_Type* toSS)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
_serHandshakeEncAcpHandshakeRsp_Type(_buffer, _size, _lidx, toSS);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serHandshakeDecAcpHandshakeRsp_Type(const unsigned char* _buffer, size_t _size, size_t* _lidx, struct AcpHandshakeRsp_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
NTOH_8(p->acpVersionChk, &_buffer[*_lidx], _lidx);
|
||||
for (size_t i1 = 0; i1 < 32; i1++) {
|
||||
NTOH_8(p->acpVersion[i1], &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
for (size_t i1 = 0; i1 < 64; i1++) {
|
||||
NTOH_8(p->acpVerCksm[i1], &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
int serHandshakeHandleToSSDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct AcpHandshakeRsp_Type** toSS)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
serMem_t _mem = serMemInit(_arena, _aSize);
|
||||
|
||||
size_t __lidx = 0;
|
||||
size_t* _lidx = &__lidx;
|
||||
|
||||
*toSS = serMalloc(_mem, sizeof(struct AcpHandshakeRsp_Type));
|
||||
_serHandshakeDecAcpHandshakeRsp_Type(_buffer, _size, _lidx, *toSS);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
void serHandshakeHandleToSSFreeClt(struct AcpHandshakeRsp_Type* toSS)
|
||||
{
|
||||
if (toSS) {
|
||||
serFree(toSS);
|
||||
}
|
||||
}
|
||||
124
openair3/SS/Sidl/lib/ser/src/serMem.c
Normal file
124
openair3/SS/Sidl/lib/ser/src/serMem.c
Normal file
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* 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 <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// Internal includes
|
||||
#include "serMem.h"
|
||||
|
||||
// Enable capability for dynamic memory allocation
|
||||
#define SER_MEM_SUPPORT_DYNAMIC
|
||||
|
||||
// Define ser memory header size
|
||||
#define SER_MEM_HEADER_SIZE 4
|
||||
|
||||
// If SER_MEM_SUPPORT_DYNAMIC is defined serMem will allow dynamic memory allocation,
|
||||
// otherwise ONLY arena allocation is supported (no malloc/free will be ever called)
|
||||
#ifdef SER_MEM_SUPPORT_DYNAMIC
|
||||
static struct serMemCtx serMemDynCtx = { SER_MEM_DYNAMIC_MAGIC, 0, 0 };
|
||||
|
||||
/** Defines preinitialized memory context for dynamic memory allocation. */
|
||||
serMem_t serMemDyn = &serMemDynCtx;
|
||||
#endif
|
||||
|
||||
serMem_t serMemInit(unsigned char* arena, unsigned int aSize)
|
||||
{
|
||||
if (!arena && (aSize == 0)) {
|
||||
#ifdef SER_MEM_SUPPORT_DYNAMIC
|
||||
return serMemDyn;
|
||||
#else
|
||||
SIDL_ASSERT(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!arena || (aSize < sizeof(struct serMemCtx))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
serMem_t mem = (serMem_t)arena;
|
||||
mem->magic = SER_MEM_MAGIC;
|
||||
mem->size = aSize;
|
||||
mem->index = sizeof(struct serMemCtx);
|
||||
|
||||
return mem;
|
||||
}
|
||||
|
||||
void* serMalloc(serMem_t mem, size_t size)
|
||||
{
|
||||
SIDL_ASSERT(mem);
|
||||
void* ptr = NULL;
|
||||
|
||||
#ifdef SER_MEM_SUPPORT_DYNAMIC
|
||||
if (mem->magic == SER_MEM_DYNAMIC_MAGIC) {
|
||||
// add ser memory header,
|
||||
// since serFree dereferences the pointer to check for magic
|
||||
unsigned char* buf = (unsigned char*)malloc(size + SER_MEM_HEADER_SIZE);
|
||||
if (buf) {
|
||||
memset(buf, 0, SER_MEM_HEADER_SIZE);
|
||||
ptr = &buf[SER_MEM_HEADER_SIZE];
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
#endif
|
||||
if (mem->magic == SER_MEM_MAGIC) {
|
||||
// check buffer alignment
|
||||
mem->index = (mem->index + 3) & (~((int)0x03));
|
||||
|
||||
// +4 to store header to retrieve mem context with serFree
|
||||
if ((mem->index + size + SER_MEM_HEADER_SIZE) <= mem->size) {
|
||||
unsigned char* arena = (unsigned char*)mem;
|
||||
unsigned int offset = mem->index + SER_MEM_HEADER_SIZE;
|
||||
ptr = &arena[offset];
|
||||
arena[mem->index] = 0x0A;
|
||||
arena[mem->index + 1] = 0xC9;
|
||||
arena[mem->index + 2] = (offset >> 8) & 0xFF;
|
||||
arena[mem->index + 3] = offset & 0xFF;
|
||||
mem->index += (size + SER_MEM_HEADER_SIZE);
|
||||
}
|
||||
|
||||
return ptr;
|
||||
} else {
|
||||
SIDL_ASSERT(0);
|
||||
}
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void serFree(void* ptr)
|
||||
{
|
||||
SIDL_ASSERT(ptr);
|
||||
|
||||
// get pointer to the allocated data header
|
||||
unsigned char* origin = (unsigned char*)ptr - SER_MEM_HEADER_SIZE;
|
||||
if ((origin[0] == 0x0A) && (origin[1] == 0xC9)) {
|
||||
unsigned int offset = (unsigned int)((origin[2] << 8) | origin[3]);
|
||||
// get origin pointer to the arena
|
||||
origin = (unsigned char*)ptr - offset;
|
||||
|
||||
serMem_t mem = (serMem_t)origin;
|
||||
if (mem && (mem->magic == SER_MEM_MAGIC)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
#ifdef SER_MEM_SUPPORT_DYNAMIC
|
||||
// there is ser mem header, see serMalloc comment
|
||||
free((unsigned char*)ptr - SER_MEM_HEADER_SIZE);
|
||||
#else
|
||||
SIDL_ASSERT(0);
|
||||
#endif
|
||||
}
|
||||
67441
openair3/SS/Sidl/lib/ser/src/serSys.c
Normal file
67441
openair3/SS/Sidl/lib/ser/src/serSys.c
Normal file
File diff suppressed because it is too large
Load Diff
1817
openair3/SS/Sidl/lib/ser/src/serSysInd.c
Normal file
1817
openair3/SS/Sidl/lib/ser/src/serSysInd.c
Normal file
File diff suppressed because it is too large
Load Diff
1420
openair3/SS/Sidl/lib/ser/src/serSysSrb.c
Normal file
1420
openair3/SS/Sidl/lib/ser/src/serSysSrb.c
Normal file
File diff suppressed because it is too large
Load Diff
397
openair3/SS/Sidl/lib/ser/src/serSysVT.c
Normal file
397
openair3/SS/Sidl/lib/ser/src/serSysVT.c
Normal file
@@ -0,0 +1,397 @@
|
||||
/*
|
||||
* 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 <string.h>
|
||||
#include "serSysVT.h"
|
||||
#include "serMem.h"
|
||||
#include "serUtils.h"
|
||||
|
||||
static int _serSysVTEncSystemFrameNumberInfo_Type_Value(unsigned char* _buffer, size_t _size, size_t* _lidx, const union SystemFrameNumberInfo_Type_Value* p, enum SystemFrameNumberInfo_Type_Sel d)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
if (d == SystemFrameNumberInfo_Type_Number) {
|
||||
HTON_16(&_buffer[*_lidx], p->Number, _lidx);
|
||||
}
|
||||
if (d == SystemFrameNumberInfo_Type_Any) {
|
||||
HTON_8(&_buffer[*_lidx], p->Any, _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTEncSystemFrameNumberInfo_Type(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct SystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
{
|
||||
size_t _tmp = (size_t)p->d;
|
||||
HTON_32(&_buffer[*_lidx], _tmp, _lidx);
|
||||
}
|
||||
_serSysVTEncSystemFrameNumberInfo_Type_Value(_buffer, _size, _lidx, &p->v, p->d);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTEncSubFrameInfo_Type_Value(unsigned char* _buffer, size_t _size, size_t* _lidx, const union SubFrameInfo_Type_Value* p, enum SubFrameInfo_Type_Sel d)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
if (d == SubFrameInfo_Type_Number) {
|
||||
HTON_8(&_buffer[*_lidx], p->Number, _lidx);
|
||||
}
|
||||
if (d == SubFrameInfo_Type_Any) {
|
||||
HTON_8(&_buffer[*_lidx], p->Any, _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTEncSubFrameInfo_Type(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct SubFrameInfo_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
{
|
||||
size_t _tmp = (size_t)p->d;
|
||||
HTON_32(&_buffer[*_lidx], _tmp, _lidx);
|
||||
}
|
||||
_serSysVTEncSubFrameInfo_Type_Value(_buffer, _size, _lidx, &p->v, p->d);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTEncHyperSystemFrameNumberInfo_Type(unsigned char* _buffer, size_t _size, size_t* _lidx, const HyperSystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
{
|
||||
size_t _tmp = (size_t)p->d;
|
||||
HTON_32(&_buffer[*_lidx], _tmp, _lidx);
|
||||
}
|
||||
_serSysVTEncSystemFrameNumberInfo_Type_Value(_buffer, _size, _lidx, &p->v, p->d);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTEncSlotOffset_Type_Value(unsigned char* _buffer, size_t _size, size_t* _lidx, const union SlotOffset_Type_Value* p, enum SlotOffset_Type_Sel d)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
if (d == SlotOffset_Type_Numerology0) {
|
||||
HTON_8(&_buffer[*_lidx], p->Numerology0, _lidx);
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology1) {
|
||||
HTON_8(&_buffer[*_lidx], p->Numerology1, _lidx);
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology2) {
|
||||
HTON_8(&_buffer[*_lidx], p->Numerology2, _lidx);
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology3) {
|
||||
HTON_8(&_buffer[*_lidx], p->Numerology3, _lidx);
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology4) {
|
||||
HTON_8(&_buffer[*_lidx], p->Numerology4, _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTEncSlotOffset_Type(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct SlotOffset_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
{
|
||||
size_t _tmp = (size_t)p->d;
|
||||
HTON_32(&_buffer[*_lidx], _tmp, _lidx);
|
||||
}
|
||||
_serSysVTEncSlotOffset_Type_Value(_buffer, _size, _lidx, &p->v, p->d);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTEncSlotTimingInfo_Type_Value(unsigned char* _buffer, size_t _size, size_t* _lidx, const union SlotTimingInfo_Type_Value* p, enum SlotTimingInfo_Type_Sel d)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
if (d == SlotTimingInfo_Type_SlotOffset) {
|
||||
_serSysVTEncSlotOffset_Type(_buffer, _size, _lidx, &p->SlotOffset);
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_FirstSlot) {
|
||||
HTON_8(&_buffer[*_lidx], p->FirstSlot, _lidx);
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_Any) {
|
||||
HTON_8(&_buffer[*_lidx], p->Any, _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTEncSlotTimingInfo_Type(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct SlotTimingInfo_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
{
|
||||
size_t _tmp = (size_t)p->d;
|
||||
HTON_32(&_buffer[*_lidx], _tmp, _lidx);
|
||||
}
|
||||
_serSysVTEncSlotTimingInfo_Type_Value(_buffer, _size, _lidx, &p->v, p->d);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTEncSubFrameTiming_Type(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct SubFrameTiming_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
_serSysVTEncSystemFrameNumberInfo_Type(_buffer, _size, _lidx, &p->SFN);
|
||||
_serSysVTEncSubFrameInfo_Type(_buffer, _size, _lidx, &p->Subframe);
|
||||
_serSysVTEncHyperSystemFrameNumberInfo_Type(_buffer, _size, _lidx, &p->HSFN);
|
||||
_serSysVTEncSlotTimingInfo_Type(_buffer, _size, _lidx, &p->Slot);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTEncVirtualTimeInfo_Type(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct VirtualTimeInfo_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
HTON_8(&_buffer[*_lidx], p->Enable, _lidx);
|
||||
_serSysVTEncSubFrameTiming_Type(_buffer, _size, _lidx, &p->TimingInfo);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
int serSysVTEnquireTimingUpdEncSrv(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct VirtualTimeInfo_Type* TimingInfoToSS)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
_serSysVTEncVirtualTimeInfo_Type(_buffer, _size, _lidx, TimingInfoToSS);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecSystemFrameNumberInfo_Type_Value(const unsigned char* _buffer, size_t _size, size_t* _lidx, union SystemFrameNumberInfo_Type_Value* p, enum SystemFrameNumberInfo_Type_Sel d)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
if (d == SystemFrameNumberInfo_Type_Number) {
|
||||
NTOH_16(p->Number, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
if (d == SystemFrameNumberInfo_Type_Any) {
|
||||
NTOH_8(p->Any, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecSystemFrameNumberInfo_Type(const unsigned char* _buffer, size_t _size, size_t* _lidx, struct SystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
{
|
||||
size_t _tmp;
|
||||
NTOH_32(_tmp, &_buffer[*_lidx], _lidx);
|
||||
p->d = (enum SystemFrameNumberInfo_Type_Sel)_tmp;
|
||||
}
|
||||
_serSysVTDecSystemFrameNumberInfo_Type_Value(_buffer, _size, _lidx, &p->v, p->d);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecSubFrameInfo_Type_Value(const unsigned char* _buffer, size_t _size, size_t* _lidx, union SubFrameInfo_Type_Value* p, enum SubFrameInfo_Type_Sel d)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
if (d == SubFrameInfo_Type_Number) {
|
||||
NTOH_8(p->Number, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
if (d == SubFrameInfo_Type_Any) {
|
||||
NTOH_8(p->Any, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecSubFrameInfo_Type(const unsigned char* _buffer, size_t _size, size_t* _lidx, struct SubFrameInfo_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
{
|
||||
size_t _tmp;
|
||||
NTOH_32(_tmp, &_buffer[*_lidx], _lidx);
|
||||
p->d = (enum SubFrameInfo_Type_Sel)_tmp;
|
||||
}
|
||||
_serSysVTDecSubFrameInfo_Type_Value(_buffer, _size, _lidx, &p->v, p->d);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecHyperSystemFrameNumberInfo_Type(const unsigned char* _buffer, size_t _size, size_t* _lidx, HyperSystemFrameNumberInfo_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
{
|
||||
size_t _tmp;
|
||||
NTOH_32(_tmp, &_buffer[*_lidx], _lidx);
|
||||
p->d = (enum SystemFrameNumberInfo_Type_Sel)_tmp;
|
||||
}
|
||||
_serSysVTDecSystemFrameNumberInfo_Type_Value(_buffer, _size, _lidx, &p->v, p->d);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecSlotOffset_Type_Value(const unsigned char* _buffer, size_t _size, size_t* _lidx, union SlotOffset_Type_Value* p, enum SlotOffset_Type_Sel d)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
if (d == SlotOffset_Type_Numerology0) {
|
||||
NTOH_8(p->Numerology0, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology1) {
|
||||
NTOH_8(p->Numerology1, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology2) {
|
||||
NTOH_8(p->Numerology2, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology3) {
|
||||
NTOH_8(p->Numerology3, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
if (d == SlotOffset_Type_Numerology4) {
|
||||
NTOH_8(p->Numerology4, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecSlotOffset_Type(const unsigned char* _buffer, size_t _size, size_t* _lidx, struct SlotOffset_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
{
|
||||
size_t _tmp;
|
||||
NTOH_32(_tmp, &_buffer[*_lidx], _lidx);
|
||||
p->d = (enum SlotOffset_Type_Sel)_tmp;
|
||||
}
|
||||
_serSysVTDecSlotOffset_Type_Value(_buffer, _size, _lidx, &p->v, p->d);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecSlotTimingInfo_Type_Value(const unsigned char* _buffer, size_t _size, size_t* _lidx, union SlotTimingInfo_Type_Value* p, enum SlotTimingInfo_Type_Sel d)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
if (d == SlotTimingInfo_Type_SlotOffset) {
|
||||
_serSysVTDecSlotOffset_Type(_buffer, _size, _lidx, &p->SlotOffset);
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_FirstSlot) {
|
||||
NTOH_8(p->FirstSlot, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
if (d == SlotTimingInfo_Type_Any) {
|
||||
NTOH_8(p->Any, &_buffer[*_lidx], _lidx);
|
||||
}
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecSlotTimingInfo_Type(const unsigned char* _buffer, size_t _size, size_t* _lidx, struct SlotTimingInfo_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
{
|
||||
size_t _tmp;
|
||||
NTOH_32(_tmp, &_buffer[*_lidx], _lidx);
|
||||
p->d = (enum SlotTimingInfo_Type_Sel)_tmp;
|
||||
}
|
||||
_serSysVTDecSlotTimingInfo_Type_Value(_buffer, _size, _lidx, &p->v, p->d);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecSubFrameTiming_Type(const unsigned char* _buffer, size_t _size, size_t* _lidx, struct SubFrameTiming_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
_serSysVTDecSystemFrameNumberInfo_Type(_buffer, _size, _lidx, &p->SFN);
|
||||
_serSysVTDecSubFrameInfo_Type(_buffer, _size, _lidx, &p->Subframe);
|
||||
_serSysVTDecHyperSystemFrameNumberInfo_Type(_buffer, _size, _lidx, &p->HSFN);
|
||||
_serSysVTDecSlotTimingInfo_Type(_buffer, _size, _lidx, &p->Slot);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
static int _serSysVTDecVirtualTimeInfo_Type(const unsigned char* _buffer, size_t _size, size_t* _lidx, struct VirtualTimeInfo_Type* p)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
NTOH_8(p->Enable, &_buffer[*_lidx], _lidx);
|
||||
_serSysVTDecSubFrameTiming_Type(_buffer, _size, _lidx, &p->TimingInfo);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
int serSysVTEnquireTimingUpdDecClt(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct VirtualTimeInfo_Type** TimingInfoToSS)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
serMem_t _mem = serMemInit(_arena, _aSize);
|
||||
|
||||
size_t __lidx = 0;
|
||||
size_t* _lidx = &__lidx;
|
||||
|
||||
*TimingInfoToSS = serMalloc(_mem, sizeof(struct VirtualTimeInfo_Type));
|
||||
_serSysVTDecVirtualTimeInfo_Type(_buffer, _size, _lidx, *TimingInfoToSS);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
void serSysVTEnquireTimingUpdFreeClt(struct VirtualTimeInfo_Type* TimingInfoToSS)
|
||||
{
|
||||
if (TimingInfoToSS) {
|
||||
serFree(TimingInfoToSS);
|
||||
}
|
||||
}
|
||||
|
||||
int serSysVTEnquireTimingAckEncClt(unsigned char* _buffer, size_t _size, size_t* _lidx, const struct VirtualTimeInfo_Type* TimingInfoFromSS)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
_serSysVTEncVirtualTimeInfo_Type(_buffer, _size, _lidx, TimingInfoFromSS);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
int serSysVTEnquireTimingAckDecSrv(const unsigned char* _buffer, size_t _size, unsigned char* _arena, size_t _aSize, struct VirtualTimeInfo_Type** TimingInfoFromSS)
|
||||
{
|
||||
(void)_size; // TODO: generate boundaries checking
|
||||
|
||||
serMem_t _mem = serMemInit(_arena, _aSize);
|
||||
|
||||
size_t __lidx = 0;
|
||||
size_t* _lidx = &__lidx;
|
||||
|
||||
*TimingInfoFromSS = serMalloc(_mem, sizeof(struct VirtualTimeInfo_Type));
|
||||
_serSysVTDecVirtualTimeInfo_Type(_buffer, _size, _lidx, *TimingInfoFromSS);
|
||||
|
||||
return SIDL_STATUS_OK;
|
||||
}
|
||||
|
||||
void serSysVTEnquireTimingAckFreeSrv(struct VirtualTimeInfo_Type* TimingInfoFromSS)
|
||||
{
|
||||
if (TimingInfoFromSS) {
|
||||
serFree(TimingInfoFromSS);
|
||||
}
|
||||
}
|
||||
1480
openair3/SS/Sidl/lib/ser/src/serTest.c
Normal file
1480
openair3/SS/Sidl/lib/ser/src/serTest.c
Normal file
File diff suppressed because it is too large
Load Diff
17
openair3/SS/Sidl/lib/ser/src/serUtils.c
Normal file
17
openair3/SS/Sidl/lib/ser/src/serUtils.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* 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 "serUtils.h"
|
||||
100
openair3/SS/Sidl/lib/ser/src/serUtils.h
Normal file
100
openair3/SS/Sidl/lib/ser/src/serUtils.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
// System includes
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// Internal includes
|
||||
#include "SidlCompiler.h"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
// Macro definitions
|
||||
|
||||
#define HTON_8(dst, src, idx) \
|
||||
{ \
|
||||
*dst = src; \
|
||||
*idx += 1; \
|
||||
}
|
||||
|
||||
#define NTOH_8(dst, src, idx) \
|
||||
{ \
|
||||
dst = ((unsigned char*)src)[0]; \
|
||||
*idx += 1; \
|
||||
}
|
||||
|
||||
#define HTON_16(dst, src, idx) \
|
||||
{ \
|
||||
*(dst) = (src >> 8) & 0xFF; \
|
||||
*(dst + 1) = (src)&0xFF; \
|
||||
*idx += 2; \
|
||||
}
|
||||
|
||||
#define NTOH_16(dst, src, idx) \
|
||||
{ \
|
||||
dst = ((((unsigned char*)src)[0] << 8) | \
|
||||
((unsigned char*)src)[1]); \
|
||||
*idx += 2; \
|
||||
}
|
||||
|
||||
#define HTON_32(dst, src, idx) \
|
||||
{ \
|
||||
*(dst) = (src >> 24) & 0xFF; \
|
||||
*(dst + 1) = (src >> 16) & 0xFF; \
|
||||
*(dst + 2) = (src >> 8) & 0xFF; \
|
||||
*(dst + 3) = (src)&0xFF; \
|
||||
*idx += 4; \
|
||||
}
|
||||
|
||||
#define NTOH_32(dst, src, idx) \
|
||||
{ \
|
||||
(dst) = ((((unsigned char*)src)[0] << 24) | \
|
||||
(((unsigned char*)src)[1] << 16) | \
|
||||
(((unsigned char*)src)[2] << 8) | \
|
||||
((unsigned char*)src)[3]); \
|
||||
*(idx) += 4; \
|
||||
}
|
||||
|
||||
#define HTON_64(dst, src, idx) \
|
||||
{ \
|
||||
*(dst) = ((uint64_t)(src) >> 56) & 0xFF; \
|
||||
*(dst + 1) = ((uint64_t)(src) >> 48) & 0xFF; \
|
||||
*(dst + 2) = ((uint64_t)(src) >> 40) & 0xFF; \
|
||||
*(dst + 3) = ((uint64_t)(src) >> 32) & 0xFF; \
|
||||
*(dst + 4) = ((uint64_t)(src) >> 24) & 0xFF; \
|
||||
*(dst + 5) = ((uint64_t)(src) >> 16) & 0xFF; \
|
||||
*(dst + 6) = ((uint64_t)(src) >> 8) & 0xFF; \
|
||||
*(dst + 7) = ((uint64_t)(src) >> 0) & 0xFF; \
|
||||
*idx += 8; \
|
||||
}
|
||||
|
||||
#define NTOH_64(dst, src, idx) \
|
||||
{ \
|
||||
(dst) = (((uint64_t)(((unsigned char*)src)[0]) << 56) | \
|
||||
((uint64_t)(((unsigned char*)src)[1]) << 48) | \
|
||||
((uint64_t)(((unsigned char*)src)[2]) << 40) | \
|
||||
((uint64_t)(((unsigned char*)src)[3]) << 32) | \
|
||||
((uint64_t)(((unsigned char*)src)[4]) << 24) | \
|
||||
((uint64_t)(((unsigned char*)src)[5]) << 16) | \
|
||||
((uint64_t)(((unsigned char*)src)[6]) << 8) | \
|
||||
((uint64_t)(((unsigned char*)src)[7]) << 0)); \
|
||||
*(idx) += 8; \
|
||||
}
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
1266
openair3/SS/Sidl/lib/ser/src/serVng.c
Normal file
1266
openair3/SS/Sidl/lib/ser/src/serVng.c
Normal file
File diff suppressed because it is too large
Load Diff
885
openair3/SS/Sidl/sidl/api/SIDL_EUTRA_DRB_PORT.h
Normal file
885
openair3/SS/Sidl/sidl/api/SIDL_EUTRA_DRB_PORT.h
Normal file
@@ -0,0 +1,885 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
typedef C_RNTI MAC_CTRL_C_RNTI_Type;
|
||||
|
||||
typedef OCTET_STRING MAC_SDU_Type;
|
||||
|
||||
struct MAC_SDU_Type_MAC_SDUList_Type_Dynamic {
|
||||
size_t d;
|
||||
MAC_SDU_Type* v;
|
||||
};
|
||||
|
||||
typedef struct MAC_SDU_Type_MAC_SDUList_Type_Dynamic MAC_SDUList_Type;
|
||||
|
||||
typedef ContentionResolutionId_Type MAC_CTRL_ContentionResolutionId_Type;
|
||||
|
||||
typedef B8_Type MAC_CTRL_TimingAdvance_Type;
|
||||
|
||||
typedef OCTET_STRING RLC_TMD_PDU_Type;
|
||||
|
||||
typedef B2_Type RLC_FramingInfo_Type;
|
||||
|
||||
typedef OCTET_STRING RLC_DataField_Type;
|
||||
|
||||
struct RLC_DataField_Type_RLC_DataFieldList_Type_Dynamic {
|
||||
size_t d;
|
||||
RLC_DataField_Type* v;
|
||||
};
|
||||
|
||||
typedef struct RLC_DataField_Type_RLC_DataFieldList_Type_Dynamic RLC_DataFieldList_Type;
|
||||
|
||||
struct BIT_STRING_ELEMENT_RLC_Status_Padding_Type_Dynamic {
|
||||
size_t d;
|
||||
BIT_STRING_ELEMENT* v;
|
||||
};
|
||||
|
||||
typedef struct BIT_STRING_ELEMENT_RLC_Status_Padding_Type_Dynamic RLC_Status_Padding_Type;
|
||||
|
||||
typedef OCTET_STRING PDCP_SDU_Type;
|
||||
|
||||
struct PDCP_SDU_Type_PDCP_SDUList_Type_Dynamic {
|
||||
size_t d;
|
||||
PDCP_SDU_Type* v;
|
||||
};
|
||||
|
||||
typedef struct PDCP_SDU_Type_PDCP_SDUList_Type_Dynamic PDCP_SDUList_Type;
|
||||
|
||||
typedef OCTET_STRING RLC_SDU_Type;
|
||||
|
||||
struct RLC_SDU_Type_RLC_SDUList_Type_Dynamic {
|
||||
size_t d;
|
||||
RLC_SDU_Type* v;
|
||||
};
|
||||
|
||||
typedef struct RLC_SDU_Type_RLC_SDUList_Type_Dynamic RLC_SDUList_Type;
|
||||
|
||||
struct MAC_PDU_Length_Type {
|
||||
B1_Type Format;
|
||||
B7_15_Type Value;
|
||||
};
|
||||
|
||||
struct MAC_PDU_Length_Type_Length_Optional {
|
||||
bool d;
|
||||
struct MAC_PDU_Length_Type v;
|
||||
};
|
||||
|
||||
struct MAC_PDU_SubHeader_Type {
|
||||
B2_Type Reserved;
|
||||
B1_Type Extension;
|
||||
B5_Type LCID;
|
||||
struct MAC_PDU_Length_Type_Length_Optional Length;
|
||||
};
|
||||
|
||||
struct MAC_PDU_SubHeader_Type_MAC_Header_Type_Dynamic {
|
||||
size_t d;
|
||||
struct MAC_PDU_SubHeader_Type* v;
|
||||
};
|
||||
|
||||
typedef struct MAC_PDU_SubHeader_Type_MAC_Header_Type_Dynamic MAC_Header_Type;
|
||||
|
||||
struct MAC_CTRL_ShortBSR_Type {
|
||||
B2_Type LCG;
|
||||
B6_Type Value;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_LongBSR_Type {
|
||||
B6_Type Value_LCG1;
|
||||
B6_Type Value_LCG2;
|
||||
B6_Type Value_LCG3;
|
||||
B6_Type Value_LCG4;
|
||||
};
|
||||
|
||||
enum HarqProcessAssignment_Type_Sel {
|
||||
HarqProcessAssignment_Type_UNBOUND_VALUE = 0,
|
||||
HarqProcessAssignment_Type_Id = 1,
|
||||
HarqProcessAssignment_Type_Automatic = 2,
|
||||
};
|
||||
|
||||
union HarqProcessAssignment_Type_Value {
|
||||
HarqProcessId_Type Id;
|
||||
Null_Type Automatic;
|
||||
};
|
||||
|
||||
struct HarqProcessAssignment_Type {
|
||||
enum HarqProcessAssignment_Type_Sel d;
|
||||
union HarqProcessAssignment_Type_Value v;
|
||||
};
|
||||
|
||||
typedef struct ScellBitMap_Type MAC_CTRL_ScellActDeact_Type;
|
||||
|
||||
struct MAC_CTRL_ShortBSR_Type_ShortBSR_Optional {
|
||||
bool d;
|
||||
struct MAC_CTRL_ShortBSR_Type v;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_LongBSR_Type_LongBSR_Optional {
|
||||
bool d;
|
||||
struct MAC_CTRL_LongBSR_Type v;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_C_RNTI_Type_C_RNTI_Optional {
|
||||
bool d;
|
||||
MAC_CTRL_C_RNTI_Type v;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_ContentionResolutionId_Type_ContentionResolutionID_Optional {
|
||||
bool d;
|
||||
MAC_CTRL_ContentionResolutionId_Type v;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_TimingAdvance_Type_TimingAdvance_Optional {
|
||||
bool d;
|
||||
MAC_CTRL_TimingAdvance_Type v;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_PowerHeadRoom_Type_PowerHeadRoom_Optional {
|
||||
bool d;
|
||||
struct MAC_CTRL_PowerHeadRoom_Type v;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_ScellActDeact_Type_ScellActDeact_Optional {
|
||||
bool d;
|
||||
MAC_CTRL_ScellActDeact_Type v;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_ExtPowerHeadRoom_Type_ExtPowerHeadRoom_Optional {
|
||||
bool d;
|
||||
struct MAC_CTRL_ExtPowerHeadRoom_Type v;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_DC_PowerHeadRoom_Type_DC_PowerHeadRoom_Optional {
|
||||
bool d;
|
||||
struct MAC_CTRL_DC_PowerHeadRoom_Type v;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_ElementList_Type {
|
||||
struct MAC_CTRL_ShortBSR_Type_ShortBSR_Optional ShortBSR;
|
||||
struct MAC_CTRL_LongBSR_Type_LongBSR_Optional LongBSR;
|
||||
struct MAC_CTRL_C_RNTI_Type_C_RNTI_Optional C_RNTI;
|
||||
struct MAC_CTRL_ContentionResolutionId_Type_ContentionResolutionID_Optional ContentionResolutionID;
|
||||
struct MAC_CTRL_TimingAdvance_Type_TimingAdvance_Optional TimingAdvance;
|
||||
struct MAC_CTRL_PowerHeadRoom_Type_PowerHeadRoom_Optional PowerHeadRoom;
|
||||
struct MAC_CTRL_ScellActDeact_Type_ScellActDeact_Optional ScellActDeact;
|
||||
struct MAC_CTRL_ExtPowerHeadRoom_Type_ExtPowerHeadRoom_Optional ExtPowerHeadRoom;
|
||||
struct MAC_CTRL_DC_PowerHeadRoom_Type_DC_PowerHeadRoom_Optional DC_PowerHeadRoom;
|
||||
};
|
||||
|
||||
struct MAC_CTRL_ElementList_Type_CtrlElementList_Optional {
|
||||
bool d;
|
||||
struct MAC_CTRL_ElementList_Type v;
|
||||
};
|
||||
|
||||
struct MAC_SDUList_Type_SduList_Optional {
|
||||
bool d;
|
||||
MAC_SDUList_Type v;
|
||||
};
|
||||
|
||||
struct OCTET_STRING_Padding_Optional {
|
||||
bool d;
|
||||
OCTET_STRING v;
|
||||
};
|
||||
|
||||
struct MAC_PDU_Type {
|
||||
MAC_Header_Type Header;
|
||||
struct MAC_CTRL_ElementList_Type_CtrlElementList_Optional CtrlElementList;
|
||||
struct MAC_SDUList_Type_SduList_Optional SduList;
|
||||
struct OCTET_STRING_Padding_Optional Padding;
|
||||
};
|
||||
|
||||
struct MAC_PDU_Type_MAC_PDUList_Type_Dynamic {
|
||||
size_t d;
|
||||
struct MAC_PDU_Type* v;
|
||||
};
|
||||
|
||||
typedef struct MAC_PDU_Type_MAC_PDUList_Type_Dynamic MAC_PDUList_Type;
|
||||
|
||||
struct RLC_UMD_Header_FixPartShortSN_Type {
|
||||
RLC_FramingInfo_Type FramingInfo;
|
||||
B1_Type Extension;
|
||||
B5_Type SequenceNumber;
|
||||
};
|
||||
|
||||
struct RLC_LengthIndicator_LI11_Type {
|
||||
B1_Type Extension;
|
||||
B11_Type LengthIndicator;
|
||||
};
|
||||
|
||||
struct RLC_LengthIndicator_LI11_Type_RLC_LI11_List_Type_Dynamic {
|
||||
size_t d;
|
||||
struct RLC_LengthIndicator_LI11_Type* v;
|
||||
};
|
||||
|
||||
typedef struct RLC_LengthIndicator_LI11_Type_RLC_LI11_List_Type_Dynamic RLC_LI11_List_Type;
|
||||
|
||||
struct RLC_LengthIndicator_LI15_Type {
|
||||
B1_Type Extension;
|
||||
B15_Type LengthIndicator;
|
||||
};
|
||||
|
||||
struct RLC_LengthIndicator_LI15_Type_RLC_LI15_List_Type_Dynamic {
|
||||
size_t d;
|
||||
struct RLC_LengthIndicator_LI15_Type* v;
|
||||
};
|
||||
|
||||
typedef struct RLC_LengthIndicator_LI15_Type_RLC_LI15_List_Type_Dynamic RLC_LI15_List_Type;
|
||||
|
||||
enum RLC_LI_List_Type_Sel {
|
||||
RLC_LI_List_Type_UNBOUND_VALUE = 0,
|
||||
RLC_LI_List_Type_LI11 = 1,
|
||||
RLC_LI_List_Type_LI15 = 2,
|
||||
};
|
||||
|
||||
union RLC_LI_List_Type_Value {
|
||||
RLC_LI11_List_Type LI11;
|
||||
RLC_LI15_List_Type LI15;
|
||||
};
|
||||
|
||||
struct RLC_LI_List_Type {
|
||||
enum RLC_LI_List_Type_Sel d;
|
||||
union RLC_LI_List_Type_Value v;
|
||||
};
|
||||
|
||||
struct B4_Type_Padding_Optional {
|
||||
bool d;
|
||||
B4_Type v;
|
||||
};
|
||||
|
||||
struct RLC_PDU_Header_FlexPart_Type {
|
||||
struct RLC_LI_List_Type LengthIndicator;
|
||||
struct B4_Type_Padding_Optional Padding;
|
||||
};
|
||||
|
||||
struct RLC_PDU_Header_FlexPart_Type_RLC_UMD_HeaderShortSN_Type_FlexPart_Optional {
|
||||
bool d;
|
||||
struct RLC_PDU_Header_FlexPart_Type v;
|
||||
};
|
||||
|
||||
struct RLC_UMD_HeaderShortSN_Type {
|
||||
struct RLC_UMD_Header_FixPartShortSN_Type FixPart;
|
||||
struct RLC_PDU_Header_FlexPart_Type_RLC_UMD_HeaderShortSN_Type_FlexPart_Optional FlexPart;
|
||||
};
|
||||
|
||||
struct RLC_UMD_PDU_ShortSN_Type {
|
||||
struct RLC_UMD_HeaderShortSN_Type Header;
|
||||
RLC_DataFieldList_Type Data;
|
||||
};
|
||||
|
||||
struct RLC_UMD_Header_FixPartLongSN_Type {
|
||||
B3_Type Reserved;
|
||||
RLC_FramingInfo_Type FramingInfo;
|
||||
B1_Type Extension;
|
||||
B10_Type SequenceNumber;
|
||||
};
|
||||
|
||||
struct RLC_PDU_Header_FlexPart_Type_RLC_UMD_HeaderLongSN_Type_FlexPart_Optional {
|
||||
bool d;
|
||||
struct RLC_PDU_Header_FlexPart_Type v;
|
||||
};
|
||||
|
||||
struct RLC_UMD_HeaderLongSN_Type {
|
||||
struct RLC_UMD_Header_FixPartLongSN_Type FixPart;
|
||||
struct RLC_PDU_Header_FlexPart_Type_RLC_UMD_HeaderLongSN_Type_FlexPart_Optional FlexPart;
|
||||
};
|
||||
|
||||
struct RLC_UMD_PDU_LongSN_Type {
|
||||
struct RLC_UMD_HeaderLongSN_Type Header;
|
||||
RLC_DataFieldList_Type Data;
|
||||
};
|
||||
|
||||
enum RLC_UMD_PDU_Type_Sel {
|
||||
RLC_UMD_PDU_Type_UNBOUND_VALUE = 0,
|
||||
RLC_UMD_PDU_Type_ShortSN = 1,
|
||||
RLC_UMD_PDU_Type_LongSN = 2,
|
||||
};
|
||||
|
||||
union RLC_UMD_PDU_Type_Value {
|
||||
struct RLC_UMD_PDU_ShortSN_Type ShortSN;
|
||||
struct RLC_UMD_PDU_LongSN_Type LongSN;
|
||||
};
|
||||
|
||||
struct RLC_UMD_PDU_Type {
|
||||
enum RLC_UMD_PDU_Type_Sel d;
|
||||
union RLC_UMD_PDU_Type_Value v;
|
||||
};
|
||||
|
||||
struct RLC_AMD_Header_FixPart_Type {
|
||||
B1_Type D_C;
|
||||
B1_Type ReSeg;
|
||||
B1_Type Poll;
|
||||
RLC_FramingInfo_Type FramingInfo;
|
||||
B1_Type Extension;
|
||||
B10_Type SN;
|
||||
};
|
||||
|
||||
struct RLC_AMD_Header_SegmentPart_Type {
|
||||
B1_Type LastSegmentFlag;
|
||||
B15_Type SegOffset;
|
||||
};
|
||||
|
||||
struct RLC_AMD_Header_SegmentPart_Type_SegmentPart_Optional {
|
||||
bool d;
|
||||
struct RLC_AMD_Header_SegmentPart_Type v;
|
||||
};
|
||||
|
||||
struct RLC_PDU_Header_FlexPart_Type_RLC_AMD_Header_Type_FlexPart_Optional {
|
||||
bool d;
|
||||
struct RLC_PDU_Header_FlexPart_Type v;
|
||||
};
|
||||
|
||||
struct RLC_AMD_Header_Type {
|
||||
struct RLC_AMD_Header_FixPart_Type FixPart;
|
||||
struct RLC_AMD_Header_SegmentPart_Type_SegmentPart_Optional SegmentPart;
|
||||
struct RLC_PDU_Header_FlexPart_Type_RLC_AMD_Header_Type_FlexPart_Optional FlexPart;
|
||||
};
|
||||
|
||||
struct RLC_AMD_PDU_Type {
|
||||
struct RLC_AMD_Header_Type Header;
|
||||
RLC_DataFieldList_Type Data;
|
||||
};
|
||||
|
||||
struct RLC_AMD_Header_FixPartExt_Type {
|
||||
B1_Type D_C;
|
||||
B1_Type ReSeg;
|
||||
B1_Type Poll;
|
||||
RLC_FramingInfo_Type FramingInfo;
|
||||
B1_Type Extension;
|
||||
B2_Type Reserved;
|
||||
B16_Type SN_Ext;
|
||||
};
|
||||
|
||||
struct RLC_PDU_Header_FlexPart_Type_RLC_AMD_HeaderExt_Type_FlexPart_Optional {
|
||||
bool d;
|
||||
struct RLC_PDU_Header_FlexPart_Type v;
|
||||
};
|
||||
|
||||
struct RLC_AMD_HeaderExt_Type {
|
||||
struct RLC_AMD_Header_FixPartExt_Type FixPartExt;
|
||||
struct RLC_PDU_Header_FlexPart_Type_RLC_AMD_HeaderExt_Type_FlexPart_Optional FlexPart;
|
||||
};
|
||||
|
||||
struct RLC_AMD_PDU_Ext_Type {
|
||||
struct RLC_AMD_HeaderExt_Type HeaderExt;
|
||||
RLC_DataFieldList_Type Data;
|
||||
};
|
||||
|
||||
struct RLC_AMD_Header_FixPartSegExt_Type {
|
||||
B1_Type D_C;
|
||||
B1_Type ReSeg;
|
||||
B1_Type Poll;
|
||||
RLC_FramingInfo_Type FramingInfo;
|
||||
B1_Type Extension;
|
||||
B1_Type LastSegmentFlag;
|
||||
B1_Type Reserved;
|
||||
B16_Type SN_Ext;
|
||||
};
|
||||
|
||||
struct RLC_AMD_Header_SegmentPartExt_Type {
|
||||
B16_Type SegOffset;
|
||||
};
|
||||
|
||||
struct RLC_AMD_Header_SegmentPartExt_Type_SegmentPart_Optional {
|
||||
bool d;
|
||||
struct RLC_AMD_Header_SegmentPartExt_Type v;
|
||||
};
|
||||
|
||||
struct RLC_PDU_Header_FlexPart_Type_FlexPart_Optional {
|
||||
bool d;
|
||||
struct RLC_PDU_Header_FlexPart_Type v;
|
||||
};
|
||||
|
||||
struct RLC_AMD_HeaderSegExt_Type {
|
||||
struct RLC_AMD_Header_FixPartSegExt_Type FixPartSegExt;
|
||||
struct RLC_AMD_Header_SegmentPartExt_Type_SegmentPart_Optional SegmentPart;
|
||||
struct RLC_PDU_Header_FlexPart_Type_FlexPart_Optional FlexPart;
|
||||
};
|
||||
|
||||
struct RLC_AMD_PDU_SegExt_Type {
|
||||
struct RLC_AMD_HeaderSegExt_Type HeaderSegExt;
|
||||
RLC_DataFieldList_Type Data;
|
||||
};
|
||||
|
||||
struct RLC_Status_ACK_Type {
|
||||
B10_Type ACK_SN;
|
||||
B1_Type Extn1;
|
||||
};
|
||||
|
||||
struct RLC_Status_SegOffset_Type {
|
||||
B15_Type Start;
|
||||
B15_Type End;
|
||||
};
|
||||
|
||||
struct RLC_Status_SegOffset_Type_SO_Optional {
|
||||
bool d;
|
||||
struct RLC_Status_SegOffset_Type v;
|
||||
};
|
||||
|
||||
struct RLC_Status_NACK_Type {
|
||||
B10_Type NACK_SN;
|
||||
B1_Type Extn1;
|
||||
B1_Type Extn2;
|
||||
struct RLC_Status_SegOffset_Type_SO_Optional SO;
|
||||
};
|
||||
|
||||
struct RLC_Status_NACK_Type_RLC_Status_NACK_List_Type_Dynamic {
|
||||
size_t d;
|
||||
struct RLC_Status_NACK_Type* v;
|
||||
};
|
||||
|
||||
typedef struct RLC_Status_NACK_Type_RLC_Status_NACK_List_Type_Dynamic RLC_Status_NACK_List_Type;
|
||||
|
||||
struct RLC_Status_NACK_List_Type_NackList_Optional {
|
||||
bool d;
|
||||
RLC_Status_NACK_List_Type v;
|
||||
};
|
||||
|
||||
struct RLC_Status_Padding_Type_RLC_AM_StatusPDU_Type_Padding_Optional {
|
||||
bool d;
|
||||
RLC_Status_Padding_Type v;
|
||||
};
|
||||
|
||||
struct RLC_AM_StatusPDU_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type CP_Type;
|
||||
struct RLC_Status_ACK_Type Ack;
|
||||
struct RLC_Status_NACK_List_Type_NackList_Optional NackList;
|
||||
struct RLC_Status_Padding_Type_RLC_AM_StatusPDU_Type_Padding_Optional Padding;
|
||||
};
|
||||
|
||||
struct RLC_Status_ACK_Ext_Type {
|
||||
B16_Type ACK_SN_Ext;
|
||||
B1_Type Extn1;
|
||||
};
|
||||
|
||||
struct RLC_Status_SegOffset_Ext_Type {
|
||||
B16_Type Start;
|
||||
B16_Type End;
|
||||
};
|
||||
|
||||
struct RLC_Status_SegOffset_Ext_Type_SO_Optional {
|
||||
bool d;
|
||||
struct RLC_Status_SegOffset_Ext_Type v;
|
||||
};
|
||||
|
||||
struct RLC_Status_NACK_Ext_Type {
|
||||
B16_Type NACK_SN_Ext;
|
||||
B1_Type Extn1;
|
||||
B1_Type Extn2;
|
||||
struct RLC_Status_SegOffset_Ext_Type_SO_Optional SO;
|
||||
};
|
||||
|
||||
struct RLC_Status_NACK_Ext_Type_RLC_Status_NACK_Ext_List_Type_Dynamic {
|
||||
size_t d;
|
||||
struct RLC_Status_NACK_Ext_Type* v;
|
||||
};
|
||||
|
||||
typedef struct RLC_Status_NACK_Ext_Type_RLC_Status_NACK_Ext_List_Type_Dynamic RLC_Status_NACK_Ext_List_Type;
|
||||
|
||||
struct RLC_Status_NACK_Ext_List_Type_Nack_Ext_List_Optional {
|
||||
bool d;
|
||||
RLC_Status_NACK_Ext_List_Type v;
|
||||
};
|
||||
|
||||
struct RLC_Status_Padding_Type_RLC_AM_StatusPDU_Ext_Type_Padding_Optional {
|
||||
bool d;
|
||||
RLC_Status_Padding_Type v;
|
||||
};
|
||||
|
||||
struct RLC_AM_StatusPDU_Ext_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type CP_Type;
|
||||
struct RLC_Status_ACK_Ext_Type Ack_Ext;
|
||||
struct RLC_Status_NACK_Ext_List_Type_Nack_Ext_List_Optional Nack_Ext_List;
|
||||
struct RLC_Status_Padding_Type_RLC_AM_StatusPDU_Ext_Type_Padding_Optional Padding;
|
||||
};
|
||||
|
||||
enum RLC_PDU_Type_Sel {
|
||||
RLC_PDU_Type_UNBOUND_VALUE = 0,
|
||||
RLC_PDU_Type_TMD = 1,
|
||||
RLC_PDU_Type_UMD = 2,
|
||||
RLC_PDU_Type_AMD = 3,
|
||||
RLC_PDU_Type_AMD_Ext = 4,
|
||||
RLC_PDU_Type_AMD_SegExt = 5,
|
||||
RLC_PDU_Type_Status = 6,
|
||||
RLC_PDU_Type_Status_Ext = 7,
|
||||
};
|
||||
|
||||
union RLC_PDU_Type_Value {
|
||||
RLC_TMD_PDU_Type TMD;
|
||||
struct RLC_UMD_PDU_Type UMD;
|
||||
struct RLC_AMD_PDU_Type AMD;
|
||||
struct RLC_AMD_PDU_Ext_Type AMD_Ext;
|
||||
struct RLC_AMD_PDU_SegExt_Type AMD_SegExt;
|
||||
struct RLC_AM_StatusPDU_Type Status;
|
||||
struct RLC_AM_StatusPDU_Ext_Type Status_Ext;
|
||||
};
|
||||
|
||||
struct RLC_PDU_Type {
|
||||
enum RLC_PDU_Type_Sel d;
|
||||
union RLC_PDU_Type_Value v;
|
||||
};
|
||||
|
||||
struct RLC_PDU_Type_RLC_PDUList_Type_Dynamic {
|
||||
size_t d;
|
||||
struct RLC_PDU_Type* v;
|
||||
};
|
||||
|
||||
typedef struct RLC_PDU_Type_RLC_PDUList_Type_Dynamic RLC_PDUList_Type;
|
||||
|
||||
struct PDCP_DataPdu_LongSN_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type Reserved;
|
||||
B12_Type SequenceNumber;
|
||||
PDCP_SDU_Type SDU;
|
||||
};
|
||||
|
||||
struct PDCP_DataPdu_ShortSN_Type {
|
||||
B1_Type D_C;
|
||||
B7_Type SequenceNumber;
|
||||
PDCP_SDU_Type SDU;
|
||||
};
|
||||
|
||||
struct PDCP_DataPdu_ExtSN_Type {
|
||||
B1_Type D_C;
|
||||
B15_Type SequenceNumber;
|
||||
PDCP_SDU_Type SDU;
|
||||
};
|
||||
|
||||
struct PDCP_DataPdu_18bitSN_Type {
|
||||
B1_Type D_C;
|
||||
B1_Type PollingBit;
|
||||
B4_Type Reserved;
|
||||
B18_Type SequenceNumber;
|
||||
PDCP_SDU_Type SDU;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_ROHC_FB_PDU_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B4_Type Reserved;
|
||||
OCTET_STRING ROHC_FB;
|
||||
};
|
||||
|
||||
struct OCTET_STRING_PDCP_Ctrl_StatusReport_Type_Bitmap_Optional {
|
||||
bool d;
|
||||
OCTET_STRING v;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_StatusReport_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B12_Type FMS;
|
||||
struct OCTET_STRING_PDCP_Ctrl_StatusReport_Type_Bitmap_Optional Bitmap;
|
||||
};
|
||||
|
||||
struct OCTET_STRING_PDCP_Ctrl_StatusReportExt_Type_Bitmap_Optional {
|
||||
bool d;
|
||||
OCTET_STRING v;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_StatusReportExt_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B5_Type Reserved;
|
||||
B15_Type FMS_Ext;
|
||||
struct OCTET_STRING_PDCP_Ctrl_StatusReportExt_Type_Bitmap_Optional Bitmap;
|
||||
};
|
||||
|
||||
struct OCTET_STRING_PDCP_Ctrl_StatusReport_18bitSN_Type_Bitmap_Optional {
|
||||
bool d;
|
||||
OCTET_STRING v;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_StatusReport_18bitSN_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B2_Type Reserved;
|
||||
B18_Type FMS_18bitSN;
|
||||
struct OCTET_STRING_PDCP_Ctrl_StatusReport_18bitSN_Type_Bitmap_Optional Bitmap;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_LWA_StatusReport_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B12_Type FMS;
|
||||
B12_Type HRW;
|
||||
B12_Type NMP;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_LWA_StatusReportExt_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B5_Type Reserved;
|
||||
B15_Type FMS_Ext;
|
||||
B1_Type Reserved2;
|
||||
B15_Type HRW_Ext;
|
||||
B1_Type Reserved3;
|
||||
B15_Type NMP_Ext;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_LWA_StatusReport_18bitSN_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B2_Type Reserved;
|
||||
B18_Type FMS_18bitSN;
|
||||
B18_Type HRW_18bitSN;
|
||||
B4_Type Reserved2;
|
||||
B18_Type NMP_18bitSN;
|
||||
};
|
||||
|
||||
struct PDCP_DataPdu_SLRB_Type {
|
||||
B3_Type SDU_Type;
|
||||
B5_Type PGK_Index;
|
||||
B16_Type PTK_Identity;
|
||||
B16_Type SequenceNumber;
|
||||
PDCP_SDU_Type SDU;
|
||||
};
|
||||
|
||||
struct PDCP_DataPdu_SLRB_1to1_Type {
|
||||
B3_Type SDU_Type;
|
||||
B5_Type Reserved;
|
||||
B16_Type KD_sess_ID;
|
||||
B16_Type SequenceNumber;
|
||||
PDCP_SDU_Type SDU;
|
||||
O4_Type MAC_I;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_LWA_EndMarker_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B12_Type LSN;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_LWA_EndMarkerExt_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B5_Type Reserved;
|
||||
B15_Type LSN_Ext;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_LWA_EndMarker_18bitSN_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B2_Type Reserved;
|
||||
B18_Type LSN_18bitSN;
|
||||
};
|
||||
|
||||
struct PDCP_DataPdu_LongSN_UDC_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type Reserved;
|
||||
B12_Type SequenceNumber;
|
||||
B1_Type FU;
|
||||
B1_Type FR;
|
||||
B2_Type Reserved2;
|
||||
B4_Type Checksum;
|
||||
PDCP_SDU_Type SDU;
|
||||
};
|
||||
|
||||
struct PDCP_DataPdu_ExtSN_UDC_Type {
|
||||
B1_Type D_C;
|
||||
B15_Type SequenceNumber;
|
||||
B1_Type FU;
|
||||
B1_Type FR;
|
||||
B2_Type Reserved2;
|
||||
B4_Type Checksum;
|
||||
PDCP_SDU_Type SDU;
|
||||
};
|
||||
|
||||
struct PDCP_DataPdu_18bitSN_UDC_Type {
|
||||
B1_Type D_C;
|
||||
B1_Type PollingBit;
|
||||
B4_Type Reserved;
|
||||
B18_Type SequenceNumber;
|
||||
B1_Type FU;
|
||||
B1_Type FR;
|
||||
B2_Type Reserved2;
|
||||
B4_Type Checksum;
|
||||
PDCP_SDU_Type SDU;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_UDC_FB_PDU_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B1_Type FE;
|
||||
B3_Type Reserved;
|
||||
};
|
||||
|
||||
struct PDCP_Ctrl_EHC_FB_PDU_Type {
|
||||
B1_Type D_C;
|
||||
B3_Type PDU_Type;
|
||||
B4_Type Reserved;
|
||||
O1_Type EHC_FB;
|
||||
};
|
||||
|
||||
enum PDCP_PDU_Type_Sel {
|
||||
PDCP_PDU_Type_UNBOUND_VALUE = 0,
|
||||
PDCP_PDU_Type_DataLongSN = 1,
|
||||
PDCP_PDU_Type_DataShortSN = 2,
|
||||
PDCP_PDU_Type_DataExtSN = 3,
|
||||
PDCP_PDU_Type_Data_18bitSN = 4,
|
||||
PDCP_PDU_Type_RohcFeedback = 5,
|
||||
PDCP_PDU_Type_StatusReport = 6,
|
||||
PDCP_PDU_Type_StatusReportExt = 7,
|
||||
PDCP_PDU_Type_StatusReport_18bitSN = 8,
|
||||
PDCP_PDU_Type_LWA_StatusReport = 9,
|
||||
PDCP_PDU_Type_LWA_StatusReportExt = 10,
|
||||
PDCP_PDU_Type_LWA_StatusReport_18bitSN = 11,
|
||||
PDCP_PDU_Type_DataSLRB = 12,
|
||||
PDCP_PDU_Type_DataSLRB_1to1 = 13,
|
||||
PDCP_PDU_Type_LWA_EndMarker = 14,
|
||||
PDCP_PDU_Type_LWA_EndMarkerExt = 15,
|
||||
PDCP_PDU_Type_LWA_EndMarker_18bitSN = 16,
|
||||
PDCP_PDU_Type_DataLongSN_UDC = 17,
|
||||
PDCP_PDU_Type_DataExtSN_UDC = 18,
|
||||
PDCP_PDU_Type_Data18bitSN_UDC = 19,
|
||||
PDCP_PDU_Type_UdcFeedback = 20,
|
||||
PDCP_PDU_Type_EhcFeedback = 21,
|
||||
};
|
||||
|
||||
union PDCP_PDU_Type_Value {
|
||||
struct PDCP_DataPdu_LongSN_Type DataLongSN;
|
||||
struct PDCP_DataPdu_ShortSN_Type DataShortSN;
|
||||
struct PDCP_DataPdu_ExtSN_Type DataExtSN;
|
||||
struct PDCP_DataPdu_18bitSN_Type Data_18bitSN;
|
||||
struct PDCP_Ctrl_ROHC_FB_PDU_Type RohcFeedback;
|
||||
struct PDCP_Ctrl_StatusReport_Type StatusReport;
|
||||
struct PDCP_Ctrl_StatusReportExt_Type StatusReportExt;
|
||||
struct PDCP_Ctrl_StatusReport_18bitSN_Type StatusReport_18bitSN;
|
||||
struct PDCP_Ctrl_LWA_StatusReport_Type LWA_StatusReport;
|
||||
struct PDCP_Ctrl_LWA_StatusReportExt_Type LWA_StatusReportExt;
|
||||
struct PDCP_Ctrl_LWA_StatusReport_18bitSN_Type LWA_StatusReport_18bitSN;
|
||||
struct PDCP_DataPdu_SLRB_Type DataSLRB;
|
||||
struct PDCP_DataPdu_SLRB_1to1_Type DataSLRB_1to1;
|
||||
struct PDCP_Ctrl_LWA_EndMarker_Type LWA_EndMarker;
|
||||
struct PDCP_Ctrl_LWA_EndMarkerExt_Type LWA_EndMarkerExt;
|
||||
struct PDCP_Ctrl_LWA_EndMarker_18bitSN_Type LWA_EndMarker_18bitSN;
|
||||
struct PDCP_DataPdu_LongSN_UDC_Type DataLongSN_UDC;
|
||||
struct PDCP_DataPdu_ExtSN_UDC_Type DataExtSN_UDC;
|
||||
struct PDCP_DataPdu_18bitSN_UDC_Type Data18bitSN_UDC;
|
||||
struct PDCP_Ctrl_UDC_FB_PDU_Type UdcFeedback;
|
||||
struct PDCP_Ctrl_EHC_FB_PDU_Type EhcFeedback;
|
||||
};
|
||||
|
||||
struct PDCP_PDU_Type {
|
||||
enum PDCP_PDU_Type_Sel d;
|
||||
union PDCP_PDU_Type_Value v;
|
||||
};
|
||||
|
||||
struct PDCP_PDU_Type_PDCP_PDUList_Type_Dynamic {
|
||||
size_t d;
|
||||
struct PDCP_PDU_Type* v;
|
||||
};
|
||||
|
||||
typedef struct PDCP_PDU_Type_PDCP_PDUList_Type_Dynamic PDCP_PDUList_Type;
|
||||
|
||||
enum L2DataList_Type_Sel {
|
||||
L2DataList_Type_UNBOUND_VALUE = 0,
|
||||
L2DataList_Type_MacPdu = 1,
|
||||
L2DataList_Type_RlcPdu = 2,
|
||||
L2DataList_Type_PdcpPdu = 3,
|
||||
L2DataList_Type_PdcpSdu = 4,
|
||||
L2DataList_Type_NrPdcpSdu = 5,
|
||||
L2DataList_Type_RlcSdu = 6,
|
||||
};
|
||||
|
||||
union L2DataList_Type_Value {
|
||||
MAC_PDUList_Type MacPdu;
|
||||
RLC_PDUList_Type RlcPdu;
|
||||
PDCP_PDUList_Type PdcpPdu;
|
||||
PDCP_SDUList_Type PdcpSdu;
|
||||
PDCP_SDUList_Type NrPdcpSdu;
|
||||
RLC_SDUList_Type RlcSdu;
|
||||
};
|
||||
|
||||
struct L2DataList_Type {
|
||||
enum L2DataList_Type_Sel d;
|
||||
union L2DataList_Type_Value v;
|
||||
};
|
||||
|
||||
struct HarqProcessAssignment_Type_HarqProcess_Optional {
|
||||
bool d;
|
||||
struct HarqProcessAssignment_Type v;
|
||||
};
|
||||
|
||||
struct DRB_DataPerSubframe_DL_Type {
|
||||
int32_t SubframeOffset;
|
||||
struct HarqProcessAssignment_Type_HarqProcess_Optional HarqProcess;
|
||||
struct L2DataList_Type PduSduList;
|
||||
};
|
||||
|
||||
struct DRB_DataPerSubframe_DL_Type_DRB_DataPerSubframeList_DL_Type_Dynamic {
|
||||
size_t d;
|
||||
struct DRB_DataPerSubframe_DL_Type* v;
|
||||
};
|
||||
|
||||
typedef struct DRB_DataPerSubframe_DL_Type_DRB_DataPerSubframeList_DL_Type_Dynamic DRB_DataPerSubframeList_DL_Type;
|
||||
|
||||
struct L2Data_Request_Type {
|
||||
DRB_DataPerSubframeList_DL_Type SubframeDataList;
|
||||
};
|
||||
|
||||
struct DRB_DataPerSubframe_UL_Type {
|
||||
struct L2DataList_Type PduSduList;
|
||||
int32_t NoOfTTIs;
|
||||
};
|
||||
|
||||
struct L2Data_Indication_Type {
|
||||
struct DRB_DataPerSubframe_UL_Type SubframeData;
|
||||
};
|
||||
|
||||
struct Null_Type_SuppressPdcchForC_RNTI_Optional {
|
||||
bool d;
|
||||
Null_Type v;
|
||||
};
|
||||
|
||||
struct DRB_COMMON_REQ {
|
||||
struct ReqAspCommonPart_Type Common;
|
||||
struct L2Data_Request_Type U_Plane;
|
||||
struct Null_Type_SuppressPdcchForC_RNTI_Optional SuppressPdcchForC_RNTI;
|
||||
};
|
||||
|
||||
struct DRB_COMMON_IND {
|
||||
struct IndAspCommonPart_Type Common;
|
||||
struct L2Data_Indication_Type U_Plane;
|
||||
};
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
202
openair3/SS/Sidl/sidl/api/SIDL_EUTRA_SYSIND_PORT.h
Normal file
202
openair3/SS/Sidl/sidl/api/SIDL_EUTRA_SYSIND_PORT.h
Normal file
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
typedef uint8_t PrachPreambleIndex_Type;
|
||||
|
||||
typedef Dummy_Type PRTPower_Type;
|
||||
|
||||
typedef int LogicalChannelGroup_Type;
|
||||
|
||||
typedef uint8_t PHR_Type;
|
||||
|
||||
struct int_RepetitionsPerPreambleAttempt_Optional {
|
||||
bool d;
|
||||
int v;
|
||||
};
|
||||
|
||||
struct RachPreamble_Type {
|
||||
PrachPreambleIndex_Type RAPID;
|
||||
PRTPower_Type PRTPower;
|
||||
struct int_RepetitionsPerPreambleAttempt_Optional RepetitionsPerPreambleAttempt;
|
||||
};
|
||||
|
||||
struct SL_BSR_Value_Type {
|
||||
B4_Type DestinationIndex;
|
||||
B2_Type LCG_ID;
|
||||
B6_Type BufferSize;
|
||||
};
|
||||
|
||||
struct SL_BSR_Value_Type_SL_BSR_ValueList_Type_Dynamic {
|
||||
size_t d;
|
||||
struct SL_BSR_Value_Type* v;
|
||||
};
|
||||
|
||||
typedef struct SL_BSR_Value_Type_SL_BSR_ValueList_Type_Dynamic SL_BSR_ValueList_Type;
|
||||
|
||||
struct SL_BSR_MACHeader_Type {
|
||||
B5_Type HeaderFieldLCID;
|
||||
B1_Type HeaderFieldE;
|
||||
B1_Type HeaderFieldF;
|
||||
SL_BSR_ValueList_Type SL_BSR_Value;
|
||||
};
|
||||
|
||||
typedef int BSR_Value_Type;
|
||||
|
||||
struct Short_BSR_Type {
|
||||
LogicalChannelGroup_Type LCG;
|
||||
BSR_Value_Type Value;
|
||||
};
|
||||
|
||||
struct Long_BSR_Type {
|
||||
BSR_Value_Type Value_LCG1;
|
||||
BSR_Value_Type Value_LCG2;
|
||||
BSR_Value_Type Value_LCG3;
|
||||
BSR_Value_Type Value_LCG4;
|
||||
};
|
||||
|
||||
enum BSR_Type_Sel {
|
||||
BSR_Type_UNBOUND_VALUE = 0,
|
||||
BSR_Type_Short = 1,
|
||||
BSR_Type_Truncated = 2,
|
||||
BSR_Type_Long = 3,
|
||||
BSR_Type_Sidelink = 4,
|
||||
};
|
||||
|
||||
union BSR_Type_Value {
|
||||
struct Short_BSR_Type Short;
|
||||
struct Short_BSR_Type Truncated;
|
||||
struct Long_BSR_Type Long;
|
||||
struct SL_BSR_MACHeader_Type Sidelink;
|
||||
};
|
||||
|
||||
struct BSR_Type {
|
||||
enum BSR_Type_Sel d;
|
||||
union BSR_Type_Value v;
|
||||
};
|
||||
|
||||
enum HARQ_Type {
|
||||
HARQ_Type_ack = 0,
|
||||
HARQ_Type_nack = 1,
|
||||
};
|
||||
|
||||
typedef enum HARQ_Type HARQ_Type;
|
||||
|
||||
struct HarqProcessInfo_Type {
|
||||
HarqProcessId_Type Id;
|
||||
int CURRENT_TX_NB;
|
||||
};
|
||||
|
||||
enum HarqError_Type_Sel {
|
||||
HarqError_Type_UNBOUND_VALUE = 0,
|
||||
HarqError_Type_UL = 1,
|
||||
HarqError_Type_DL = 2,
|
||||
};
|
||||
|
||||
union HarqError_Type_Value {
|
||||
struct HarqProcessInfo_Type UL;
|
||||
struct HarqProcessInfo_Type DL;
|
||||
};
|
||||
|
||||
struct HarqError_Type {
|
||||
enum HarqError_Type_Sel d;
|
||||
union HarqError_Type_Value v;
|
||||
};
|
||||
|
||||
struct RlcDiscardInd_Type {
|
||||
int SequenceNumber;
|
||||
};
|
||||
|
||||
typedef uint8_t RI_Type;
|
||||
|
||||
enum SRSInd_Type {
|
||||
SRSInd_Type_SRS_Start = 0,
|
||||
SRSInd_Type_SRS_Stop = 1,
|
||||
};
|
||||
|
||||
typedef enum SRSInd_Type SRSInd_Type;
|
||||
|
||||
enum SystemIndication_Type_Sel {
|
||||
SystemIndication_Type_UNBOUND_VALUE = 0,
|
||||
SystemIndication_Type_Error = 1,
|
||||
SystemIndication_Type_RachPreamble = 2,
|
||||
SystemIndication_Type_SchedReq = 3,
|
||||
SystemIndication_Type_BSR = 4,
|
||||
SystemIndication_Type_UL_HARQ = 5,
|
||||
SystemIndication_Type_C_RNTI = 6,
|
||||
SystemIndication_Type_PHR = 7,
|
||||
SystemIndication_Type_HarqError = 8,
|
||||
SystemIndication_Type_RlcDiscardInd = 9,
|
||||
SystemIndication_Type_PeriodicRI = 10,
|
||||
SystemIndication_Type_EPHR = 11,
|
||||
SystemIndication_Type_CqiInd = 12,
|
||||
SystemIndication_Type_SrsInd = 13,
|
||||
SystemIndication_Type_DC_PHR = 14,
|
||||
};
|
||||
|
||||
union SystemIndication_Type_Value {
|
||||
CHAR_STRING Error;
|
||||
struct RachPreamble_Type RachPreamble;
|
||||
Null_Type SchedReq;
|
||||
struct BSR_Type BSR;
|
||||
HARQ_Type UL_HARQ;
|
||||
C_RNTI C_RNTI;
|
||||
PHR_Type PHR;
|
||||
struct HarqError_Type HarqError;
|
||||
struct RlcDiscardInd_Type RlcDiscardInd;
|
||||
RI_Type PeriodicRI;
|
||||
struct MAC_CTRL_ExtPowerHeadRoom_Type EPHR;
|
||||
Null_Type CqiInd;
|
||||
SRSInd_Type SrsInd;
|
||||
struct MAC_CTRL_DC_PowerHeadRoom_Type DC_PHR;
|
||||
};
|
||||
|
||||
struct SystemIndication_Type {
|
||||
enum SystemIndication_Type_Sel d;
|
||||
union SystemIndication_Type_Value v;
|
||||
};
|
||||
|
||||
struct SYSTEM_IND {
|
||||
struct IndAspCommonPart_Type Common;
|
||||
struct SystemIndication_Type Indication;
|
||||
};
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
877
openair3/SS/Sidl/sidl/api/SIDL_EUTRA_SYSTEM_PORT.h
Normal file
877
openair3/SS/Sidl/sidl/api/SIDL_EUTRA_SYSTEM_PORT.h
Normal file
@@ -0,0 +1,877 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
typedef B128_Type B128_Key_Type;
|
||||
|
||||
typedef CipheringAlgorithm_r12_e CipheringAlgorithm_r12_Type;
|
||||
|
||||
struct SecurityActTime_Type_SecurityActTimeList_Type_Dynamic {
|
||||
size_t d;
|
||||
struct SecurityActTime_Type* v;
|
||||
};
|
||||
|
||||
typedef struct SecurityActTime_Type_SecurityActTimeList_Type_Dynamic SecurityActTimeList_Type;
|
||||
|
||||
struct TimingInfo_Type_TimingInfo_Optional {
|
||||
bool d;
|
||||
struct TimingInfo_Type v;
|
||||
};
|
||||
|
||||
struct CellAttenuationConfig_Type {
|
||||
EUTRA_CellId_Type CellId;
|
||||
struct Attenuation_Type Attenuation;
|
||||
struct TimingInfo_Type_TimingInfo_Optional TimingInfo;
|
||||
};
|
||||
|
||||
enum PdcpCountGetReq_Type_Sel {
|
||||
PdcpCountGetReq_Type_UNBOUND_VALUE = 0,
|
||||
PdcpCountGetReq_Type_AllRBs = 1,
|
||||
PdcpCountGetReq_Type_SingleRB = 2,
|
||||
};
|
||||
|
||||
union PdcpCountGetReq_Type_Value {
|
||||
Null_Type AllRBs;
|
||||
struct RadioBearerId_Type SingleRB;
|
||||
};
|
||||
|
||||
struct PdcpCountGetReq_Type {
|
||||
enum PdcpCountGetReq_Type_Sel d;
|
||||
union PdcpCountGetReq_Type_Value v;
|
||||
};
|
||||
|
||||
enum Pdcp_CountReq_Type_Sel {
|
||||
Pdcp_CountReq_Type_UNBOUND_VALUE = 0,
|
||||
Pdcp_CountReq_Type_Get = 1,
|
||||
Pdcp_CountReq_Type_Set = 2,
|
||||
};
|
||||
|
||||
struct PdcpCountInfo_Type_Set_Dynamic {
|
||||
size_t d;
|
||||
struct PdcpCountInfo_Type* v;
|
||||
};
|
||||
|
||||
union Pdcp_CountReq_Type_Value {
|
||||
struct PdcpCountGetReq_Type Get;
|
||||
struct PdcpCountInfo_Type_Set_Dynamic Set;
|
||||
};
|
||||
|
||||
struct Pdcp_CountReq_Type {
|
||||
enum Pdcp_CountReq_Type_Sel d;
|
||||
union Pdcp_CountReq_Type_Value v;
|
||||
};
|
||||
|
||||
enum PDCP_SNLength_Type {
|
||||
PDCP_SNLength5 = 0,
|
||||
PDCP_SNLength7 = 1,
|
||||
PDCP_SNLength12 = 2,
|
||||
PDCP_SNLength16 = 3,
|
||||
};
|
||||
|
||||
typedef enum PDCP_SNLength_Type PDCP_SNLength_Type;
|
||||
|
||||
struct PDCP_ROHC_Mode_Type {
|
||||
PDCP_SNLength_Type SN_Size;
|
||||
};
|
||||
|
||||
struct PDCP_NonROHC_Mode_Type {
|
||||
PDCP_SNLength_Type SN_Size;
|
||||
};
|
||||
|
||||
enum PDCP_TestModeInfo_Type_Sel {
|
||||
PDCP_TestModeInfo_Type_UNBOUND_VALUE = 0,
|
||||
PDCP_TestModeInfo_Type_PDCP_ROHC_Mode = 1,
|
||||
PDCP_TestModeInfo_Type_PDCP_NonROHC_Mode = 2,
|
||||
};
|
||||
|
||||
union PDCP_TestModeInfo_Type_Value {
|
||||
struct PDCP_ROHC_Mode_Type PDCP_ROHC_Mode;
|
||||
struct PDCP_NonROHC_Mode_Type PDCP_NonROHC_Mode;
|
||||
};
|
||||
|
||||
struct PDCP_TestModeInfo_Type {
|
||||
enum PDCP_TestModeInfo_Type_Sel d;
|
||||
union PDCP_TestModeInfo_Type_Value v;
|
||||
};
|
||||
|
||||
enum PDCP_TestModeConfig_Type_Sel {
|
||||
PDCP_TestModeConfig_Type_UNBOUND_VALUE = 0,
|
||||
PDCP_TestModeConfig_Type_None = 1,
|
||||
PDCP_TestModeConfig_Type_Info = 2,
|
||||
};
|
||||
|
||||
union PDCP_TestModeConfig_Type_Value {
|
||||
Null_Type None;
|
||||
struct PDCP_TestModeInfo_Type Info;
|
||||
};
|
||||
|
||||
struct PDCP_TestModeConfig_Type {
|
||||
enum PDCP_TestModeConfig_Type_Sel d;
|
||||
union PDCP_TestModeConfig_Type_Value v;
|
||||
};
|
||||
|
||||
enum PDCP_Config_Type_Sel {
|
||||
PDCP_Config_UNBOUND_VALUE = 0,
|
||||
PDCP_Config_Type_R8 = 1,
|
||||
};
|
||||
|
||||
union PDCP_Config_Type_Value {
|
||||
struct PDCP_Config R8;
|
||||
};
|
||||
|
||||
struct PDCP_Config_Type {
|
||||
enum PDCP_Config_Type_Sel d;
|
||||
union PDCP_Config_Type_Value v;
|
||||
};
|
||||
|
||||
enum PDCP_RBConfig_Type_Sel {
|
||||
PDCP_RBConfig_Type_UNBOUND_VALUE = 0,
|
||||
PDCP_RBConfig_Type_Srb = 1,
|
||||
PDCP_RBConfig_Type_Drb = 2,
|
||||
PDCP_RBConfig_Type_Transparent = 3,
|
||||
};
|
||||
|
||||
union PDCP_RBConfig_Type_Value {
|
||||
Null_Type Srb;
|
||||
struct PDCP_Config_Type Drb;
|
||||
Null_Type Transparent;
|
||||
};
|
||||
|
||||
struct PDCP_RBConfig_Type {
|
||||
enum PDCP_RBConfig_Type_Sel d;
|
||||
union PDCP_RBConfig_Type_Value v;
|
||||
};
|
||||
|
||||
struct PDCP_RBConfig_Type_Rb_Optional {
|
||||
bool d;
|
||||
struct PDCP_RBConfig_Type v;
|
||||
};
|
||||
|
||||
struct PDCP_TestModeConfig_Type_TestMode_Optional {
|
||||
bool d;
|
||||
struct PDCP_TestModeConfig_Type v;
|
||||
};
|
||||
|
||||
struct PDCP_ConfigInfo_Type {
|
||||
struct PDCP_RBConfig_Type_Rb_Optional Rb;
|
||||
struct PDCP_TestModeConfig_Type_TestMode_Optional TestMode;
|
||||
};
|
||||
|
||||
enum PDCP_Configuration_Type_Sel {
|
||||
PDCP_Configuration_Type_UNBOUND_VALUE = 0,
|
||||
PDCP_Configuration_Type_None = 1,
|
||||
PDCP_Configuration_Type_Config = 2,
|
||||
};
|
||||
|
||||
union PDCP_Configuration_Type_Value {
|
||||
Null_Type None;
|
||||
struct PDCP_ConfigInfo_Type Config;
|
||||
};
|
||||
|
||||
struct PDCP_Configuration_Type {
|
||||
enum PDCP_Configuration_Type_Sel d;
|
||||
union PDCP_Configuration_Type_Value v;
|
||||
};
|
||||
|
||||
enum UL_AM_RLC_Type_Sel {
|
||||
UL_AM_RLC_Type_UNBOUND_VALUE = 0,
|
||||
UL_AM_RLC_Type_R8 = 1,
|
||||
};
|
||||
|
||||
union UL_AM_RLC_Type_Value {
|
||||
struct UL_AM_RLC R8;
|
||||
};
|
||||
|
||||
struct UL_AM_RLC_Type {
|
||||
enum UL_AM_RLC_Type_Sel d;
|
||||
union UL_AM_RLC_Type_Value v;
|
||||
};
|
||||
|
||||
enum DL_AM_RLC_Type_Sel {
|
||||
DL_AM_RLC_Type_UNBOUND_VALUE = 0,
|
||||
DL_AM_RLC_Type_R8 = 1,
|
||||
};
|
||||
|
||||
union DL_AM_RLC_Type_Value {
|
||||
struct DL_AM_RLC R8;
|
||||
};
|
||||
|
||||
struct DL_AM_RLC_Type {
|
||||
enum DL_AM_RLC_Type_Sel d;
|
||||
union DL_AM_RLC_Type_Value v;
|
||||
};
|
||||
|
||||
enum UL_UM_RLC_Type_Sel {
|
||||
UL_UM_RLC_Type_UNBOUND_VALUE = 0,
|
||||
UL_UM_RLC_Type_R8 = 1,
|
||||
};
|
||||
|
||||
union UL_UM_RLC_Type_Value {
|
||||
struct UL_UM_RLC R8;
|
||||
};
|
||||
|
||||
struct UL_UM_RLC_Type {
|
||||
enum UL_UM_RLC_Type_Sel d;
|
||||
union UL_UM_RLC_Type_Value v;
|
||||
};
|
||||
|
||||
enum DL_UM_RLC_Type_Sel {
|
||||
DL_UM_RLC_Type_UNBOUND_VALUE = 0,
|
||||
DL_UM_RLC_Type_R8 = 1,
|
||||
};
|
||||
|
||||
union DL_UM_RLC_Type_Value {
|
||||
struct DL_UM_RLC R8;
|
||||
};
|
||||
|
||||
struct DL_UM_RLC_Type {
|
||||
enum DL_UM_RLC_Type_Sel d;
|
||||
union DL_UM_RLC_Type_Value v;
|
||||
};
|
||||
|
||||
struct UL_AM_RLC_Type_Tx_Optional {
|
||||
bool d;
|
||||
struct UL_AM_RLC_Type v;
|
||||
};
|
||||
|
||||
struct DL_AM_RLC_Type_Rx_Optional {
|
||||
bool d;
|
||||
struct DL_AM_RLC_Type v;
|
||||
};
|
||||
|
||||
struct RLC_Config_v1250_ExtendedLI_Optional {
|
||||
bool d;
|
||||
struct RLC_Config_v1250 v;
|
||||
};
|
||||
|
||||
struct SS_RLC_AM_Type {
|
||||
struct UL_AM_RLC_Type_Tx_Optional Tx;
|
||||
struct DL_AM_RLC_Type_Rx_Optional Rx;
|
||||
struct RLC_Config_v1250_ExtendedLI_Optional ExtendedLI;
|
||||
};
|
||||
|
||||
struct UL_UM_RLC_Type_SS_RLC_UM_Bi_Directional_Type_Tx_Optional {
|
||||
bool d;
|
||||
struct UL_UM_RLC_Type v;
|
||||
};
|
||||
|
||||
struct DL_UM_RLC_Type_SS_RLC_UM_Bi_Directional_Type_Rx_Optional {
|
||||
bool d;
|
||||
struct DL_UM_RLC_Type v;
|
||||
};
|
||||
|
||||
struct SS_RLC_UM_Bi_Directional_Type {
|
||||
struct UL_UM_RLC_Type_SS_RLC_UM_Bi_Directional_Type_Tx_Optional Tx;
|
||||
struct DL_UM_RLC_Type_SS_RLC_UM_Bi_Directional_Type_Rx_Optional Rx;
|
||||
};
|
||||
|
||||
struct DL_UM_RLC_Type_SS_RLC_UM_Uni_Directional_UL_Type_Rx_Optional {
|
||||
bool d;
|
||||
struct DL_UM_RLC_Type v;
|
||||
};
|
||||
|
||||
struct SS_RLC_UM_Uni_Directional_UL_Type {
|
||||
struct DL_UM_RLC_Type_SS_RLC_UM_Uni_Directional_UL_Type_Rx_Optional Rx;
|
||||
};
|
||||
|
||||
struct UL_UM_RLC_Type_SS_RLC_UM_Uni_Directional_DL_Type_Tx_Optional {
|
||||
bool d;
|
||||
struct UL_UM_RLC_Type v;
|
||||
};
|
||||
|
||||
struct SS_RLC_UM_Uni_Directional_DL_Type {
|
||||
struct UL_UM_RLC_Type_SS_RLC_UM_Uni_Directional_DL_Type_Tx_Optional Tx;
|
||||
};
|
||||
|
||||
enum RLC_RbConfig_Type_Sel {
|
||||
RLC_RbConfig_Type_UNBOUND_VALUE = 0,
|
||||
RLC_RbConfig_Type_AM = 1,
|
||||
RLC_RbConfig_Type_UM = 2,
|
||||
RLC_RbConfig_Type_UM_OnlyUL = 3,
|
||||
RLC_RbConfig_Type_UM_OnlyDL = 4,
|
||||
RLC_RbConfig_Type_TM = 5,
|
||||
};
|
||||
|
||||
union RLC_RbConfig_Type_Value {
|
||||
struct SS_RLC_AM_Type AM;
|
||||
struct SS_RLC_UM_Bi_Directional_Type UM;
|
||||
struct SS_RLC_UM_Uni_Directional_UL_Type UM_OnlyUL;
|
||||
struct SS_RLC_UM_Uni_Directional_DL_Type UM_OnlyDL;
|
||||
Null_Type TM;
|
||||
};
|
||||
|
||||
struct RLC_RbConfig_Type {
|
||||
enum RLC_RbConfig_Type_Sel d;
|
||||
union RLC_RbConfig_Type_Value v;
|
||||
};
|
||||
|
||||
enum RLC_ACK_Prohibit_Type {
|
||||
RLC_ACK_Prohibit_Prohibit = 0,
|
||||
RLC_ACK_Prohibit_Continue = 1,
|
||||
};
|
||||
|
||||
typedef enum RLC_ACK_Prohibit_Type RLC_ACK_Prohibit_Type;
|
||||
|
||||
enum RLC_NotACK_NextRLC_PDU_Type {
|
||||
RLC_NotACK_NextRLC_PDU_Start = 0,
|
||||
};
|
||||
|
||||
typedef enum RLC_NotACK_NextRLC_PDU_Type RLC_NotACK_NextRLC_PDU_Type;
|
||||
|
||||
typedef uint16_t RLC_AM_SequenceNumber_Type;
|
||||
|
||||
enum RLC_TestModeInfo_Type_Sel {
|
||||
RLC_TestModeInfo_Type_UNBOUND_VALUE = 0,
|
||||
RLC_TestModeInfo_Type_AckProhibit = 1,
|
||||
RLC_TestModeInfo_Type_NotACK_NextRLC_PDU = 2,
|
||||
RLC_TestModeInfo_Type_ModifyVTS = 3,
|
||||
RLC_TestModeInfo_Type_TransparentMode_UMDwith5BitSN = 4,
|
||||
RLC_TestModeInfo_Type_TransparentMode_UMDwith10BitSN = 5,
|
||||
RLC_TestModeInfo_Type_TransparentMode_AMD = 6,
|
||||
};
|
||||
|
||||
union RLC_TestModeInfo_Type_Value {
|
||||
RLC_ACK_Prohibit_Type AckProhibit;
|
||||
RLC_NotACK_NextRLC_PDU_Type NotACK_NextRLC_PDU;
|
||||
RLC_AM_SequenceNumber_Type ModifyVTS;
|
||||
Null_Type TransparentMode_UMDwith5BitSN;
|
||||
Null_Type TransparentMode_UMDwith10BitSN;
|
||||
Null_Type TransparentMode_AMD;
|
||||
};
|
||||
|
||||
struct RLC_TestModeInfo_Type {
|
||||
enum RLC_TestModeInfo_Type_Sel d;
|
||||
union RLC_TestModeInfo_Type_Value v;
|
||||
};
|
||||
|
||||
enum RLC_TestModeConfig_Type_Sel {
|
||||
RLC_TestModeConfig_Type_UNBOUND_VALUE = 0,
|
||||
RLC_TestModeConfig_Type_None = 1,
|
||||
RLC_TestModeConfig_Type_Info = 2,
|
||||
};
|
||||
|
||||
union RLC_TestModeConfig_Type_Value {
|
||||
Null_Type None;
|
||||
struct RLC_TestModeInfo_Type Info;
|
||||
};
|
||||
|
||||
struct RLC_TestModeConfig_Type {
|
||||
enum RLC_TestModeConfig_Type_Sel d;
|
||||
union RLC_TestModeConfig_Type_Value v;
|
||||
};
|
||||
|
||||
struct RLC_RbConfig_Type_Rb_Optional {
|
||||
bool d;
|
||||
struct RLC_RbConfig_Type v;
|
||||
};
|
||||
|
||||
struct RLC_TestModeConfig_Type_TestMode_Optional {
|
||||
bool d;
|
||||
struct RLC_TestModeConfig_Type v;
|
||||
};
|
||||
|
||||
struct RLC_Configuration_Type {
|
||||
struct RLC_RbConfig_Type_Rb_Optional Rb;
|
||||
struct RLC_TestModeConfig_Type_TestMode_Optional TestMode;
|
||||
};
|
||||
|
||||
typedef int32_t TestLogicalChannelId_Type;
|
||||
|
||||
struct MAC_Test_DLLogChID_Type {
|
||||
TestLogicalChannelId_Type LogChId;
|
||||
Null_Type ConfigLchId;
|
||||
};
|
||||
|
||||
enum MAC_Test_SCH_NoHeaderManipulation_Type {
|
||||
MAC_Test_SCH_NoHeaderManipulation_NormalMode = 0,
|
||||
MAC_Test_SCH_NoHeaderManipulation_DL_SCH_Only = 1,
|
||||
MAC_Test_SCH_NoHeaderManipulation_DL_UL_SCH = 2,
|
||||
};
|
||||
|
||||
typedef enum MAC_Test_SCH_NoHeaderManipulation_Type MAC_Test_SCH_NoHeaderManipulation_Type;
|
||||
|
||||
struct MAC_TestModeInfo_Type {
|
||||
struct MAC_Test_DLLogChID_Type DiffLogChId;
|
||||
MAC_Test_SCH_NoHeaderManipulation_Type No_HeaderManipulation;
|
||||
};
|
||||
|
||||
enum MAC_TestModeConfig_Type_Sel {
|
||||
MAC_TestModeConfig_Type_UNBOUND_VALUE = 0,
|
||||
MAC_TestModeConfig_Type_None = 1,
|
||||
MAC_TestModeConfig_Type_Info = 2,
|
||||
};
|
||||
|
||||
union MAC_TestModeConfig_Type_Value {
|
||||
Null_Type None;
|
||||
struct MAC_TestModeInfo_Type Info;
|
||||
};
|
||||
|
||||
struct MAC_TestModeConfig_Type {
|
||||
enum MAC_TestModeConfig_Type_Sel d;
|
||||
union MAC_TestModeConfig_Type_Value v;
|
||||
};
|
||||
|
||||
typedef LogicalChannelConfig_ul_SpecificParameters_prioritisedBitRate_e PrioritizedBitRate_Type;
|
||||
|
||||
struct Null_Type_LAA_UL_Allowed_Optional {
|
||||
bool d;
|
||||
Null_Type v;
|
||||
};
|
||||
|
||||
struct MAC_LogicalChannelConfig_Type {
|
||||
int32_t Priority;
|
||||
PrioritizedBitRate_Type PrioritizedBitRate;
|
||||
struct Null_Type_LAA_UL_Allowed_Optional LAA_UL_Allowed;
|
||||
};
|
||||
|
||||
struct MAC_LogicalChannelConfig_Type_LogicalChannel_Optional {
|
||||
bool d;
|
||||
struct MAC_LogicalChannelConfig_Type v;
|
||||
};
|
||||
|
||||
struct MAC_TestModeConfig_Type_TestMode_Optional {
|
||||
bool d;
|
||||
struct MAC_TestModeConfig_Type v;
|
||||
};
|
||||
|
||||
struct MAC_Configuration_Type {
|
||||
struct MAC_LogicalChannelConfig_Type_LogicalChannel_Optional LogicalChannel;
|
||||
struct MAC_TestModeConfig_Type_TestMode_Optional TestMode;
|
||||
};
|
||||
|
||||
typedef uint8_t LogicalChannelId_Type;
|
||||
|
||||
struct PDCP_Configuration_Type_Pdcp_Optional {
|
||||
bool d;
|
||||
struct PDCP_Configuration_Type v;
|
||||
};
|
||||
|
||||
struct RLC_Configuration_Type_Rlc_Optional {
|
||||
bool d;
|
||||
struct RLC_Configuration_Type v;
|
||||
};
|
||||
|
||||
struct LogicalChannelId_Type_LogicalChannelId_Optional {
|
||||
bool d;
|
||||
LogicalChannelId_Type v;
|
||||
};
|
||||
|
||||
struct MAC_Configuration_Type_Mac_Optional {
|
||||
bool d;
|
||||
struct MAC_Configuration_Type v;
|
||||
};
|
||||
|
||||
struct bool_DiscardULData_Optional {
|
||||
bool d;
|
||||
bool v;
|
||||
};
|
||||
|
||||
struct RadioBearerConfigInfo_Type {
|
||||
struct PDCP_Configuration_Type_Pdcp_Optional Pdcp;
|
||||
struct RLC_Configuration_Type_Rlc_Optional Rlc;
|
||||
struct LogicalChannelId_Type_LogicalChannelId_Optional LogicalChannelId;
|
||||
struct MAC_Configuration_Type_Mac_Optional Mac;
|
||||
struct bool_DiscardULData_Optional DiscardULData;
|
||||
};
|
||||
|
||||
enum RadioBearerConfig_Type_Sel {
|
||||
RadioBearerConfig_Type_UNBOUND_VALUE = 0,
|
||||
RadioBearerConfig_Type_AddOrReconfigure = 1,
|
||||
RadioBearerConfig_Type_Release = 2,
|
||||
};
|
||||
|
||||
union RadioBearerConfig_Type_Value {
|
||||
struct RadioBearerConfigInfo_Type AddOrReconfigure;
|
||||
Null_Type Release;
|
||||
};
|
||||
|
||||
struct RadioBearerConfig_Type {
|
||||
enum RadioBearerConfig_Type_Sel d;
|
||||
union RadioBearerConfig_Type_Value v;
|
||||
};
|
||||
|
||||
struct RadioBearer_Type {
|
||||
struct RadioBearerId_Type Id;
|
||||
struct RadioBearerConfig_Type Config;
|
||||
};
|
||||
|
||||
struct PdcpSQN_Type {
|
||||
PdcpCountFormat_Type Format;
|
||||
int32_t Value;
|
||||
};
|
||||
|
||||
enum PDCP_ActTime_Type_Sel {
|
||||
PDCP_ActTime_Type_UNBOUND_VALUE = 0,
|
||||
PDCP_ActTime_Type_None = 1,
|
||||
PDCP_ActTime_Type_SQN = 2,
|
||||
};
|
||||
|
||||
union PDCP_ActTime_Type_Value {
|
||||
Null_Type None;
|
||||
struct PdcpSQN_Type SQN;
|
||||
};
|
||||
|
||||
struct PDCP_ActTime_Type {
|
||||
enum PDCP_ActTime_Type_Sel d;
|
||||
union PDCP_ActTime_Type_Value v;
|
||||
};
|
||||
|
||||
struct SecurityActTime_Type {
|
||||
struct RadioBearerId_Type RadioBearerId;
|
||||
struct PDCP_ActTime_Type UL;
|
||||
struct PDCP_ActTime_Type DL;
|
||||
};
|
||||
|
||||
struct SecurityActTimeList_Type_ActTimeList_Optional {
|
||||
bool d;
|
||||
SecurityActTimeList_Type v;
|
||||
};
|
||||
|
||||
struct AS_IntegrityInfo_Type {
|
||||
CipheringAlgorithm_r12_Type Algorithm;
|
||||
B128_Key_Type KRRCint;
|
||||
struct SecurityActTimeList_Type_ActTimeList_Optional ActTimeList;
|
||||
};
|
||||
|
||||
struct AS_CipheringInfo_Type {
|
||||
CipheringAlgorithm_r12_Type Algorithm;
|
||||
B128_Key_Type KRRCenc;
|
||||
B128_Key_Type KUPenc;
|
||||
SecurityActTimeList_Type ActTimeList;
|
||||
};
|
||||
|
||||
struct AS_IntegrityInfo_Type_Integrity_Optional {
|
||||
bool d;
|
||||
struct AS_IntegrityInfo_Type v;
|
||||
};
|
||||
|
||||
struct AS_CipheringInfo_Type_Ciphering_Optional {
|
||||
bool d;
|
||||
struct AS_CipheringInfo_Type v;
|
||||
};
|
||||
|
||||
struct AS_SecStartRestart_Type {
|
||||
struct AS_IntegrityInfo_Type_Integrity_Optional Integrity;
|
||||
struct AS_CipheringInfo_Type_Ciphering_Optional Ciphering;
|
||||
};
|
||||
|
||||
enum AS_Security_Type_Sel {
|
||||
AS_Security_Type_UNBOUND_VALUE = 0,
|
||||
AS_Security_Type_StartRestart = 1,
|
||||
AS_Security_Type_Release = 2,
|
||||
};
|
||||
|
||||
union AS_Security_Type_Value {
|
||||
struct AS_SecStartRestart_Type StartRestart;
|
||||
Null_Type Release;
|
||||
};
|
||||
|
||||
struct AS_Security_Type {
|
||||
enum AS_Security_Type_Sel d;
|
||||
union AS_Security_Type_Value v;
|
||||
};
|
||||
|
||||
struct UE_Category_v1020_Type_ue_Category_V1020_Optional {
|
||||
bool d;
|
||||
UE_Category_v1020_Type v;
|
||||
};
|
||||
|
||||
struct UE_Category_v1170_Type_ue_Category_v1170_Optional {
|
||||
bool d;
|
||||
UE_Category_v1170_Type v;
|
||||
};
|
||||
|
||||
struct UE_Category_v11a0_Type_ue_Category_v11a0_Optional {
|
||||
bool d;
|
||||
UE_Category_v11a0_Type v;
|
||||
};
|
||||
|
||||
struct UE_Category_v1250_Type_ue_Category_v1250_Optional {
|
||||
bool d;
|
||||
UE_Category_v1250_Type v;
|
||||
};
|
||||
|
||||
struct UE_CategoryDL_r12_Type_ue_CategoryDL_r12_Optional {
|
||||
bool d;
|
||||
UE_CategoryDL_r12_Type v;
|
||||
};
|
||||
|
||||
struct UE_CategoryDL_v1260_Type_ue_CategoryDL_v1260_Optional {
|
||||
bool d;
|
||||
UE_CategoryDL_v1260_Type v;
|
||||
};
|
||||
|
||||
struct UE_CategoryDL_v1310_Type_ue_CategoryDL_v1310_Optional {
|
||||
bool d;
|
||||
UE_CategoryDL_v1310_Type v;
|
||||
};
|
||||
|
||||
struct UE_CategoryDL_v1330_Type_ue_CategoryDL_v1330_Optional {
|
||||
bool d;
|
||||
UE_CategoryDL_v1330_Type v;
|
||||
};
|
||||
|
||||
struct UE_CategoryDL_v1350_Type_ue_CategoryDL_v1350_Optional {
|
||||
bool d;
|
||||
UE_CategoryDL_v1350_Type v;
|
||||
};
|
||||
|
||||
struct UE_CategoryDL_v1460_Type_ue_CategoryDL_v1460_Optional {
|
||||
bool d;
|
||||
UE_CategoryDL_v1460_Type v;
|
||||
};
|
||||
|
||||
struct UE_CategoryInfo_Type {
|
||||
UE_Category_Type ue_Category;
|
||||
struct UE_Category_v1020_Type_ue_Category_V1020_Optional ue_Category_V1020;
|
||||
struct UE_Category_v1170_Type_ue_Category_v1170_Optional ue_Category_v1170;
|
||||
struct UE_Category_v11a0_Type_ue_Category_v11a0_Optional ue_Category_v11a0;
|
||||
struct UE_Category_v1250_Type_ue_Category_v1250_Optional ue_Category_v1250;
|
||||
struct UE_CategoryDL_r12_Type_ue_CategoryDL_r12_Optional ue_CategoryDL_r12;
|
||||
struct UE_CategoryDL_v1260_Type_ue_CategoryDL_v1260_Optional ue_CategoryDL_v1260;
|
||||
struct UE_CategoryDL_v1310_Type_ue_CategoryDL_v1310_Optional ue_CategoryDL_v1310;
|
||||
struct UE_CategoryDL_v1330_Type_ue_CategoryDL_v1330_Optional ue_CategoryDL_v1330;
|
||||
struct UE_CategoryDL_v1350_Type_ue_CategoryDL_v1350_Optional ue_CategoryDL_v1350;
|
||||
struct UE_CategoryDL_v1460_Type_ue_CategoryDL_v1460_Optional ue_CategoryDL_v1460;
|
||||
};
|
||||
|
||||
struct int32_t_SubframeOffsetList_Type_Dynamic {
|
||||
size_t d;
|
||||
int32_t* v;
|
||||
};
|
||||
|
||||
typedef struct int32_t_SubframeOffsetList_Type_Dynamic SubframeOffsetList_Type;
|
||||
|
||||
struct SubframeOffsetList_Type_SubframeOffsetList_Optional {
|
||||
bool d;
|
||||
SubframeOffsetList_Type v;
|
||||
};
|
||||
|
||||
struct PagingTrigger_Type {
|
||||
struct PCCH_Message Paging;
|
||||
struct SubframeOffsetList_Type_SubframeOffsetList_Optional SubframeOffsetList;
|
||||
};
|
||||
|
||||
enum IndicationAndControlMode_Type {
|
||||
IndicationAndControlMode_enable = 0,
|
||||
IndicationAndControlMode_disable = 1,
|
||||
};
|
||||
|
||||
typedef enum IndicationAndControlMode_Type IndicationAndControlMode_Type;
|
||||
|
||||
struct IndicationAndControlMode_Type_RachPreamble_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_SchedReq_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_BSR_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_UL_HARQ_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_C_RNTI_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_PHR_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_HarqError_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_PeriodicRI_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_EPHR_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_PeriodicCQI_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_SRS_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct IndicationAndControlMode_Type_DC_PHR_Optional {
|
||||
bool d;
|
||||
IndicationAndControlMode_Type v;
|
||||
};
|
||||
|
||||
struct L1Mac_IndicationControl_Type {
|
||||
struct IndicationAndControlMode_Type_RachPreamble_Optional RachPreamble;
|
||||
struct IndicationAndControlMode_Type_SchedReq_Optional SchedReq;
|
||||
struct IndicationAndControlMode_Type_BSR_Optional BSR;
|
||||
struct IndicationAndControlMode_Type_UL_HARQ_Optional UL_HARQ;
|
||||
struct IndicationAndControlMode_Type_C_RNTI_Optional C_RNTI;
|
||||
struct IndicationAndControlMode_Type_PHR_Optional PHR;
|
||||
struct IndicationAndControlMode_Type_HarqError_Optional HarqError;
|
||||
struct IndicationAndControlMode_Type_PeriodicRI_Optional PeriodicRI;
|
||||
struct IndicationAndControlMode_Type_EPHR_Optional EPHR;
|
||||
struct IndicationAndControlMode_Type_PeriodicCQI_Optional PeriodicCQI;
|
||||
struct IndicationAndControlMode_Type_SRS_Optional SRS;
|
||||
struct IndicationAndControlMode_Type_DC_PHR_Optional DC_PHR;
|
||||
};
|
||||
|
||||
enum SystemRequest_Type_Sel {
|
||||
SystemRequest_Type_UNBOUND_VALUE = 0,
|
||||
SystemRequest_Type_Cell = 1,
|
||||
SystemRequest_Type_CellAttenuationList = 2,
|
||||
SystemRequest_Type_RadioBearerList = 3,
|
||||
SystemRequest_Type_EnquireTiming = 4,
|
||||
SystemRequest_Type_AS_Security = 5,
|
||||
SystemRequest_Type_Paging = 7,
|
||||
SystemRequest_Type_L1MacIndCtrl = 8,
|
||||
SystemRequest_Type_PdcpCount = 10,
|
||||
SystemRequest_Type_UE_Cat_Info = 18,
|
||||
};
|
||||
|
||||
struct CellAttenuationConfig_Type_CellAttenuationList_Dynamic {
|
||||
size_t d;
|
||||
struct CellAttenuationConfig_Type* v;
|
||||
};
|
||||
|
||||
struct RadioBearer_Type_RadioBearerList_Dynamic {
|
||||
size_t d;
|
||||
struct RadioBearer_Type* v;
|
||||
};
|
||||
|
||||
union SystemRequest_Type_Value {
|
||||
struct CellConfigRequest_Type Cell;
|
||||
struct CellAttenuationConfig_Type_CellAttenuationList_Dynamic CellAttenuationList;
|
||||
struct RadioBearer_Type_RadioBearerList_Dynamic RadioBearerList;
|
||||
Null_Type EnquireTiming;
|
||||
struct AS_Security_Type AS_Security;
|
||||
struct PagingTrigger_Type Paging;
|
||||
struct L1Mac_IndicationControl_Type L1MacIndCtrl;
|
||||
struct Pdcp_CountReq_Type PdcpCount;
|
||||
struct UE_CategoryInfo_Type UE_Cat_Info;
|
||||
};
|
||||
|
||||
struct SystemRequest_Type {
|
||||
enum SystemRequest_Type_Sel d;
|
||||
union SystemRequest_Type_Value v;
|
||||
};
|
||||
|
||||
enum SystemConfirm_Type_Sel {
|
||||
SystemConfirm_Type_UNBOUND_VALUE = 0,
|
||||
SystemConfirm_Type_Cell = 1,
|
||||
SystemConfirm_Type_CellAttenuationList = 2,
|
||||
SystemConfirm_Type_RadioBearerList = 3,
|
||||
SystemConfirm_Type_EnquireTiming = 4,
|
||||
SystemConfirm_Type_AS_Security = 5,
|
||||
SystemConfirm_Type_Sps = 6,
|
||||
SystemConfirm_Type_Paging = 7,
|
||||
SystemConfirm_Type_L1MacIndCtrl = 8,
|
||||
SystemConfirm_Type_RlcIndCtrl = 9,
|
||||
SystemConfirm_Type_PdcpCount = 10,
|
||||
SystemConfirm_Type_PdcpHandoverControl = 11,
|
||||
SystemConfirm_Type_L1_TestMode = 12,
|
||||
SystemConfirm_Type_PdcchOrder = 13,
|
||||
SystemConfirm_Type_ActivateScell = 14,
|
||||
SystemConfirm_Type_MbmsConfig = 15,
|
||||
SystemConfirm_Type_PDCCH_MCCH_ChangeNotification = 16,
|
||||
SystemConfirm_Type_MSI_Config = 17,
|
||||
SystemConfirm_Type_UE_Cat_Info = 18,
|
||||
SystemConfirm_Type_OCNG_Config = 19,
|
||||
SystemConfirm_Type_DirectIndicationInfo = 20,
|
||||
};
|
||||
|
||||
union SystemConfirm_Type_Value {
|
||||
Null_Type Cell;
|
||||
Null_Type CellAttenuationList;
|
||||
Null_Type RadioBearerList;
|
||||
Null_Type EnquireTiming;
|
||||
Null_Type AS_Security;
|
||||
Null_Type Sps;
|
||||
Null_Type Paging;
|
||||
Null_Type L1MacIndCtrl;
|
||||
Null_Type RlcIndCtrl;
|
||||
struct Pdcp_CountCnf_Type PdcpCount;
|
||||
Null_Type PdcpHandoverControl;
|
||||
Null_Type L1_TestMode;
|
||||
Null_Type PdcchOrder;
|
||||
Null_Type ActivateScell;
|
||||
Null_Type MbmsConfig;
|
||||
Null_Type PDCCH_MCCH_ChangeNotification;
|
||||
Null_Type MSI_Config;
|
||||
Null_Type UE_Cat_Info;
|
||||
Null_Type OCNG_Config;
|
||||
Null_Type DirectIndicationInfo;
|
||||
};
|
||||
|
||||
struct SystemConfirm_Type {
|
||||
enum SystemConfirm_Type_Sel d;
|
||||
union SystemConfirm_Type_Value v;
|
||||
};
|
||||
|
||||
struct SYSTEM_CTRL_REQ {
|
||||
struct ReqAspCommonPart_Type Common;
|
||||
struct SystemRequest_Type Request;
|
||||
};
|
||||
|
||||
struct SYSTEM_CTRL_CNF {
|
||||
struct CnfAspCommonPart_Type Common;
|
||||
struct SystemConfirm_Type Confirm;
|
||||
};
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
80
openair3/SS/Sidl/sidl/api/SIDL_EUTRA_VNG_PORT.h
Normal file
80
openair3/SS/Sidl/sidl/api/SIDL_EUTRA_VNG_PORT.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
typedef Null_Type EUTRA_VngConfigConfirm_Type;
|
||||
|
||||
typedef int32_t NocLevel_Type;
|
||||
|
||||
struct EUTRA_VngConfigInfo_Type {
|
||||
Dl_Bandwidth_Type Bandwidth;
|
||||
NocLevel_Type NocLevel;
|
||||
};
|
||||
|
||||
enum EUTRA_VngConfigRequest_Type_Sel {
|
||||
EUTRA_VngConfigRequest_Type_UNBOUND_VALUE = 0,
|
||||
EUTRA_VngConfigRequest_Type_Configure = 1,
|
||||
EUTRA_VngConfigRequest_Type_Activate = 2,
|
||||
EUTRA_VngConfigRequest_Type_Deactivate = 3,
|
||||
};
|
||||
|
||||
union EUTRA_VngConfigRequest_Type_Value {
|
||||
struct EUTRA_VngConfigInfo_Type Configure;
|
||||
Null_Type Activate;
|
||||
Null_Type Deactivate;
|
||||
};
|
||||
|
||||
struct EUTRA_VngConfigRequest_Type {
|
||||
enum EUTRA_VngConfigRequest_Type_Sel d;
|
||||
union EUTRA_VngConfigRequest_Type_Value v;
|
||||
};
|
||||
|
||||
struct EUTRA_VNG_CTRL_REQ {
|
||||
struct ReqAspCommonPart_Type Common;
|
||||
struct EUTRA_VngConfigRequest_Type Request;
|
||||
};
|
||||
|
||||
struct EUTRA_VNG_CTRL_CNF {
|
||||
struct CnfAspCommonPart_Type Common;
|
||||
EUTRA_VngConfigConfirm_Type Confirm;
|
||||
};
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
34
openair3/SS/Sidl/sidl/api/SIDL_Handshake.h
Normal file
34
openair3/SS/Sidl/sidl/api/SIDL_Handshake.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
struct AcpHandshake_Type {
|
||||
char acpVersion[32];
|
||||
char acpVerCksm[64];
|
||||
};
|
||||
|
||||
struct AcpHandshakeRsp_Type {
|
||||
bool acpVersionChk;
|
||||
char acpVersion[32];
|
||||
char acpVerCksm[64];
|
||||
};
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
105
openair3/SS/Sidl/sidl/api/SIDL_NASEMU_EUTRA_SYSTEM_PORT.h
Normal file
105
openair3/SS/Sidl/sidl/api/SIDL_NASEMU_EUTRA_SYSTEM_PORT.h
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* 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 RRC_MSG_Request_Type_Sel {
|
||||
RRC_MSG_Request_Type_UNBOUND_VALUE = 0,
|
||||
RRC_MSG_Request_Type_Ccch = 1,
|
||||
RRC_MSG_Request_Type_Dcch = 2,
|
||||
};
|
||||
|
||||
struct uint8_t_RRC_MSG_Request_Type_Ccch_Dynamic {
|
||||
size_t d;
|
||||
uint8_t* v;
|
||||
};
|
||||
|
||||
struct uint8_t_RRC_MSG_Request_Type_Dcch_Dynamic {
|
||||
size_t d;
|
||||
uint8_t* v;
|
||||
};
|
||||
|
||||
union RRC_MSG_Request_Type_Value {
|
||||
struct uint8_t_RRC_MSG_Request_Type_Ccch_Dynamic Ccch;
|
||||
struct uint8_t_RRC_MSG_Request_Type_Dcch_Dynamic Dcch;
|
||||
};
|
||||
|
||||
struct RRC_MSG_Request_Type {
|
||||
enum RRC_MSG_Request_Type_Sel d;
|
||||
union RRC_MSG_Request_Type_Value v;
|
||||
};
|
||||
|
||||
enum RRC_MSG_Indication_Type_Sel {
|
||||
RRC_MSG_Indication_Type_UNBOUND_VALUE = 0,
|
||||
RRC_MSG_Indication_Type_Ccch = 1,
|
||||
RRC_MSG_Indication_Type_Dcch = 2,
|
||||
};
|
||||
|
||||
struct uint8_t_RRC_MSG_Indication_Type_Ccch_Dynamic {
|
||||
size_t d;
|
||||
uint8_t* v;
|
||||
};
|
||||
|
||||
struct uint8_t_RRC_MSG_Indication_Type_Dcch_Dynamic {
|
||||
size_t d;
|
||||
uint8_t* v;
|
||||
};
|
||||
|
||||
union RRC_MSG_Indication_Type_Value {
|
||||
struct uint8_t_RRC_MSG_Indication_Type_Ccch_Dynamic Ccch;
|
||||
struct uint8_t_RRC_MSG_Indication_Type_Dcch_Dynamic Dcch;
|
||||
};
|
||||
|
||||
struct RRC_MSG_Indication_Type {
|
||||
enum RRC_MSG_Indication_Type_Sel d;
|
||||
union RRC_MSG_Indication_Type_Value v;
|
||||
};
|
||||
|
||||
struct EUTRA_RRC_PDU_REQ {
|
||||
struct ReqAspCommonPart_Type Common;
|
||||
struct RRC_MSG_Request_Type RrcPdu;
|
||||
};
|
||||
|
||||
struct EUTRA_RRC_PDU_IND {
|
||||
struct IndAspCommonPart_Type Common;
|
||||
struct RRC_MSG_Indication_Type RrcPdu;
|
||||
};
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
274
openair3/SS/Sidl/sidl/api/SIDL_Test.h
Normal file
274
openair3/SS/Sidl/sidl/api/SIDL_Test.h
Normal file
@@ -0,0 +1,274 @@
|
||||
/*
|
||||
* 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"
|
||||
|
||||
SIDL_BEGIN_C_INTERFACE
|
||||
|
||||
struct Complex {
|
||||
int val;
|
||||
};
|
||||
|
||||
struct Empty {
|
||||
char dummy;
|
||||
};
|
||||
|
||||
struct Empty2 {
|
||||
char dummy;
|
||||
int simple[3];
|
||||
struct Complex complex[3];
|
||||
};
|
||||
|
||||
struct EchoData {
|
||||
char* str;
|
||||
size_t emptyQty;
|
||||
struct Empty* emptyArray;
|
||||
struct Empty* eee;
|
||||
struct Empty sss;
|
||||
};
|
||||
|
||||
struct char_Foo_Dynamic {
|
||||
size_t d;
|
||||
char* v;
|
||||
};
|
||||
|
||||
struct char_Foo_DynamicOptional {
|
||||
bool d;
|
||||
struct char_Foo_Dynamic v;
|
||||
};
|
||||
|
||||
struct char_Koo_ArrayOptional {
|
||||
bool d;
|
||||
char v[25];
|
||||
};
|
||||
|
||||
struct int_Bar_Optional {
|
||||
bool d;
|
||||
int v;
|
||||
};
|
||||
|
||||
struct char_Zoo_Dynamic {
|
||||
size_t d;
|
||||
char* v;
|
||||
};
|
||||
|
||||
struct Empty_Far_Dynamic {
|
||||
size_t d;
|
||||
struct Empty* v;
|
||||
};
|
||||
|
||||
struct Output {
|
||||
struct char_Foo_DynamicOptional Foo;
|
||||
struct char_Koo_ArrayOptional Koo;
|
||||
struct int_Bar_Optional Bar;
|
||||
struct char_Zoo_Dynamic Zoo;
|
||||
size_t ZQty;
|
||||
char* ZArray;
|
||||
struct Empty_Far_Dynamic Far;
|
||||
};
|
||||
|
||||
enum TestUnion_Sel {
|
||||
TestUnion_Zero = 0,
|
||||
TestUnion_One = 1,
|
||||
TestUnion_Two = 2,
|
||||
TestUnion_Three = 3,
|
||||
};
|
||||
|
||||
union TestUnion_Value {
|
||||
int Zero;
|
||||
int One;
|
||||
struct Empty Two;
|
||||
struct Empty Three;
|
||||
};
|
||||
|
||||
struct TestUnion {
|
||||
enum TestUnion_Sel d;
|
||||
union TestUnion_Value v;
|
||||
};
|
||||
|
||||
struct Empty_dynamic_struct_Dynamic {
|
||||
size_t d;
|
||||
struct Empty* v;
|
||||
};
|
||||
|
||||
struct int_dynamic_ints_Dynamic {
|
||||
size_t d;
|
||||
int* v;
|
||||
};
|
||||
|
||||
struct Empty_optional_struct_1_Optional {
|
||||
bool d;
|
||||
struct Empty v;
|
||||
};
|
||||
|
||||
struct Empty_optional_struct_2_Optional {
|
||||
bool d;
|
||||
struct Empty v;
|
||||
};
|
||||
|
||||
struct int_optional_int_1_Optional {
|
||||
bool d;
|
||||
int v;
|
||||
};
|
||||
|
||||
struct int_optional_int_2_Optional {
|
||||
bool d;
|
||||
int v;
|
||||
};
|
||||
|
||||
struct char_optional_string_1_Optional {
|
||||
bool d;
|
||||
char* v;
|
||||
};
|
||||
|
||||
struct char_optional_string_2_Optional {
|
||||
bool d;
|
||||
char* v;
|
||||
};
|
||||
|
||||
struct Empty_optional_struct_array_1_ArrayOptional {
|
||||
bool d;
|
||||
struct Empty v[2];
|
||||
};
|
||||
|
||||
struct Empty_optional_struct_array_2_ArrayOptional {
|
||||
bool d;
|
||||
struct Empty v[2];
|
||||
};
|
||||
|
||||
struct int_optional_int_array_1_ArrayOptional {
|
||||
bool d;
|
||||
int v[2];
|
||||
};
|
||||
|
||||
struct int_optional_int_array_2_ArrayOptional {
|
||||
bool d;
|
||||
int v[2];
|
||||
};
|
||||
|
||||
struct Empty_dynamic_optional_struct_1_Dynamic {
|
||||
size_t d;
|
||||
struct Empty* v;
|
||||
};
|
||||
|
||||
struct Empty_dynamic_optional_struct_1_DynamicOptional {
|
||||
bool d;
|
||||
struct Empty_dynamic_optional_struct_1_Dynamic v;
|
||||
};
|
||||
|
||||
struct Empty_dynamic_optional_struct_2_Dynamic {
|
||||
size_t d;
|
||||
struct Empty* v;
|
||||
};
|
||||
|
||||
struct Empty_dynamic_optional_struct_2_DynamicOptional {
|
||||
bool d;
|
||||
struct Empty_dynamic_optional_struct_2_Dynamic v;
|
||||
};
|
||||
|
||||
struct int_dynamic_optional_int_1_Dynamic {
|
||||
size_t d;
|
||||
int* v;
|
||||
};
|
||||
|
||||
struct int_dynamic_optional_int_1_DynamicOptional {
|
||||
bool d;
|
||||
struct int_dynamic_optional_int_1_Dynamic v;
|
||||
};
|
||||
|
||||
struct int_dynamic_optional_int_2_Dynamic {
|
||||
size_t d;
|
||||
int* v;
|
||||
};
|
||||
|
||||
struct int_dynamic_optional_int_2_DynamicOptional {
|
||||
bool d;
|
||||
struct int_dynamic_optional_int_2_Dynamic v;
|
||||
};
|
||||
|
||||
struct TestUnion_optional_union_1_Optional {
|
||||
bool d;
|
||||
struct TestUnion v;
|
||||
};
|
||||
|
||||
struct TestUnion_optional_union_pointer_1_Optional {
|
||||
bool d;
|
||||
struct TestUnion* v;
|
||||
};
|
||||
|
||||
struct TestUnion_optional_union_2_Optional {
|
||||
bool d;
|
||||
struct TestUnion v;
|
||||
};
|
||||
|
||||
struct TestUnion_dynamic_optional_union_1_Dynamic {
|
||||
size_t d;
|
||||
struct TestUnion* v;
|
||||
};
|
||||
|
||||
struct TestUnion_dynamic_optional_union_1_DynamicOptional {
|
||||
bool d;
|
||||
struct TestUnion_dynamic_optional_union_1_Dynamic v;
|
||||
};
|
||||
|
||||
struct TestUnion_dynamic_optional_union_2_Dynamic {
|
||||
size_t d;
|
||||
struct TestUnion* v;
|
||||
};
|
||||
|
||||
struct TestUnion_dynamic_optional_union_2_DynamicOptional {
|
||||
bool d;
|
||||
struct TestUnion_dynamic_optional_union_2_Dynamic v;
|
||||
};
|
||||
|
||||
struct New {
|
||||
struct Empty_dynamic_struct_Dynamic dynamic_struct;
|
||||
struct int_dynamic_ints_Dynamic dynamic_ints;
|
||||
struct Empty_optional_struct_1_Optional optional_struct_1;
|
||||
struct Empty_optional_struct_2_Optional optional_struct_2;
|
||||
struct int_optional_int_1_Optional optional_int_1;
|
||||
struct int_optional_int_2_Optional optional_int_2;
|
||||
struct char_optional_string_1_Optional optional_string_1;
|
||||
struct char_optional_string_2_Optional optional_string_2;
|
||||
struct Empty_optional_struct_array_1_ArrayOptional optional_struct_array_1;
|
||||
struct Empty_optional_struct_array_2_ArrayOptional optional_struct_array_2;
|
||||
struct int_optional_int_array_1_ArrayOptional optional_int_array_1;
|
||||
struct int_optional_int_array_2_ArrayOptional optional_int_array_2;
|
||||
struct Empty_dynamic_optional_struct_1_DynamicOptional dynamic_optional_struct_1;
|
||||
struct Empty_dynamic_optional_struct_2_DynamicOptional dynamic_optional_struct_2;
|
||||
struct int_dynamic_optional_int_1_DynamicOptional dynamic_optional_int_1;
|
||||
struct int_dynamic_optional_int_2_DynamicOptional dynamic_optional_int_2;
|
||||
struct TestUnion* union_test_pointer;
|
||||
struct TestUnion union_test;
|
||||
struct TestUnion_optional_union_1_Optional optional_union_1;
|
||||
struct TestUnion_optional_union_pointer_1_Optional optional_union_pointer_1;
|
||||
struct TestUnion_optional_union_2_Optional optional_union_2;
|
||||
struct TestUnion_dynamic_optional_union_1_DynamicOptional dynamic_optional_union_1;
|
||||
struct TestUnion_dynamic_optional_union_2_DynamicOptional dynamic_optional_union_2;
|
||||
};
|
||||
|
||||
enum SomeEnum {
|
||||
SomeEnum_Zero = 0,
|
||||
SomeEnum_One = 1,
|
||||
SomeEnum_Two = 2,
|
||||
SomeEnum_Three = 3,
|
||||
};
|
||||
|
||||
typedef enum SomeEnum SomeEnum;
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
48
openair3/SS/Sidl/sidl/api/SIDL_VIRTUAL_TIME_PORT.h
Normal file
48
openair3/SS/Sidl/sidl/api/SIDL_VIRTUAL_TIME_PORT.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
struct VirtualTimeInfo_Type {
|
||||
bool Enable;
|
||||
struct SubFrameTiming_Type TimingInfo;
|
||||
};
|
||||
|
||||
SIDL_END_C_INTERFACE
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user