Commit bddb9458 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/384-obsolete-files-to-delete' into...

Merge remote-tracking branch 'origin/384-obsolete-files-to-delete' into develop_integration_2019_w03
parents fd971839 824f98b1
......@@ -183,7 +183,6 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU
#########################
# set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files
add_definitions(-DCMAKER)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2")
......@@ -2154,7 +2153,6 @@ add_executable(test_epc_generate_scenario
${OPENAIR2_DIR}/ENB_APP/enb_config.h
${OPENAIR2_DIR}/COMMON/commonDef.h
${OPENAIR2_DIR}/COMMON/messages_def.h
${OPENAIR2_DIR}/COMMON/messages_types.h
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
)
target_link_libraries (test_epc_generate_scenario
......@@ -2174,7 +2172,6 @@ add_executable(test_epc_play_scenario
${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h
${OPENAIR2_DIR}/COMMON/commonDef.h
${OPENAIR2_DIR}/COMMON/messages_def.h
${OPENAIR2_DIR}/COMMON/messages_types.h
)
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
target_link_libraries (test_epc_play_scenario
......
......@@ -76,7 +76,6 @@ macro(add_boolean_option name val helpstr)
endmacro(add_boolean_option)
# compilation flags
# added CMAKER conditional compilation to not bother legacy building system
#############################################
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
......@@ -84,7 +83,7 @@ endif()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release RelWithDebInfo MinSizeRel)
#
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -DCMAKER")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat ")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb -DMALLOC_CHECK_=3 -O2")
......
......@@ -19,7 +19,7 @@ T_IDs.h: $(GENIDS) T_messages.txt
./$(GENIDS) T_messages.txt T_IDs.h
check_vcd:
gcc -Wall -I. -I.. -I../itti -Itracer -o _check_vcd check_vcd.c tracer/database.c tracer/utils.c -lm -pthread
gcc -Wall -I. -I.. -I../itti -I../../../openair2/COMMON -Itracer -o _check_vcd check_vcd.c tracer/database.c tracer/utils.c -lm -pthread
./_check_vcd || (rm -f ./_check_vcd ./T_IDs.h ./T_messages.txt.h && false)
rm -f ./_check_vcd
......
......@@ -22,9 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#ifdef CMAKER
#include <platform_types.h>
#endif
#if defined(ENB_MODE)
# define display_backtrace()
......
#ifndef _TIME_UTILS_H_
#define _TIME_UTILS_H_
#include <time.h>
#include <stdint.h>
static inline int64_t clock_difftime_ns(struct timespec start, struct timespec end)
{
struct timespec temp;
int64_t temp_ns;
if ((end.tv_nsec-start.tv_nsec)<0) {
temp.tv_sec = end.tv_sec-start.tv_sec-1;
temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
} else {
temp.tv_sec = end.tv_sec-start.tv_sec;
temp.tv_nsec = end.tv_nsec-start.tv_nsec;
}
temp_ns = (int64_t)(temp.tv_sec) * (int64_t)1000000000 + (temp.tv_nsec);
return temp_ns;
}
#endif /* _TIME_UTILS_H_ */
/*
* 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
*/
unsigned char scrambling_sequence[1024] = {
208,
127,
52,
95,
204,
135,
48,
31,
248,
32,
208,
135,
192,
232,
63,
175,
4,
212,
119,
24,
169,
162,
101,
144,
75,
109,
75,
29,
91,
191,
165,
246,
177,
71,
16,
92,
68,
80,
132,
4,
248,
251,
32,
65,
125,
56,
94,
86,
152,
11,
201,
134,
39,
250,
19,
162,
25,
190,
62,
3,
190,
18,
188,
215,
97,
239,
72,
11,
0,
26,
57,
211,
146,
37,
205,
121,
204,
83,
13,
206,
53,
27,
214,
32,
54,
214,
82,
125,
226,
108,
169,
102,
247,
255,
32,
171,
201,
112,
20,
253,
65,
192,
38,
78,
114,
40,
95,
32,
70,
194,
242,
153,
207,
63,
61,
117,
122,
32,
73,
60,
160,
140,
99,
235,
118,
176,
75,
102,
254,
5,
67,
194,
122,
62,
226,
56,
69,
123,
213,
179,
119,
221,
23,
63,
26,
160,
233,
166,
179,
243,
169,
190,
183,
146,
169,
185,
216,
214,
158,
86,
139,
214,
143,
181,
0,
9,
147,
254,
105,
138,
213,
118,
14,
74,
153,
110,
41,
47,
172,
91,
216,
117,
156,
62,
56,
75,
113,
6,
123,
178,
118,
97,
82,
75,
96,
21,
148,
170,
120,
227,
0,
245,
25,
147,
243,
185,
203,
135,
48,
104,
89,
38,
71,
30,
74,
219,
130,
107,
75,
244,
138,
8,
8,
248,
175,
65,
234,
35,
125,
138,
0,
95,
23,
171,
177,
166,
196,
173,
235,
244,
124,
20,
22,
78,
32,
207,
173,
103,
232,
84,
18,
227,
246,
127,
136,
28,
188,
39,
132,
79,
14,
62,
80,
248,
171,
21,
160,
188,
110,
125,
55,
198,
139,
185,
28,
127,
239,
246,
223,
47,
55,
63,
63,
129,
253,
175,
122,
182,
139,
52,
163,
164,
177,
6,
187,
220,
159,
76,
36,
164,
108,
218,
189,
250,
148,
201,
45,
207,
174,
81,
195,
108,
96,
203,
132,
210,
34,
142,
247,
238,
139,
84,
84,
194,
168,
46,
9,
238,
29,
135,
115,
95,
12,
218,
18,
134,
110,
83,
110,
44,
80,
80,
216,
126,
160,
65,
142,
142,
209,
69,
234,
200,
184,
171,
248,
185,
148,
203,
90,
143,
231,
29,
47,
214,
151,
154,
137,
152,
228,
192,
182,
108,
200,
226,
204,
82,
170,
110,
197,
143,
169,
230,
75,
204,
177,
222,
142,
1,
104,
130,
224,
201,
29,
223,
246,
132,
173,
42,
33,
165,
147,
208,
124,
208,
198,
51,
78,
76,
216,
164,
250,
186,
214,
57,
52,
52,
199,
37,
3,
242,
120,
179,
26,
233,
51,
42,
11,
108,
26,
41,
192,
41,
221,
71,
16,
67,
131,
90,
226,
181,
0,
244,
183,
31,
78,
241,
221,
173,
248,
146,
23,
244,
102,
194,
201,
16,
25,
155,
110,
146,
54,
246,
40,
5,
78,
94,
47,
135,
60,
103,
29,
175,
142,
9,
213,
70,
159,
168,
176,
217,
91,
13,
1,
254,
104,
135,
20,
135,
147,
23,
141,
8,
115,
180,
201,
50,
246,
4,
12,
72,
59,
166,
22,
61,
77,
140,
183,
150,
255,
55,
31,
71,
215,
83,
75,
169,
137,
104,
237,
88,
118,
146,
247,
95,
182,
241,
29,
98,
243,
152,
52,
230,
114,
27,
247,
116,
78,
152,
202,
96,
15,
112,
196,
245,
148,
9,
228,
111,
131,
179,
198,
243,
35,
140,
234,
248,
8,
197,
218,
35,
246,
172,
207,
93,
62,
157,
196,
149,
199,
136,
30,
70,
13,
116,
63,
171,
207,
254,
51,
18,
126,
246,
195,
218,
222,
204,
105,
132,
150,
123,
136,
24,
23,
143,
162,
175,
185,
148,
104,
135,
118,
44,
126,
59,
67,
114,
157,
194,
201,
231,
40,
80,
42,
195,
50,
133,
186,
43,
134,
234,
170,
96,
177,
67,
61,
121,
31,
171,
120,
208,
74,
84,
33,
148,
199,
59,
171,
244,
243,
114,
92,
90,
99,
89,
181,
25,
224,
39,
149,
209,
40,
151,
1,
171,
106,
75,
126,
134,
35,
187,
12,
31,
114,
240,
229,
182,
48,
86,
192,
247,
109,
78,
111,
74,
207,
72,
232,
177,
126,
167,
213,
139,
124,
122,
18,
108,
35,
213,
86,
218,
226,
143,
169,
11,
165,
137,
241,
146,
115,
208,
178,
197,
0,
119,
147,
29,
144,
167,
236,
133,
233,
23,
140,
30,
186,
159,
76,
6,
150,
13,
72,
34,
240,
114,
192,
238,
72,
42,
177,
15,
33,
162,
170,
167,
64,
169,
78,
162,
226,
229,
191,
209,
140,
213,
161,
23,
147,
249,
103,
56,
153,
108,
105,
148,
177,
245,
168,
201,
101,
103,
5,
104,
90,
171,
155,
153,
121,
130,
35,
112,
242,
140,
206,
125,
225,
79,
154,
161,
143,
71,
45,
145,
15,
95,
105,
202,
158,
11,
119,
124,
66,
60,
86,
118,
120,
101,
209,
58,
211,
184,
42,
142,
66,
201,
147,
149,
26,
213,
168,
108,
93,
237,
168,
152,
128,
44,
87,
140,
248,
218,
189,
93,
25,
76,
249,
103,
187,
167,
31,
194,
133,
247,
148,
20,
169,
141,
166,
118,
102,
208,
187,
177,
71,
70,
182,
55,
205,
174,
20,
234,
146,
78,
115,
199,
104,
89,
254,
232,
246,
208,
127,
242,
221,
200,
198,
66,
153,
12,
25,
184,
78,
203,
45,
233,
51,
253,
169,
30,
5,
65,
188,
226,
167,
236,
17,
173,
193,
123,
249,
117,
107,
140,
56,
91,
180,
19,
79,
5,
204,
185,
109,
37,
187,
147,
197,
58,
100,
40,
11,
22,
248,
236,
189,
218,
3,
109,
243,
153,
247,
142,
35,
59,
228,
102,
130,
141,
200,
201,
101,
139,
129,
21,
246,
111,
143,
95,
249,
7,
196,
85,
133,
175,
59,
130,
214,
255,
36,
49,
209,
144,
168,
20,
126,
19,
198,
119,
221,
229,
245,
173,
218,
244,
14,
53,
221,
252,
107,
213,
65,
129,
23,
187,
196,
118,
77,
205,
9,
75,
179,
23,
176,
49,
41,
84,
163,
182,
156,
167,
247,
95,
212,
43,
183,
152,
63,
252,
67,
21,
224,
128,
201,
251,
136,
117,
214,
96,
226,
157,
79,
154,
98,
120,
65,
134,
130,
138,
197,
64,
171,
85,
144,
120,
179,
180
};
/*
* 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
*/
/*
* 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
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "PHY/types.h"
#include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "openair2/LAYER2/MAC/mac_proto.h"
#define DEBUG_PHY
// Adjust location synchronization point to account for drift
// The adjustment is performed once per frame based on the
// last channel estimate of the receiver
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
PHY_VARS_UE *ue,
module_id_t eNB_id,
uint8_t subframe,
unsigned char clear,
short coef)
{
static int max_pos_fil = 0;
static int count_max_pos_ok = 0;
static int first_time = 1;
int temp = 0, i, aa, max_val = 0, max_pos = 0;
int diff;
short Re,Im,ncoef;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_IN);
ncoef = 32767 - coef;
#ifdef DEBUG_PHY
LOG_D(PHY,"AbsSubframe %d.%d: rx_offset (before) = %d\n",ue->proc.proc_rxtx[0].frame_rx%1024,subframe,ue->rx_offset);
#endif //DEBUG_PHY
// we only use channel estimates from tx antenna 0 here
for (i = 0; i < frame_parms->nb_prefix_samples; i++) {
temp = 0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
Re = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[(i<<1)];
Im = ((int16_t*)ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id][aa])[1+(i<<1)];
temp += (Re*Re/2) + (Im*Im/2);
}
if (temp > max_val) {
max_pos = i;
max_val = temp;
}
}
// filter position to reduce jitter
if (clear == 1)
max_pos_fil = max_pos;
else
max_pos_fil = ((max_pos_fil * coef) + (max_pos * ncoef)) >> 15;
// do not filter to have proactive timing adjustment
max_pos_fil = max_pos;
if(subframe == 5)
{
diff = max_pos_fil - (frame_parms->nb_prefix_samples>>3);
#if BASIC_SIMULATOR
/* a hack without which the UE does not connect (to be fixed somehow) */
diff = 0;
#endif
if ( abs(diff) < SYNCH_HYST )
ue->rx_offset = 0;
else
ue->rx_offset = diff;
if(abs(diff)<5)
count_max_pos_ok ++;
else
count_max_pos_ok = 0;
if(count_max_pos_ok > 10 && first_time == 1)
{
first_time = 0;
ue->time_sync_cell = 1;
if (ue->mac_enabled==1) {
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id);
//mac_resynch();
dl_phy_sync_success(ue->Mod_id,ue->proc.proc_rxtx[0].frame_rx,0,1);//ue->common_vars.eNb_id);
ue->UE_mode[0] = PRACH;
}
else {
ue->UE_mode[0] = PUSCH;
}
}
if ( ue->rx_offset < 0 )
ue->rx_offset += FRAME_LENGTH_COMPLEX_SAMPLES;
if ( ue->rx_offset >= FRAME_LENGTH_COMPLEX_SAMPLES )
ue->rx_offset -= FRAME_LENGTH_COMPLEX_SAMPLES;
#ifdef DEBUG_PHY
LOG_D(PHY,"AbsSubframe %d.%d: ThreadId %d diff =%i rx_offset (final) = %i : clear %d,max_pos = %d,max_pos_fil = %d (peak %d) max_val %d target_pos %d \n",
ue->proc.proc_rxtx[ue->current_thread_id[subframe]].frame_rx,
subframe,
ue->current_thread_id[subframe],
diff,
ue->rx_offset,
clear,
max_pos,
max_pos_fil,
temp,max_val,
(frame_parms->nb_prefix_samples>>3));
#endif //DEBUG_PHY
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT);
}
}
/*
* 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
*/
/*
* 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
*/
#define modOrder(I_MCS,I_TBS) ((I_MCS-I_TBS)*2+2) // Find modulation order from I_TBS and I_MCS
/** \fn unsigned char I_TBS2I_MCS(unsigned char I_TBS);
\brief This function maps I_tbs to I_mcs according to Table 7.1.7.1-1 in 3GPP TS 36.213 V8.6.0. Where there is two supported modulation orders for the same I_TBS then either high or low modulation is chosen by changing the equality of the two first comparisons in the if-else statement.
\param I_TBS Index of Transport Block Size
\return I_MCS given I_TBS
*/
unsigned char I_TBS2I_MCS(unsigned char I_TBS);
/** \fn unsigned char SE2I_TBS(float SE,
unsigned char N_PRB,
unsigned char symbPerRB);
\brief This function maps a requested throughput in number of bits to I_tbs. The throughput is calculated as a function of modulation order, RB allocation and number of symbols per RB. The mapping orginates in the "Transport block size table" (Table 7.1.7.2.1-1 in 3GPP TS 36.213 V8.6.0)
\param SE Spectral Efficiency (before casting to integer, multiply by 1024, remember to divide result by 1024!)
\param N_PRB Number of PhysicalResourceBlocks allocated \sa lte_frame_parms->N_RB_DL
\param symbPerRB Number of symbols per resource block allocated to this channel
\return I_TBS given an SE and an N_PRB
*/
unsigned char SE2I_TBS(float SE,
unsigned char N_PRB,
unsigned char symbPerRB);
......@@ -457,14 +457,6 @@ void generate_pcfich(uint8_t num_pdcch_symbols,
int32_t **txdataF,
uint8_t subframe);
void init_transport_channels(uint8_t);
void rx_ulsch(PHY_VARS_eNB *eNB,
L1_rxtx_proc_t *proc,
uint8_t UE_id);
......
......@@ -1438,8 +1438,6 @@ uint8_t rx_pcfich(LTE_DL_FRAME_PARMS *frame_parms,
void generate_phich_reg_mapping(LTE_DL_FRAME_PARMS *frame_parms);
void init_transport_channels(uint8_t);
void generate_RIV_tables(void);
/*!
......
/*
* 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
*/
int16_t sig625_1_25MHz[2850*2];
int16_t sig625_2_5MHz[5700*2];
int16_t sig625_5MHz[11400*2];
int16_t sig625_10MHz[22800*2];
int16_t sig625_15MHz[34200*2];
int16_t sig625_20MHz[45600*2];
PHY_OBJS = $(TOP_DIR)/PHY/LTE_TRANSPORT/pss.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/sss.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pilots.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pilots_ue_spec.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pilots_mbsfn.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_coding.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_modulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_demodulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_llr_computation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_llr_computation_avx2.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/power_control.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_decoding.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dlsch_scrambling.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dci_tools.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/uci_tools.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/lte_mcs.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pbch.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/dci.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/phich.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pcfich.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pucch.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/prach.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/pmch.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/group_hopping.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/srs_modulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/drs_modulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_modulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_demodulation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_coding.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/ulsch_decoding.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/rar_tools.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/print_stats.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/initial_sync.o
#PHY_OBJS += $(TOP_DIR)/PHY/LTE_TRANSPORT/lte_transport_init.o
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/ofdm_mod.o
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/slot_fep.o
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/slot_fep_mbsfn.o
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/slot_fep_ul.o
PHY_OBJS += $(TOP_DIR)/PHY/MODULATION/ul_7_5_kHz.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/freq_equalization.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_sync_time.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_sync_timefreq.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_adjust_sync.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_dl_bf_channel_estimation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_est_freq_offset.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_ue_measurements.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/lte_eNB_measurements.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_ESTIMATION/adjust_gain.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_dl_cell_spec.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_dl_ue_spec.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_gold.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_gold_mbsfn.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_dl_mbsfn.o
PHY_OBJS += $(TOP_DIR)/PHY/LTE_REFSIG/lte_ul_ref.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/lte_segmentation.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/ccoding_byte.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/ccoding_byte_lte.o
#PHY_OBJS += $(TOP_DIR)/PHY/CODING/3gpplte.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/3gpplte_sse.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/crc_byte.o
#PHY_OBJS += $(TOP_DIR)/PHY/CODING/3gpplte_turbo_decoder_sse.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/lte_rate_matching.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/rate_matching.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/viterbi.o
PHY_OBJS += $(TOP_DIR)/PHY/CODING/viterbi_lte.o
PHY_OBJS += $(TOP_DIR)/PHY/INIT/lte_init.o
PHY_OBJS += $(TOP_DIR)/PHY/INIT/lte_parms.o
PHY_OBJS += $(TOP_DIR)/PHY/INIT/init_top.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/file_output.o
#PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/fft.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/lte_dfts.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/log2_approx.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/cmult_sv.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/cmult_vv.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/cadd_vv.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/cdot_prod.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/signal_energy.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/dB_routines.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/sqrt.o
ifdef SMBV
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/smbv.o
endif
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/time_meas.o
PHY_OBJS += $(TOP_DIR)/PHY/TOOLS/lut.o
#PHY_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/rangen_double.o
SCHED_OBJS = $(TOP_DIR)/SCHED/phy_procedures_lte_common.o
SCHED_OBJS += $(TOP_DIR)/SCHED/phy_procedures_lte_ue.o
SCHED_OBJS += $(TOP_DIR)/SCHED/phy_procedures_lte_eNb.o
SCHED_OBJS += $(TOP_DIR)/SCHED/pusch_pc.o
SCHED_OBJS += $(TOP_DIR)/SCHED/pucch_pc.o
SCHED_OBJS += $(TOP_DIR)/SCHED/srs_pc.o
......@@ -4783,7 +4783,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u
if (msg_p != NULL) {
switch (ITTI_MSG_ID(msg_p)) {
case PHY_FIND_CELL_REQ:
LOG_I(PHY, "[UE %d] Received %s\n", ITTI_MSG_INSTANCE (msg_p) - NB_eNB_INST, ITTI_MSG_NAME (msg_p));
LOG_E(PHY, "[UE %d] Received PLMN doesn't match SIM data, but not developped further processing %s\n", ITTI_MSG_INSTANCE (msg_p) - NB_eNB_INST, ITTI_MSG_NAME (msg_p));
/* TODO process the message */
break;
......
/*
* 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
*/
/*
* intertask_interface_conf.h
*
* Created on: Oct 21, 2013
* Author: winckel
*/
#ifndef INTERTASK_INTERFACE_CONF_H_
#define INTERTASK_INTERFACE_CONF_H_
/*******************************************************************************
* Intertask Interface Constants
******************************************************************************/
#define ITTI_PORT (10006)
/* This is the queue size for signal dumper */
#define ITTI_QUEUE_MAX_ELEMENTS (10 * 1000)
#define ITTI_DUMP_MAX_CON (5) /* Max connections in parallel */
#endif /* INTERTASK_INTERFACE_CONF_H_ */
/*
* 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
*/
/*
* messages_types.h
*
* Created on: Oct 14, 2013
* Author: winckel
*/
#ifndef MESSAGES_TYPES_H_
#define MESSAGES_TYPES_H_
#include "intertask_messages_types.h"
#include "timer_messages_types.h"
#include "phy_messages_types.h"
#include "mac_messages_types.h"
#include "rlc_messages_types.h"
#include "pdcp_messages_types.h"
#include "rrc_messages_types.h"
#include "nas_messages_types.h"
#if ENABLE_RAL
#include "ral_messages_types.h"
#endif
#include "s1ap_messages_types.h"
#include "x2ap_messages_types.h"
#include "sctp_messages_types.h"
#include "udp_messages_types.h"
#include "gtpv1_u_messages_types.h"
#endif /* MESSAGES_TYPES_H_ */
......@@ -28,11 +28,7 @@
***************************************************************************/
#ifdef CMAKER
#include "LTE_asn_constant.h"
#else
#include "RRC/LTE/MESSAGES/asn1_constants.h"
#endif
#ifndef __PLATFORM_CONSTANTS_H__
# define __PLATFORM_CONSTANTS_H__
......
......@@ -32,11 +32,7 @@
#include "as_message.h"
#include "rrc_types.h"
#include "s1ap_messages_types.h"
#ifdef CMAKER
#include "LTE_SystemInformationBlockType2.h"
#else
#include "RRC/LTE/MESSAGES/LTE_SystemInformationBlockType2.h"
#endif
#include "LTE_SL-OffsetIndicator-r12.h"
#include "LTE_SubframeBitmapSL-r12.h"
#include "LTE_SL-CP-Len-r12.h"
......
ENB_APP_DIR = $(OPENAIR2_TOP)/ENB_APP
ENB_APP_OBJS = $(ENB_APP_DIR)/enb_app.o \
$(ENB_APP_DIR)/enb_config.o
ENB_APP_incl = \
-I$(ENB_APP_DIR) -I$(OPENAIR2_TOP)
......@@ -40,12 +40,8 @@
#include "PHY/impl_defs_lte.h"
#include "PHY/defs_eNB.h"
#include "s1ap_messages_types.h"
#ifdef CMAKER
#include "LTE_SystemInformationBlockType2.h"
#include "rrc_messages_types.h"
#else
#include "RRC/LTE/MESSAGES/LTE_SystemInformationBlockType2.h"
#endif
#include "RRC/LTE/rrc_defs.h"
#include <intertask_interface.h>
......
/*
* 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
*/
#define UL_RB_ALLOC mac_xface->computeRIV(mac_xface->frame_parms->N_RB_UL,0,24)
#define BCCH_RB_ALLOC mac_xface->computeRIV(mac_xface->frame_parms->N_RB_UL,0,4)
#define RA_RB_ALLOC mac_xface->computeRIV(mac_xface->frame_parms->N_RB_UL,0,4)
#define DLSCH_RB_ALLOC 0x1fff
#include "extern.h"
void init_transport_channels(unsigned char transmission_mode)
{
// init DCI structures for testing
UL_alloc_pdu.type = 0;
UL_alloc_pdu.hopping = 0;
UL_alloc_pdu.rballoc = UL_RB_ALLOC;
UL_alloc_pdu.mcs = 2;
UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.TPC = 0;
UL_alloc_pdu.cqi_req = 1;
/*
BCCH_alloc_pdu.type = 1;
BCCH_alloc_pdu.vrb_type = 0;
BCCH_alloc_pdu.rballoc = BCCH_RB_ALLOC;
BCCH_alloc_pdu.ndi = 1;
BCCH_alloc_pdu.rv = 1;
BCCH_alloc_pdu.mcs = 1;
BCCH_alloc_pdu.harq_pid = 0;
BCCH_alloc_pdu.TPC = 1; // set to 3 PRB
// for FDD mode
BCCH_alloc_pdu_fdd.type = 1;
BCCH_alloc_pdu_fdd.vrb_type = 0;
BCCH_alloc_pdu_fdd.rballoc = BCCH_RB_ALLOC;
BCCH_alloc_pdu_fdd.ndi = 1;
BCCH_alloc_pdu_fdd.rv = 1;
BCCH_alloc_pdu_fdd.mcs = 1;
BCCH_alloc_pdu_fdd.harq_pid = 0;
BCCH_alloc_pdu_fdd.TPC = 1; // set to 3 PRB
*/
DLSCH_alloc_pdu1A.type = 1;
DLSCH_alloc_pdu1A.vrb_type = 0;
DLSCH_alloc_pdu1A.rballoc = BCCH_RB_ALLOC;
DLSCH_alloc_pdu1A.ndi = 1;
DLSCH_alloc_pdu1A.rv = 1;
DLSCH_alloc_pdu1A.mcs = 2;
DLSCH_alloc_pdu1A.harq_pid = 0;
DLSCH_alloc_pdu1A.TPC = 1; // set to 3 PRB
DLSCH_alloc_pdu1A_fdd.type = 1;
DLSCH_alloc_pdu1A_fdd.vrb_type = 0;
DLSCH_alloc_pdu1A_fdd.rballoc = BCCH_RB_ALLOC;
DLSCH_alloc_pdu1A_fdd.ndi = 1;
DLSCH_alloc_pdu1A_fdd.rv = 1;
DLSCH_alloc_pdu1A_fdd.mcs = 2;
DLSCH_alloc_pdu1A_fdd.harq_pid = 0;
DLSCH_alloc_pdu1A_fdd.TPC = 1; // set to 3 PRB
RA_alloc_pdu.type = 1;
RA_alloc_pdu.vrb_type = 0;
RA_alloc_pdu.rballoc = RA_RB_ALLOC;
RA_alloc_pdu.ndi = 1;
RA_alloc_pdu.rv = 0;
RA_alloc_pdu.mcs = 0;
RA_alloc_pdu.harq_pid = 0;
RA_alloc_pdu.TPC = 1;
RA_alloc_pdu_fdd.type = 1;
RA_alloc_pdu_fdd.vrb_type = 0;
RA_alloc_pdu_fdd.rballoc = RA_RB_ALLOC;
RA_alloc_pdu_fdd.ndi = 1;
RA_alloc_pdu_fdd.rv = 1;
RA_alloc_pdu_fdd.mcs = 1;
RA_alloc_pdu_fdd.harq_pid = 0;
RA_alloc_pdu_fdd.TPC = 1;
DLSCH_alloc_pdu1.rballoc = 0xf;
DLSCH_alloc_pdu1.TPC = 0;
DLSCH_alloc_pdu1.dai = 0;
DLSCH_alloc_pdu1.harq_pid = 0;
DLSCH_alloc_pdu1.tb_swap = 0;
DLSCH_alloc_pdu1.mcs1 = 4;
DLSCH_alloc_pdu1.ndi1 = 1;
DLSCH_alloc_pdu1.rv1 = 0;
// Forget second codeword
if (transmission_mode == 6) {
DLSCH_alloc_pdu1.tpmi = 5; // PUSCH_PRECODING0
} else {
DLSCH_alloc_pdu1.tpmi = 0;
}
DLSCH_alloc_pdu2.rah = 0;
DLSCH_alloc_pdu2.rballoc = DLSCH_RB_ALLOC;
DLSCH_alloc_pdu2.TPC = 0;
DLSCH_alloc_pdu2.dai = 0;
DLSCH_alloc_pdu2.harq_pid = 0;
DLSCH_alloc_pdu2.tb_swap = 0;
DLSCH_alloc_pdu2.mcs1 = 4;
DLSCH_alloc_pdu2.ndi1 = 1;
DLSCH_alloc_pdu2.rv1 = 0;
// Forget second codeword
if (transmission_mode == 6) {
DLSCH_alloc_pdu2.tpmi = 5; // PUSCH_PRECODING0
} else {
DLSCH_alloc_pdu2.tpmi = 0;
}
}
ifeq ($(OPENAIR2),1)
EXTRA_CFLAGS += -DOPENAIR2
endif
EXTRA_CFLAGS += -DASSERT
EXTRA_CFLAGS += -DNO_RRM
COMMON_DIR = $(OPENAIR2_TOP)/COMMON
L2_INTERFACE_DIR = $(OPENAIR2_TOP)/RRC/L2_INTERFACE
RLC_UM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/UM_v9.3.0
RLC_AM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/AM_v9.3.0
RLC_TM_DIR = $(OPENAIR2_TOP)/LAYER2/RLC/TM_v9.3.0
RLC_DIR = $(OPENAIR2_TOP)/LAYER2/RLC
PDCP_DIR = $(OPENAIR2_TOP)/LAYER2/PDCP_v10.1.0
PHY_INTERFACE_DIR = $(OPENAIR2_TOP)/PHY_INTERFACE
RRC_DIR = $(OPENAIR2_TOP)/RRC/LITE
L2_INTERFACE_DIR = $(OPENAIR2_TOP)/RRC/L2_INTERFACE
MAC_DIR = $(OPENAIR2_TOP)/LAYER2/MAC
RRC_CELL_DIR = $(OPENAIR2_TOP)/RRC/CELLULAR
SOURCES_L2 += $(OPENAIR2_TOP)/LAYER2/openair2_proc.c
SOURCES_L2 += $(PDCP_DIR)/pdcp.c
SOURCES_L2 += $(PDCP_DIR)/pdcp_fifo.c
SOURCES_L2 += $(PDCP_DIR)/pdcp_sequence_manager.c
SOURCES_L2 += $(PDCP_DIR)/pdcp_primitives.c
SOURCES_L2 += $(PDCP_DIR)/pdcp_util.c
SOURCES_L2 += $(PDCP_DIR)/pdcp_security.c
SOURCES_L2 += $(PDCP_DIR)/pdcp_netlink.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_init.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_timer_poll_retransmit.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_timer_reordering.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_timer_status_prohibit.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_segment.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_segments_holes.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_in_sdu.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_receiver.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_retransmit.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_windows.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_rx_list.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_reassembly.c
SOURCES_L2 += $(RLC_AM_DIR)/rlc_am_status_report.c
SOURCES_L2 += $(RLC_TM_DIR)/rlc_tm.c
SOURCES_L2 += $(RLC_TM_DIR)/rlc_tm_init.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_fsm.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_control_primitives.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_segment.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_reassembly.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_receiver.c
SOURCES_L2 += $(RLC_UM_DIR)/rlc_um_dar.c
SOURCES_L2 += $(RLC_DIR)/rlc_mac.c
SOURCES_L2 += $(RLC_DIR)/rlc.c
SOURCES_L2 += $(RLC_DIR)/rlc_rrc.c
SOURCES_L2 += $(RLC_DIR)/rlc_mpls.c
RRC_OBJS = $(RRC_DIR)/rrc_UE.o
ifeq ($(ENABLE_RAL),1)
RRC_OBJS += $(RRC_DIR)/rrc_UE_ral.o
RRC_OBJS += $(RRC_DIR)/rrc_eNB_ral.o
endif
RRC_OBJS += $(RRC_DIR)/rrc_eNB.o
RRC_OBJS += $(RRC_DIR)/rrc_eNB_UE_context.o
RRC_OBJS += $(RRC_DIR)/rrc_eNB_S1AP.o
ifdef USE_MME
RRC_OBJS += $(RRC_DIR)/rrc_eNB_GTPV1U.o
endif
RRC_OBJS += $(RRC_DIR)/rrc_common.o
RRC_OBJS += $(RRC_DIR)/L2_interface.o
MAC_OBJS = $(MAC_DIR)/lte_transport_init.o
MAC_OBJS += $(MAC_DIR)/main.o
MAC_OBJS += $(MAC_DIR)/ue_procedures.o
MAC_OBJS += $(MAC_DIR)/ra_procedures.o
MAC_OBJS += $(MAC_DIR)/l1_helpers.o
MAC_OBJS += $(MAC_DIR)/rar_tools.o
MAC_OBJS += $(MAC_DIR)/eNB_scheduler.o
MAC_OBJS += $(MAC_DIR)/eNB_scheduler_dlsch.o
MAC_OBJS += $(MAC_DIR)/eNB_scheduler_ulsch.o
MAC_OBJS += $(MAC_DIR)/eNB_scheduler_mch.o
MAC_OBJS += $(MAC_DIR)/eNB_scheduler_bch.o
MAC_OBJS += $(MAC_DIR)/eNB_scheduler_primitives.o
MAC_OBJS += $(MAC_DIR)/eNB_scheduler_RA.o
MAC_OBJS += $(MAC_DIR)/pre_processor.o
MAC_OBJS += $(MAC_DIR)/config.o
L2_INTERFACE_OBJS = $(L2_INTERFACE_DIR)/openair_rrc_L2_interface.o
L2_OBJS=$(addsuffix .o,$(basename $(SOURCES_L2))) $(PHY_INTERFACE_OBJS) $(MAC_OBJS) $(L2_INTERFACE_OBJS)
L2_incl = -I$(OPENAIR2_TOP)
L2_incl = -I$(OPENAIR_DIR)/common/utils/msc
L2_incl += -I$(COMMON_DIR)
L2_incl += -I$(RLC_DIR)
L2_incl += -I$(RLC_AM_DIR)
L2_incl += -I$(RLC_UM_DIR)
L2_incl += -I$(RLC_TM_DIR)
L2_incl += -I$(PDCP_DIR)
L2_incl += -I$(OPENAIR3)/MESH
L2_incl += -I$(OPENAIR2_TOP)/RRC/LITE/MESSAGES
L2_incl += -I$(OPENAIR3)/MESH/RRM
ifeq ($(rrc_cellular),1)
include $(RRC_CELL_DIR)/Makefile.inc
L2_OBJS += $(RRC_CELLULAR_OBJS)
L2_incl += -I$(OPENAIR2_TOP)/RRC/CELLULAR
EXTRA_CFLAGS += -DRRC_CELLULAR -DCELLULAR
else
L2_OBJS += $(RRC_OBJS)
L2_incl += -I$(OPENAIR2_TOP)/RRC/LITE
endif
/*
* 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
*/
CFLAGS += -I$(RLC_DIR)
CFLAGS += -I$(RLC_UM_DIR)
CFLAGS += -I$(RLC_AM_DIR)
CFLAGS += -I$(COMMON_DIR)
CFLAGS += -I$(TRACE_DIR)
CFLAGS += -I$(LISTS_DIR)
CFLAGS += -I$(MEM_DIR)
DEBUG_FLAGS += -O2
OBJ = rlc_um.o rlc_um_segment.o
############################################################
#
# The following should be identical in all Makefiles
#
#define the target object files
ifdef TARGETDIR
TARGETOBJ = $(addprefix ${TARGETDIR}/, ${OBJ})
TARGETLIB = ${TARGETDIR}/Lib.a
endif
include $(TARGETOBJ:.o=.d)
# Look for source files in the parent directory
%.o: ../%.c %.d
$(CCC) -c ${DEBUG_FLAGS} ${CFLAGS} ${INCLUDE} -o $@ $<
# Rule to remake and keep the .d dependency Makefiles
# Note that the sed command includes adding the TARGETDIR
# and that ! is used for s delimiter
%.d: ../%.c
$(SHELL) -ec '$(CCC) -MM $(CFLAGS) $< \
| sed '\''s!\($(*F)\)\.o[ :]*!$(TARGETDIR)/\1.o $@ : !g'\'' > $@ ;\
[ -s $@ ] || rm -f $@'
.PRECIOUS: %.d
all: ${TARGETLIB}
${TARGETLIB}: ${TARGETOBJ}
ar -rv ${TARGETLIB} ${TARGETOBJ}
clean:
rm -f ${TARGETDIR}/*.o ${TARGETDIR}/*.a
clean_dep:
rm -f ${TARGETDIR}/*.d
/*
* 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
*/
/*________________________rrc_register.h________________________
Authors : Hicham Anouar, Raymond Knopp
Company : EURECOM
Emails : anouar@eurecom.fr, knopp@eurecom.fr
________________________________________________________________*/
#ifndef __MAC_RRC_REGISTER_H__
# define __MAC_RRC_REGISTER_H__
#include "COMMON/mac_rrc_primitives.h"
/** @defgroup _mac_impl_register RRC Registration interface
* @ingroup _mac_impl_
*@{
*/
MAC_RLC_XFACE* mac_rrc_register(RRC_XFACE* RRC_xface);
int mac_rrc_unregister(RRC_XFACE *RRC_xface);
#endif
current_release_asn1_module=$(strip $(notdir $(wildcard $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-*)))
ifdef CBA
COMMON_CFLAGS += -DRel10
COMMON_CFLAGS += -DCBA
ifneq ($(current_release_asn1_module), .lock-rel10-cba)
tmp3:=$(shell cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES ;\
rm -f ${ASN_MODULE_SOURCES} $(ASN_MODULE_HEADERS) *.o *.d ;\
cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/ ;\
rm EUTRA-RRC-Definitions.asn ;\
ln -s EUTRA-RRC-Definitions-a20-lola.asn EUTRA-RRC-Definitions.asn ; \
cd $(OPENAIR_TARGETS)/SIMU/USER/ ;\
rm -f $(ASN1_MSG_OBJS1) ;\
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc.generated ;\
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.am.sample ;\
rm -f $(L2_OBJS) ;\
rm -f *.o ;\
rm -f oaisim ;\
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-* ;\
touch $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel10-cba ;\
/bin/bash $(OPENAIR_TARGETS)/SCRIPTS/asn1_generate_rrc_messaging_c_code.bash ;\
cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES ;\
awk '/converter-sample.c/ {exit} // {print}' Makefile.am.sample > Makefile.inc.generated )
endif
else ifdef Rel10
COMMON_CFLAGS += -DRel10
ifneq ($(current_release_asn1_module), .lock-rel10)
tmp3:=$(shell cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES ;\
rm -f ${ASN_MODULE_SOURCES} $(ASN_MODULE_HEADERS) *.o *.d ;\
cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/ ;\
rm EUTRA-RRC-Definitions.asn ;\
ln -s EUTRA-RRC-Definitions-a20.asn EUTRA-RRC-Definitions.asn ;\
cd $(OPENAIR_TARGETS)/SIMU/USER/ ;\
rm -f $(ASN1_MSG_OBJS1) ;\
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc.generated ;\
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.am.sample ;\
rm -f $(L2_OBJS) ;\
rm -f *.o ;\
rm -f oaisim ;\
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-* ;\
touch $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel10 ;\
/bin/bash $(OPENAIR_TARGETS)/SCRIPTS/asn1_generate_rrc_messaging_c_code.bash ;\
cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES ;\
awk '/converter-sample.c/ {exit} // {print}' Makefile.am.sample > Makefile.inc.generated )
endif
else # default is rel 8
COMMON_CFLAGS += -DRel8
ifneq ($(current_release_asn1_module), .lock-rel8)
tmp3:=$(shell cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES ;\
rm -f ${ASN_MODULE_SOURCES} $(ASN_MODULE_HEADERS) *.o *.d ;\
cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/ ;\
rm EUTRA-RRC-Definitions.asn ;\
ln -s EUTRA-RRC-Definitions-86.asn EUTRA-RRC-Definitions.asn ;\
cd $(OPENAIR_TARGETS)/SIMU/USER/ ;\
rm -f $(ASN1_MSG_OBJS1) ;\
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc.generated ;\
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.am.sample ;\
rm -f $(L2_OBJS);\
rm -f *.o ;\
rm -f oaisim ;\
rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-* ;\
touch $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel8 ;\
/bin/bash $(OPENAIR_TARGETS)/SCRIPTS/asn1_generate_rrc_messaging_c_code.bash ;\
cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES ;\
awk '/converter-sample.c/ {exit} // {print}' Makefile.am.sample > Makefile.inc.generated )
endif
endif
tmp:=$(shell cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES ;\
if [ ! -s Makefile.am.sample ] ; then \
/bin/bash $(OPENAIR_TARGETS)/SCRIPTS/asn1_generate_rrc_messaging_c_code.bash ;\
fi ;\
if [ ! -s Makefile.inc.generated ] ; then \
awk '/converter-sample.c/ {exit} // {print}' Makefile.am.sample > Makefile.inc.generated ;\
fi )
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc.generated
ASN_CONVERTER_SOURCES+=asn1_msg.c
#COMMON_CFLAGS += -DEMIT_ASN_DEBUG=1
EXTRA_CFLAGS += -I. -I$(OPENAIR2_DIR)/RRC/LITE/MESSAGES
ASN1_MODULE_OBJS=${ASN_MODULE_SOURCES:.c=.o}
ASN1_CONVERTER_OBJS=${ASN_CONVERTER_SOURCES:.c=.o}
ASN1_MSG_OBJS=$(ASN1_MODULE_OBJS) $(ASN1_CONVERTER_OBJS)
/*
* 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
*/
/*!
*******************************************************************************
\file rrc_2_rrm_msg.c
\brief data formating for sending message over socket between RRC and RRM
\author BURLOT Pascal
\date 16/07/08
\par Historique:
P.BURLOT 2009-01-20
bug fix (memeory leak)
Macro changed :
RRM_CALLOC() by RRM_CALLOC2() in msg_rrc_sensing_meas_ind()
*******************************************************************************
*/
#ifdef RRC_EMUL
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/un.h>
#include "L3_rrc_defs.h"
#include "rrm_sock.h"
#include "L3_rrc_interface.h"
#include "rrc_rrm_msg.h"
#include "rrm_util.h"
#else
#include "defs.h"
#endif
#ifdef TRACE
//! Macro creant la chaine a partir du nom de la variable
#define STRINGIZER(x) #x
//! Tableau pour le mode trace faisant la translation entre le numero et le nom du message
const char *Str_msg_rrc_rrm[NB_MSG_RRC_RRM] = {
STRINGIZER(RRM_RB_ESTABLISH_REQ ),
STRINGIZER(RRC_RB_ESTABLISH_RESP ),
STRINGIZER(RRC_RB_ESTABLISH_CFM ),
STRINGIZER(RRM_RB_MODIFY_REQ ),
STRINGIZER(RRC_RB_MODIFY_RESP ),
STRINGIZER(RRC_RB_MODIFY_CFM ),
STRINGIZER(RRM_RB_RELEASE_REQ ),
STRINGIZER(RRC_RB_RELEASE_RESP ),
STRINGIZER(RRC_MR_ATTACH_IND ),
STRINGIZER(RRM_SENSING_MEAS_REQ ),
STRINGIZER(RRC_SENSING_MEAS_RESP ),
STRINGIZER(RRC_CX_ESTABLISH_IND ),
STRINGIZER(RRC_PHY_SYNCH_TO_MR_IND ),
STRINGIZER(RRC_PHY_SYNCH_TO_CH_IND ),
STRINGIZER(RRCI_CX_ESTABLISH_RESP ),
STRINGIZER(RRC_SENSING_MEAS_IND ),
STRINGIZER(RRM_SENSING_MEAS_RESP ),
STRINGIZER(RRC_RB_MEAS_IND ),
STRINGIZER(RRM_RB_MEAS_RESP ),
STRINGIZER(RRM_INIT_CH_REQ ),
STRINGIZER(RRCI_INIT_MR_REQ )
} ;
#endif
/*!
*******************************************************************************
\brief This function initialize the message header
\return any return value
*/
static void init_rrc_msg_head(
msg_head_t *msg_head , //!< message header to initialize
Instance_t inst , //!< Instance ID
MSG_RRC_RRM_T msg_type , //!< type of message to initialize
unsigned int size , //!< size of message
Transaction_t Trans_id //!< transaction id associated to this message
)
{
if ( msg_head != NULL ) {
msg_head->start = START_MSG ;
msg_head->msg_type = 0xFF & msg_type ;
msg_head->inst = inst ;
msg_head->Trans_id = Trans_id ;
msg_head->size = size;
}
}
/*!
*******************************************************************************
\brief La fonction formate en un message generique de reponse pour les
fonctions :
- rrc_rb_establish_resp(),rrc_rb_modify_resp(),rrc_rb_modify_resp(),
- rrc_rb_release_resp() et rrc_sensing_meas_resp() .
\return message formate
*/
msg_t mesg;
msg_t *msg_rrc_generic_resp(
Instance_t inst , //!< Instance ID
MSG_RRC_RRM_T msg_type , //!< type of message
Transaction_t Trans_id //!< Transaction ID
)
{
init_rrc_msg_head(&(mesg.head),inst, msg_type, 0 , Trans_id);
mesg.data = NULL ;
return &mesg ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_rb_establish_resp().
\return message formate
*/
msg_t *msg_rrc_rb_establish_resp(
Instance_t inst , //!< Instance ID
Transaction_t Trans_id //!< Transaction ID
)
{
return msg_rrc_generic_resp( inst, RRC_RB_ESTABLISH_RESP, Trans_id) ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_rb_establish_cfm().
\return message formate
*/
rrc_rb_establish_cfm_t P_rb_est_cfm ;//= RRM_CALLOC(rrc_rb_establish_cfm_t , 1 ) ;
msg_t *msg_rrc_rb_establish_cfm(
Instance_t inst , //!< Instance ID
RB_ID Rb_id , //!< Radio Bearer ID used by RRC
RB_TYPE RB_type , //!< Radio Bearer Type
Transaction_t Trans_id //!< Transaction ID
)
{
// msg_t mesg;
init_rrc_msg_head(&(mesg.head),inst,RRC_RB_ESTABLISH_CFM, sizeof( rrc_rb_establish_cfm_t ) ,Trans_id);
P_rb_est_cfm.Rb_id = Rb_id ;
P_rb_est_cfm.RB_type = RB_type ;
mesg.data = (char *) &P_rb_est_cfm ;
return &mesg ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_rb_modify_resp().
\return message formate
*/
msg_t *msg_rrc_rb_modify_resp(
Instance_t inst , //!< Instance ID
Transaction_t Trans_id //!< Transaction ID
)
{
return msg_rrc_generic_resp( inst,RRC_RB_MODIFY_RESP, Trans_id) ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_rb_modify_cfm().
\return message formate
*/
rrc_rb_modify_cfm_t P_rb_md_cfm;
msg_t *msg_rrc_rb_modify_cfm(
Instance_t inst , //!< Instance ID
RB_ID Rb_id , //!< Radio Bearer ID used by RRC
Transaction_t Trans_id //!< Transaction ID
)
{
// msg_t mesg;
init_rrc_msg_head(&(mesg.head),inst,RRC_RB_MODIFY_CFM, sizeof( rrc_rb_modify_cfm_t ) ,Trans_id);
P_rb_md_cfm.Rb_id = Rb_id ;
mesg.data = (char *) &P_rb_md_cfm ;
return &mesg ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_rb_release_resp().
\return message formate
*/
msg_t *msg_rrc_rb_release_resp(
Instance_t inst , //!< Instance ID
Transaction_t Trans_id //!< Transaction ID
)
{
return msg_rrc_generic_resp( inst,RRC_RB_RELEASE_RESP, Trans_id) ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_MR_attach_ind().
\return message formate
*/
rrc_MR_attach_ind_t P_att_ind;
msg_t * msg_rrc_MR_attach_ind(
Instance_t inst , //!< Instance ID
L2_ID L2_id
)
{
// msg_t mesg;
init_rrc_msg_head(&(mesg.head),inst,RRC_MR_ATTACH_IND, sizeof( rrc_MR_attach_ind_t ) ,0);
memcpy( P_att_ind.L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) ) ;
mesg.data = (char *) &P_att_ind ;
return &mesg ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_sensing_meas_resp().
\return message formate
*/
msg_t *msg_rrc_sensing_meas_resp(
Instance_t inst , //!< Instance ID
Transaction_t Trans_id //!< Transaction ID
)
{
return msg_rrc_generic_resp( inst,RRC_SENSING_MEAS_RESP, Trans_id) ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_cx_establish_ind().
\return message formate
*/
rrc_cx_establish_ind_t P_cx_est_ind;
msg_t * msg_rrc_cx_establish_ind(
Instance_t inst , //!< Instance ID
L2_ID L2_id , //!< Layer 2 (MAC) ID
Transaction_t Trans_id , //!< Transaction ID
unsigned char *L3_info , //!< Optional L3 Information
L3_INFO_T L3_info_t , //!< Type of L3 Information
RB_ID DTCH_B_id , //!< RBID of broadcast IP service (MR only)
RB_ID DTCH_id //!< RBID of default IP service (MR only)
)
{
//msg_t mesg;
init_rrc_msg_head(&(mesg.head),inst,RRC_CX_ESTABLISH_IND, sizeof( rrc_cx_establish_ind_t ) ,Trans_id);
memcpy( P_cx_est_ind.L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) ) ;
P_cx_est_ind.DTCH_B_id = DTCH_B_id ;
P_cx_est_ind.DTCH_id = DTCH_id ;
P_cx_est_ind.L3_info_t = L3_info_t ;
if ( L3_info_t == IPv4_ADDR ) {
memcpy( P_cx_est_ind.L3_info, L3_info, 4 );
} else if ( L3_info_t == IPv6_ADDR ) {
memcpy( P_cx_est_ind.L3_info, L3_info, 16 );
}
mesg.data = (char *) &P_cx_est_ind ;
return &mesg ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_phy_synch_to_MR_ind().
\return message formate
*/
rrc_phy_synch_to_MR_ind_t P_snc_mr;
msg_t * msg_rrc_phy_synch_to_MR_ind(
Instance_t inst , //!< Instance ID
L2_ID L2_id
)
{
//msg_t smsg;
init_rrc_msg_head(&(mesg.head),inst,RRC_PHY_SYNCH_TO_MR_IND, sizeof( rrc_phy_synch_to_MR_ind_t ) ,0);
memcpy(&P_snc_mr.L2_id,(L2_ID*)&L2_id,sizeof(L2_ID));
mesg.data = (char *)&P_snc_mr ;
msg("[msg_rrc_phy_synch_to_MR_ind] from Inst :%d\n",mesg.head.inst);
return &mesg ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_phy_synch_to_CH_ind().
\return message formate
*/
rrc_phy_synch_to_CH_ind_t P_snc_ch;
msg_t * msg_rrc_phy_synch_to_CH_ind(
Instance_t inst , //!< Instance ID
unsigned int Ch_index , //!< Clusterhead index
L2_ID L2_id
)
{
// msg_t smsg;
init_rrc_msg_head(&(mesg.head),inst, RRC_PHY_SYNCH_TO_CH_IND, sizeof( rrc_phy_synch_to_CH_ind_t ) ,0);
P_snc_ch.Ch_index = Ch_index ;
memcpy(&P_snc_ch.L2_id,(L2_ID*)&L2_id,sizeof(L2_ID));
mesg.data = (char *) &P_snc_ch;
msg("[msg_rrc_phy_synch_to_CH_ind] from Inst :%d\n",mesg.head.inst);
return &mesg ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_sensing_meas_ind().
\return message formate
*/
rrc_sensing_meas_ind_t P_sens_ind;
msg_t * msg_rrc_sensing_meas_ind(
Instance_t inst , //!< Instance ID
L2_ID L2_id , //!< Layer 2 ID (MAC) of sensing node
unsigned int NB_meas , //!< Layer 2 ID (MAC) of sensing node
SENSING_MEAS_T *Sensing_meas , //!< Sensing Information
Transaction_t Trans_id //!< Transaction ID
)
{
// msg_t mesg;
unsigned int size = sizeof( rrc_sensing_meas_ind_t ) + (NB_meas-1) * sizeof(SENSING_MEAS_T) ;
// Note : (NB_meas-1) car la première est incorporé dans rrc_sensing_meas_ind_t
init_rrc_msg_head(&(mesg.head),inst, RRC_SENSING_MEAS_IND, size ,Trans_id);
memcpy( P_sens_ind.L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) ) ;
if ( NB_meas > 0 ) {
memcpy( P_sens_ind.Sensing_meas , Sensing_meas, NB_meas * sizeof(SENSING_MEAS_T) ) ;
}
P_sens_ind.NB_meas = NB_meas ;
mesg.data = (char *) &P_sens_ind ;
return &mesg ;
}
/*!
*******************************************************************************
\brief La fonction formate en un message les parametres de la fonction
rrc_rb_meas_ind().
\return message formate
*/
rrc_rb_meas_ind_t P_rb_meas;
msg_t * msg_rrc_rb_meas_ind(
Instance_t inst , //!< Instance ID
RB_ID Rb_id , //!< Radio Bearer ID
L2_ID L2_id , //!< Layer 2 (MAC) IDs for link
MEAS_MODE Meas_mode , //!< Measurement mode (periodic or event-driven)
MAC_RLC_MEAS_T *Mac_rlc_meas , //!< MAC/RLC measurements
Transaction_t Trans_id //!< Transaction ID
)
{
//msg_t mesg;
init_rrc_msg_head(&(mesg.head),inst, RRC_RB_MEAS_IND, sizeof( rrc_rb_meas_ind_t ) ,Trans_id);
memcpy( P_rb_meas.L2_id.L2_id, L2_id.L2_id, sizeof(L2_ID) ) ;
memcpy( &(P_rb_meas.Mac_rlc_meas), Mac_rlc_meas, sizeof(L2_ID) ) ;
P_rb_meas.Rb_id = Rb_id ;
P_rb_meas.Meas_mode = Meas_mode ;
mesg.data = (char *) &P_rb_meas;
return &mesg ;
}
/*****************************************************************************/
rrc_init_scan_req_t P_init_scan;
msg_t * msg_rrc_init_scan_req(
Instance_t inst , //!< Instance ID
L2_ID L2_id , //!< Layer 2 (MAC) IDs for link
unsigned int Interv
)
{
//msg_t mesg;
msg("RRCI: inst %d sendind rrc_init_scan_req from FC %d %d\n",inst,L2_id.L2_id[0],L2_id.L2_id[7]);
init_rrc_msg_head(&(mesg.head),inst, RRC_INIT_SCAN_REQ, sizeof( rrc_init_scan_req_t ) ,0);
memcpy( &P_init_scan.L2_id.L2_id[0], &L2_id.L2_id[0], sizeof(L2_ID) ) ;
P_init_scan.interv=Interv;
return &mesg ;
}
/*****************************************************************************/
rrc_update_sens_t P_update_sens;
msg_t * msg_rrc_update_sens(
Instance_t inst , //!< Instance ID
Sens_ch_t *Sens,
L2_ID L2_id,
unsigned char NB_info
)
{
//msg_t mesg;
init_rrc_msg_head(&(mesg.head),inst, RRC_UPDATE_SENS, sizeof( rrc_update_sens_t ) ,0);
memcpy( &P_update_sens.L2_id.L2_id[0], &L2_id.L2_id[0], sizeof(L2_ID) ) ;
memcpy( &P_update_sens.Sens_meas[0], (rrc_update_sens_t *)Sens, NB_info*sizeof(Sens_ch_t) ) ;
P_update_sens.NB_info=NB_info;
return &mesg ;
}
/*****************************************************************************/
rrc_end_scan_req_t P_end_scan;
msg_t * msg_rrc_end_scan_req(
Instance_t inst , //!< Instance ID
unsigned char CH_index
)
{
//msg_t mesg;
msg("RRC: send END_SCAN_REQ, INST %d\n",inst);
init_rrc_msg_head(&(mesg.head),inst, RRC_END_SCAN_REQ, sizeof( rrc_end_scan_req_t ) ,0);
P_update_sens.L2_id.L2_id[0]=CH_index;
return &mesg ;
}
......@@ -3301,6 +3301,7 @@ int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,
msg_p = itti_alloc_new_message(TASK_RRC_UE, PHY_FIND_NEXT_CELL_REQ);
itti_send_msg_to_task(TASK_PHY_UE, ctxt_pP->instance, msg_p);
LOG_E(RRC, "Synched with a cell, but PLMN doesn't match our SIM, the message PHY_FIND_NEXT_CELL_REQ is sent but lost in current UE implementation! \n");
}
}
#endif
......@@ -4718,7 +4719,6 @@ void *rrc_ue_task( void *args_p )
break;
case MESSAGE_TEST:
LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
break;
/* MAC messages */
......@@ -5113,6 +5113,7 @@ void *rrc_ue_task( void *args_p )
break; // PHY_FIND_CELL_IND
case PHY_MEAS_REPORT_IND: {
LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_RRC_UE, RRC_RAL_MEASUREMENT_REPORT_IND);
......@@ -5130,6 +5131,7 @@ void *rrc_ue_task( void *args_p )
}
case RRC_RAL_CONFIGURE_THRESHOLD_REQ:
LOG_D(RRC, "[UE %d] Received %s\n", ue_mod_id, ITTI_MSG_NAME (msg_p));
rrc_ue_ral_handle_configure_threshold_request(ue_mod_id, msg_p);
break;
......
......@@ -115,9 +115,6 @@ extern RAN_CONTEXT_t RC;
#endif
extern eNB_MAC_INST *eNB_mac_inst;
extern UE_MAC_INST *UE_mac_inst;
#ifdef BIGPHYSAREA
extern void *bigphys_malloc(int);
#endif
extern uint16_t two_tier_hexagonal_cellIds[7];
......
......@@ -53,7 +53,6 @@ extern unsigned char NB_INST;
extern unsigned char NB_eNB_INST;
extern unsigned char NB_UE_INST;
extern unsigned short NODE_ID[1];
extern void* bigphys_malloc(int);
#endif
......
#ifeq ($(NAS_FLAG),1)
NAS_OBJS = $(OPENAIR2_TOP)/RRC/NAS/nas_config.o
NAS_OBJS += $(OPENAIR2_TOP)/RRC/NAS/rb_config.o
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "defs.h"
#include "linux/module.h"
#ifdef BIGPHYSAREA
#ifdef ARCH_64
char *bigphys_ptr,*bigphys_current;
#else //ARCH_64
unsigned int bigphys_ptr,bigphys_current;
#endif //ARCH_64
// return pointer to memory in big physical area aligned to 16 bytes
void* bigphys_malloc(int n)
{
int n2 = n + ((16-(n%16))%16);
#ifdef ARCH_64
char *bigphys_old;
#else
unsigned int bigphys_old;
#endif
printk("[BIGPHYSAREA] Calling bigphys_malloc for %d (%d) bytes\n",n,n2);
#ifdef ARCH_64
printk("[BIGPHYSAREA] Allocated Memory @ %p\n",bigphys_current);
#endif
bigphys_old = bigphys_current;
bigphys_current += n2;
#ifdef ARCH_64
printk("[BIGPHYSAREA] Allocated Memory top now @ %p\n",bigphys_current);
return ((void *)(bigphys_old));
#else //ARCH_64
//printk("[BIGPHYSAREA] Allocated Memory %d\n",bigphys_current-bigphys_ptr);
return ((void *)(bigphys_old));
#endif //ARCH_64
}
EXPORT_SYMBOL(bigphys_malloc);
#endif
/*
* 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
*/
void* bigphys_malloc(int);
MEM_DIR = $(OPENAIR2_TOP)/UTIL/MEM
LIST_DIR = $(OPENAIR2_TOP)/UTIL/LISTS
FIFO_DIR = $(OPENAIR2_TOP)/UTIL/FIFO
MATH_DIR = $(OPENAIR2_TOP)/UTIL/MATH
TIMER_DIR = $(OPENAIR2_TOP)/UTIL/TIMER
LOG_DIR=$(OPENAIR2_TOP)/UTIL/LOG
OCG_DIR=$(OPENAIR2_TOP)/UTIL/OCG
OPT_DIR=$(OPENAIR2_TOP)/UTIL/OPT
OMG_DIR=$(OPENAIR2_TOP)/UTIL/OMG
OTG_DIR=$(OPENAIR2_TOP)/UTIL/OTG
CLI_DIR=$(OPENAIR2_TOP)/UTIL/CLI
OMV_DIR=$(OPENAIR2_TOP)/UTIL/OMV
LFDS_DIR=$(OPENAIR2_TOP)/UTIL/LFDS/liblfds6.1.1/liblfds611
OSA_DIR=$(OPENAIR2_TOP)/UTIL/OSA
LIST_OBJ = $(LIST_DIR)/list.o
FIFO_OBJ = $(FIFO_DIR)/pad_list.o
LIST_OBJ += $(LIST_DIR)/list2.o
TIMER_OBJ += $(TIMER_DIR)/umts_timer.o
MEM_OBJ += $(MEM_DIR)/mem_block.o
LOG_OBJS = $(LOG_DIR)/log.o
LOG_OBJS += $(LOG_DIR)/vcd_signal_dumper.o
OCG_OBJS = $(OCG_DIR)/OCG.o
OCG_OBJS += $(OCG_DIR)/OCG_create_dir.o
OCG_OBJS += $(OCG_DIR)/OCG_detect_file.o
OCG_OBJS += $(OCG_DIR)/OCG_generate_report.o
OCG_OBJS += $(OCG_DIR)/OCG_parse_filename.o
OCG_OBJS += $(OCG_DIR)/OCG_parse_XML.o
OCG_OBJS += $(OCG_DIR)/OCG_save_XML.o
ifdef SECU
OSA_OBJS = $(OSA_DIR)/osa_key_deriver.o
OSA_OBJS += $(OSA_DIR)/osa_stream_eia.o
OSA_OBJS += $(OSA_DIR)/osa_stream_eea.o
OSA_OBJS += $(OSA_DIR)/osa_snow3g.o
OSA_OBJS += $(OSA_DIR)/osa_rijndael.o
endif
OPT_OBJS = $(OPT_DIR)/probe.o
OMG_OBJS = $(OMG_DIR)/omg.o
OMG_OBJS += $(OMG_DIR)/common.o
OMG_OBJS += $(OMG_DIR)/job.o
OMG_OBJS += $(OMG_DIR)/static.o
OMG_OBJS += $(OMG_DIR)/rwp.o
OMG_OBJS += $(OMG_DIR)/rwalk.o
#OMG_OBJS += $(OMG_DIR)/omg_hashtable.o
OMG_OBJS += $(OMG_DIR)/mobility_parser.o
OMG_OBJS += $(OMG_DIR)/trace.o
OMG_OBJS += $(OMG_DIR)/sumo.o
OMG_OBJS += $(OMG_DIR)/id_manager.o
OMG_OBJS += $(OMG_DIR)/client_traci_OMG.o
OMG_OBJS += $(OMG_DIR)/storage_traci_OMG.o
OMG_OBJS += $(OMG_DIR)/socket_traci_OMG.o
OMG_OBJS += $(OMG_DIR)/steadystaterwp.o
OMG_OBJS += $(OMG_DIR)/grid.o
OMG_OBJS += $(OMG_DIR)/trace_hashtable.o
OTG_OBJS = $(OTG_DIR)/otg_tx.o
OTG_OBJS += $(OTG_DIR)/otg.o
OTG_OBJS += $(OTG_DIR)/otg_rx.o
OTG_OBJS += $(OTG_DIR)/otg_kpi.o
OTG_OBJS += $(OTG_DIR)/otg_form.o
OTG_OBJS += $(OTG_DIR)/otg_models.o
MATH_OBJS = $(MATH_DIR)/oml.o
CLI_OBJ = $(CLI_DIR)/cli_server.o
CLI_OBJ += $(CLI_DIR)/cli.o
CLI_OBJ += $(CLI_DIR)/cli_cmd.o
UTIL_OBJ = \
$(OSA_OBJS) \
$(FIFO_OBJ) \
$(LIST_OBJ) \
$(TIMER_OBJ) \
$(MEM_OBJ) \
$(LOG_OBJS) \
$(OCG_OBJS) \
$(MATH_OBJS) \
$(OTG_OBJS) \
$(CLI_OBJ) \
$(OMG_OBJS) \
$(OPT_OBJS)
UTIL_incl = \
-I$(OPENAIR2_TOP)/UTIL \
-I$(OSA_DIR) \
-I$(LFDS_DIR)/inc \
-I$(MEM_DIR) \
-I$(LIST_DIR) \
-I$(FIFO_DIR) \
-I$(OCG_DIR) \
-I$(LOG_DIR) \
-I$(MATH_DIR) \
-I$(TIMER_DIR) \
-I$(OMG_DIR) \
-I$(OTG_DIR) \
-I$(CLI_DIR) \
-I$(OPT_DIR) \
-I$(OMV_DIR)
/*
* 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
*/
/***************************************************************************
umts_timer.c - description
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
//#include "rtos_header.h"
#include "platform_types.h"
#include "list.h"
#include "umts_timer_struct.h"
#include "mem_block.h"
#include "openair_defs.h"
//-----------------------------------------------------------------------------
void
umts_timer_check_time_out (list2_t * atimer_listP, uint32_t current_frame_tick_millisecondsP)
{
//-----------------------------------------------------------------------------
struct timer_unit *timer;
mem_block_t *mem_unit;
uint8_t time_out = 255;
mem_unit = atimer_listP->head;
// do it simple now.
while ((mem_unit) && (time_out)) {
timer = (struct timer_unit *) (mem_unit->data);
if ((current_frame_tick_millisecondsP - timer->frame_tick_start) >= timer->frame_time_out) {
mem_unit = list2_remove_head (atimer_listP);
(*(timer->proc)) (timer->protocol, timer->timer_id);
free_mem_block (mem_unit, __func__);
mem_unit = atimer_listP->head;
} else {
time_out = 0;
}
}
}
//-----------------------------------------------------------------------------
void
umts_timer_delete_timer (list2_t * atimer_listP, void *timer_idP)
{
//-----------------------------------------------------------------------------
mem_block_t *mem_unit;
mem_unit = atimer_listP->head;
while ((mem_unit)) {
if (((struct timer_unit *) (mem_unit->data))->timer_id == timer_idP) {
list2_remove_element (mem_unit, atimer_listP);
free_mem_block (mem_unit, __func__);
return;
}
mem_unit = mem_unit->next;
}
}
//-----------------------------------------------------------------------------
mem_block_t *
umts_add_timer_list_up (list2_t * atimer_listP, void (*procP) (void *, void *), void *protocolP, void *timer_idP, uint32_t frame_time_outP, uint32_t current_frame_tick_millisecondsP)
{
//-----------------------------------------------------------------------------
struct mem_block_t *mb;
struct timer_unit *timer;
mem_block_t *mem_unit;
int32_t remaining_time;
uint8_t inserted = 0;
mb = get_free_mem_block (sizeof (struct timer_unit), __func__);
if(mb==NULL) return NULL;
((struct timer_unit *) (mb->data))->proc = procP;
((struct timer_unit *) (mb->data))->protocol = protocolP;
((struct timer_unit *) (mb->data))->timer_id = timer_idP;
((struct timer_unit *) (mb->data))->frame_time_out = frame_time_outP;
((struct timer_unit *) (mb->data))->frame_tick_start = current_frame_tick_millisecondsP;
// insert the timer in list in ascending order
mem_unit = atimer_listP->head;
while ((mem_unit) && (!inserted)) {
timer = (struct timer_unit *) (mem_unit->data);
remaining_time = timer->frame_time_out - current_frame_tick_millisecondsP + timer->frame_tick_start;
// not timed out
if ((remaining_time > 0) && (frame_time_outP < remaining_time)) {
inserted = 255;
if (mem_unit == atimer_listP->head) {
#ifdef DEBUG_TIMER
msg ("[TIMER][CREATION] added timer_id %p at head time out %d current time %d proc %p \n", timer_idP, frame_time_outP, current_frame_tick_millisecondsP, *procP);
#endif
list2_add_head (mb, atimer_listP);
} else {
#ifdef DEBUG_TIMER
msg ("[TIMER][CREATION] inserted timer_id %p time out %d current time %d proc %p \n", timer_idP, frame_time_outP, current_frame_tick_millisecondsP, *procP);
#endif
mb->previous = mem_unit->previous;
mb->next = mem_unit;
mem_unit->previous->next = mb;
mem_unit->previous = mb;
}
} else {
mem_unit = mem_unit->next;
}
}
if (!inserted) {
#ifdef DEBUG_TIMER
msg ("[TIMER][CREATION] added timer_id %p at tail time out %d current time %d proc %p \n", timer_idP, frame_time_outP, current_frame_tick_millisecondsP, *procP);
#endif
list2_add_tail (mb, atimer_listP);
}
return mb;
}
//-----------------------------------------------------------------------------
void
umts_stop_all_timers (list2_t * atimer_listP)
{
//-----------------------------------------------------------------------------
list2_free (atimer_listP);
}
//-----------------------------------------------------------------------------
void
umts_stop_all_timers_except (list2_t * atimer_listP, void (*procP) (void *, void *))
{
//-----------------------------------------------------------------------------
struct timer_unit *timer;
mem_block_t *mem_unit;
mem_block_t *mem_unit_to_delete;
mem_unit = atimer_listP->head;
while ((mem_unit)) {
timer = (struct timer_unit *) (mem_unit->data);
if (timer->proc != procP) {
mem_unit_to_delete = mem_unit;
mem_unit = mem_unit->next;
list2_remove_element (mem_unit_to_delete, atimer_listP);
free_mem_block (mem_unit_to_delete, __func__);
} else {
mem_unit = mem_unit->next;
}
}
}
/*
* 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
*/
/***************************************************************************
umts_timer.h - description
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#ifndef __UMTS_TIMER_H__
# define __UMTS_TIMER_H__
# include "platform_types.h"
# include "lists_proto_extern.h"
# include "mem_mngt_proto_extern.h"
# define UMTS_TIMER_NOT_STARTED 0x00
# define UMTS_TIMER_STARTED 0x01
# define UMTS_TIMER_TIMED_OUT 0x02
void umts_timer_check_time_out (list2_t * atimer_listP, uint32_t current_frame_tick_millisecondsP);
mem_block *umts_add_timer_list_up (list2_t * atimer_listP, void (*procP) (void *, void *), void *protocolP, void *timer_idP, uint32_t frame_time_outP, uint32_t current_frame_tick_millisecondsP);
struct timer_unit {
void (*proc) (void *, void *); // proc executed when time_out
void *protocol; // arg should be a pointer on a allocated protocol entity private struct including its variables
void *timer_id; // arg should be a value or a pointer identifying the timer
// Example: rlc_am_sdu_discard_time_out(rlc_am, sdu)
uint32_t frame_time_out;
uint32_t frame_tick_start;
};
#endif
/*
* 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
*/
/***************************************************************************
umts_timer_proto_extern.h - description
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#ifndef __UMTS_TIMER_PROTO_EXTERN_H__
# define __UMTS_TIMER_PROTO_EXTERN_H__
# include "platform_types.h"
# include "list.h"
# include "mem_block.h"
extern void umts_timer_check_time_out (list2_t * atimer_listP, uint32_t current_frame_tick_millisecondsP);
extern void umts_timer_delete_timer (list2_t * atimer_listP, void *timer_idP);
extern mem_block_t *umts_add_timer_list_up (list2_t * atimer_listP, void (*procP) (void *, void *), void *protocolP, void *timer_idP, uint32_t frame_time_outP,
uint32_t current_frame_tick_millisecondsP);
extern void umts_stop_all_timers (list2_t * atimer_listP);
extern void umts_stop_all_timers_except (list2_t * atimer_listP, void (*procP) (void *, void *));
#endif
/*
* 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
*/
/***************************************************************************
umts_timer_struct.h - description
-------------------
AUTHOR : Lionel GAUTHIER
COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr
***************************************************************************/
#ifndef __UMTS_TIMER_STRUCT_H__
# define __UMTS_TIMER_STRUCT_H__
# include "platform_types.h"
struct timer_unit {
void (*proc) (void *, void *); // proc executed when time_out
void *protocol; // arg should be a pointer on a allocated protocol entity private struct including its variables
void *timer_id; // arg should be a value or a pointer identifying the timer
// Example: rlc_am_sdu_discard_time_out(rlc_am, sdu)
uint32_t frame_time_out;
uint32_t frame_tick_start;
};
#endif
ASN1MESSAGESDIR=$(X2AP_DIR)/MESSAGES
ASN1DIR=$(ASN1MESSAGESDIR)/ASN1
#//ifeq ($(USE_MME), R10)
#// ASN1RELDIR=R10.7
#//else
#//ASN1RELDIR=R11.2
#//endif
# TEMP
ASN1RELDIR=R11.2
include $(ASN1DIR)/$(ASN1RELDIR)/Makefile.inc
libx2ap_OBJECTS = \
x2ap.o \
x2ap_common.o \
$(addprefix MESSAGES/ASN1/$(ASN1RELDIR)/, $(X2AP_ASN_MODULE_SOURCES))
# pull in dependency info for *existing* .o files
-include $(OUTDIR)/*.d
CFLAGS = \
-Wall \
-DENB_MODE \
-DENABLE_USE_MME \
-I. \
-I$(ASN1MESSAGESDIR)/ASN1/$(ASN1RELDIR) \
-I$(ASN1MESSAGESDIR) \
-I$(OUTDIR) \
-I../UTILS \
$(ADD_CFLAGS) \
$(X2AP_CFLAGS) \
-Wuninitialized \
-Werror=implicit-function-declaration
X2AP_GENERATED = \
$(OUTDIR)/x2ap_encoder.o \
$(OUTDIR)/x2ap_decoder.o \
$(OUTDIR)/x2ap_xer_print.o
$(OUTDIR)/%.o : %.c
@echo "Compiling $<"
@echo "Compiling $< with CFLAGS= $(CFLAGS)"
@if [ ! -d $(dir $@) ]; then mkdir -p $(dir $@); fi;
@$(CC) -c $(CFLAGS) -o $@ $<
@$(CC) -MM $(CFLAGS) $< > $(basename $@).d
@mv -f $(basename $@).d $(basename $@).d.tmp
@sed -e 's|.*:|$@:|' < $(basename $@).d.tmp > $(basename $@).d
@sed -e 's/.*://' -e 's/\\$$//' < $(basename $@).d.tmp | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $(basename $@).d
@rm -f $(basename $@).d.tmp
$(X2AP_GENERATED): %.o : %.c
@echo "Compiling $<"
@echo "Compiling $< with CFLAGS= $(CFLAGS)"
@if [ ! -d $(dir $@) ]; then mkdir -p $(dir $@); fi;
@$(CC) -c $(CFLAGS) -o $@ $<
@$(CC) -MM $(CFLAGS) $< > $(basename $@).d
@mv -f $(basename $@).d $(basename $@).d.tmp
@sed -e 's|.*:|$@:|' < $(basename $@).d.tmp > $(basename $@).d
@sed -e 's/.*://' -e 's/\\$$//' < $(basename $@).d.tmp | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $(basename $@).d
@rm -f $(basename $@).d.tmp
$(OUTDIR)/x2ap_ieregen.stamp: $(ASN1DIR)/$(ASN1RELDIR)/X2AP-PDU-Contents.asn $(ASN1DIR)/asn1tostruct.py
@if [ ! -d $(OUTDIR) ]; then mkdir -p $(OUTDIR); fi;
@python $(ASN1DIR)/asn1tostruct.py -f$< -o$(OUTDIR)
@echo Timestamp > $@
#ProtocolExtensionContainer
#$(ASN1DIR)/$(ASN1RELDIR)/X2AP-PDU.asn
$(OUTDIR)/x2ap_asn1regen.stamp: $(ASN1DIR)/$(ASN1RELDIR)/X2AP-CommonDataTypes.asn $(ASN1DIR)/$(ASN1RELDIR)/X2AP-Constants.asn $(ASN1DIR)/$(ASN1RELDIR)/X2AP-IEs.asn $(ASN1DIR)/$(ASN1RELDIR)/X2AP-PDU.asn
@echo "Timestamp DIR " $(ASN1DIR) " DIRREL " $(ASN1RELDIR)
# (cd $(ASN1DIR)/$(ASN1RELDIR) && asn1c -fhave_native64 -gen-PER -fcompound-names $^)
(cd $(ASN1MESSAGESDIR) && asn1c -fhave_native64 -gen-PER -fcompound-names -fskeletons-copy $^)
@echo "Timestamp X2AP_CFLAGS: " $(X2AP_CFLAGS)
@echo Timestamp > $@
$(OUTDIR)/libx2ap.a: $(OUTDIR)/x2ap_ieregen.stamp $(OUTDIR)/x2ap_asn1regen.stamp $(X2AP_GENERATED) $(addprefix $(OUTDIR)/,$(libx2ap_OBJECTS))
@echo Creating X2AP archive
@echo libx2ap_OBJECTS $(libx2ap_OBJECTS)
@$(AR) rcs $@ $(X2AP_GENERATED) $(addprefix $(OUTDIR)/,$(libx2ap_OBJECTS))
clean:
@$(RM_F_V) $(OUTDIR)/*.o
@$(RM_F_V) $(OUTDIR)/*.d
@$(RM_F_V) $(addprefix $(OUTDIR)/MESSAGES/ASN1/$(ASN1RELDIR), $(X2AP_ASN_MODULE_SOURCES))
@$(RM_F_V) $(addprefix $(OUTDIR)/MESSAGES/ASN1/$(ASN1RELDIR), $(X2AP_ASN_MODULE_SOURCES:.o=.d))
@$(RM_F_V) $(OUTDIR)/libx2ap.a
@$(RM_F_V) $(OUTDIR)/x2ap_asn1regen.stamp
@$(RM_F_V) $(OUTDIR)/x2ap_ieregen.stamp
@$(RM_F_V) $(OUTDIR)/x2ap_decoder.c $(OUTDIR)/x2ap_encoder.c
@$(RM_F_V) $(OUTDIR)/x2ap_xer_print.c $(OUTDIR)/x2ap_ies_defs.h
cleanall: clean
@$(RM_F_V) $(addprefix $(OUTDIR)/MESSAGES/ASN1/$(ASN1RELDIR), $(X2AP_ASN_MODULE_SOURCES:.o=.c))
@$(RM_F_V) $(addprefix $(OUTDIR)/MESSAGES/ASN1/$(ASN1RELDIR), $(X2AP_ASN_MODULE_SOURCES:.o=.h))
showcflags:
@echo x2ap cflags: $(CFLAGS)
/*
* Copyright (c) 2015, EURECOM (www.eurecom.fr)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those
* of the authors and should not be interpreted as representing official policies,
* either expressed or implied, of the FreeBSD Project.
*/
/*****************************************************************************
Source as_message.h
Version 0.1
Date 2012/10/18
Product NAS stack
Subsystem Application Programming Interface
Author Frederic Maurel
Description Defines the messages supported by the Access Stratum sublayer
protocol (usually RRC and S1AP for E-UTRAN) and functions used
to encode and decode
*****************************************************************************/
#ifndef __AS_MESSAGE_H__
#define __AS_MESSAGE_H__
#include "commonDef.h"
#include "networkDef.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/*
* --------------------------------------------------------------------------
* Access Stratum message types
* --------------------------------------------------------------------------
*/
#define AS_REQUEST 0x0100
#define AS_RESPONSE 0x0200
#define AS_INDICATION 0x0400
#define AS_CONFIRM 0x0800
/*
* --------------------------------------------------------------------------
* Access Stratum message identifiers
* --------------------------------------------------------------------------
*/
/* Broadcast information */
#define AS_BROADCAST_INFO 0x01
#define AS_BROADCAST_INFO_IND (AS_BROADCAST_INFO | AS_INDICATION)
/* Cell information relevant for cell selection processing */
#define AS_CELL_INFO 0x02
#define AS_CELL_INFO_REQ (AS_CELL_INFO | AS_REQUEST)
#define AS_CELL_INFO_CNF (AS_CELL_INFO | AS_CONFIRM)
#define AS_CELL_INFO_IND (AS_CELL_INFO | AS_INDICATION)
/* Paging information */
#define AS_PAGING 0x03
#define AS_PAGING_REQ (AS_PAGING | AS_REQUEST)
#define AS_PAGING_IND (AS_PAGING | AS_INDICATION)
/* NAS signalling connection establishment */
#define AS_NAS_ESTABLISH 0x04
#define AS_NAS_ESTABLISH_REQ (AS_NAS_ESTABLISH | AS_REQUEST)
#define AS_NAS_ESTABLISH_IND (AS_NAS_ESTABLISH | AS_INDICATION)
#define AS_NAS_ESTABLISH_RSP (AS_NAS_ESTABLISH | AS_RESPONSE)
#define AS_NAS_ESTABLISH_CNF (AS_NAS_ESTABLISH | AS_CONFIRM)
/* NAS signalling connection release */
#define AS_NAS_RELEASE 0x05
#define AS_NAS_RELEASE_REQ (AS_NAS_RELEASE | AS_REQUEST)
#define AS_NAS_RELEASE_IND (AS_NAS_RELEASE | AS_INDICATION)
/* Uplink information transfer */
#define AS_UL_INFO_TRANSFER 0x06
#define AS_UL_INFO_TRANSFER_REQ (AS_UL_INFO_TRANSFER | AS_REQUEST)
#define AS_UL_INFO_TRANSFER_CNF (AS_UL_INFO_TRANSFER | AS_CONFIRM)
#define AS_UL_INFO_TRANSFER_IND (AS_UL_INFO_TRANSFER | AS_INDICATION)
/* Downlink information transfer */
#define AS_DL_INFO_TRANSFER 0x07
#define AS_DL_INFO_TRANSFER_REQ (AS_DL_INFO_TRANSFER | AS_REQUEST)
#define AS_DL_INFO_TRANSFER_CNF (AS_DL_INFO_TRANSFER | AS_CONFIRM)
#define AS_DL_INFO_TRANSFER_IND (AS_DL_INFO_TRANSFER | AS_INDICATION)
/* Radio Access Bearer establishment */
#define AS_RAB_ESTABLISH 0x08
#define AS_RAB_ESTABLISH_REQ (AS_RAB_ESTABLISH | AS_REQUEST)
#define AS_RAB_ESTABLISH_IND (AS_RAB_ESTABLISH | AS_INDICATION)
#define AS_RAB_ESTABLISH_RSP (AS_RAB_ESTABLISH | AS_RESPONSE)
#define AS_RAB_ESTABLISH_CNF (AS_RAB_ESTABLISH | AS_CONFIRM)
/* Radio Access Bearer release */
#define AS_RAB_RELEASE 0x09
#define AS_RAB_RELEASE_REQ (AS_RAB_RELEASE | AS_REQUEST)
#define AS_RAB_RELEASE_IND (AS_RAB_RELEASE | AS_INDICATION)
/* NAS Cause */
#define EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED (8)
#define EPS_SERVICES_NOT_ALLOWED (7)
#define PLMN_NOT_ALLOWED (11)
#define TRACKING_AREA_NOT_ALLOWED (12)
#define ROAMING_NOT_ALLOWED_IN_THIS_TRACKING_AREA (13)
#define EPS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN (14)
#define NO_SUITABLE_CELLS_IN_TRACKING_AREA (15)
#define NETWORK_FAILURE (17)
#define ESM_FAILURE (19)
typedef enum nas_cause_s {
NAS_CAUSE_EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED,
NAS_CAUSE_EPS_SERVICES_NOT_ALLOWED = EPS_SERVICES_NOT_ALLOWED,
NAS_CAUSE_PLMN_NOT_ALLOWED = PLMN_NOT_ALLOWED,
NAS_CAUSE_TRACKING_AREA_NOT_ALLOWED = TRACKING_AREA_NOT_ALLOWED,
NAS_CAUSE_ROAMING_NOT_ALLOWED_IN_THIS_TRACKING_AREA = ROAMING_NOT_ALLOWED_IN_THIS_TRACKING_AREA,
NAS_CAUSE_EPS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = EPS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN,
NAS_CAUSE_NO_SUITABLE_CELLS_IN_TRACKING_AREA = NO_SUITABLE_CELLS_IN_TRACKING_AREA,
NAS_CAUSE_NETWORK_FAILURE = NETWORK_FAILURE,
NAS_CAUSE_ESM_FAILURE = ESM_FAILURE
} nas_cause_t;
/*
* --------------------------------------------------------------------------
* Access Stratum message global parameters
* --------------------------------------------------------------------------
*/
/* Error code */
typedef enum nas_error_code_s {
AS_SUCCESS = 1, /* Success code, transaction is going on */
AS_TERMINATED_NAS, /* Transaction terminated by NAS */
AS_TERMINATED_AS, /* Transaction terminated by AS */
AS_FAILURE /* Failure code */
} nas_error_code_t;
/* Core network domain */
typedef enum core_network_s {
AS_PS = 1, /* Packet-Switched */
AS_CS /* Circuit-Switched */
} core_network_t;
/* SAE Temporary Mobile Subscriber Identity */
typedef struct as_stmsi_s {
uint8_t MMEcode; /* MME code that allocated the GUTI */
uint32_t m_tmsi; /* M-Temporary Mobile Subscriber Identity */
} as_stmsi_t;
/* Dedicated NAS information */
typedef struct as_nas_info_s {
uint32_t length; /* Length of the NAS information data */
Byte_t* data; /* Dedicated NAS information data container */
} as_nas_info_t;
/* Radio Access Bearer identity */
typedef uint8_t as_rab_id_t;
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/*
* --------------------------------------------------------------------------
* Broadcast information
* --------------------------------------------------------------------------
*/
/*
* AS->NAS - Broadcast information indication
* AS may asynchronously report to NAS available PLMNs within specific
* location area
*/
typedef struct broadcast_info_ind_s {
#define PLMN_LIST_MAX_SIZE 6
PLMN_LIST_T(PLMN_LIST_MAX_SIZE) plmnIDs; /* List of PLMN identifiers */
ci_t cellID; /* Identity of the cell serving the listed PLMNs */
tac_t tac; /* Code of the tracking area the cell belongs to */
} broadcast_info_ind_t;
/*
* --------------------------------------------------------------------------
* Cell information relevant for cell selection processing
* --------------------------------------------------------------------------
*/
/* Radio access technologies supported by the network */
#define AS_GSM (1 << NET_ACCESS_GSM)
#define AS_COMPACT (1 << NET_ACCESS_COMPACT)
#define AS_UTRAN (1 << NET_ACCESS_UTRAN)
#define AS_EGPRS (1 << NET_ACCESS_EGPRS)
#define AS_HSDPA (1 << NET_ACCESS_HSDPA)
#define AS_HSUPA (1 << NET_ACCESS_HSUPA)
#define AS_HSDUPA (1 << NET_ACCESS_HSDUPA)
#define AS_EUTRAN (1 << NET_ACCESS_EUTRAN)
/*
* NAS->AS - Cell Information request
* NAS request AS to search for a suitable cell belonging to the selected
* PLMN to camp on.
*/
typedef struct cell_info_req_s {
plmn_t plmnID; /* Selected PLMN identity */
Byte_t rat; /* Bitmap - set of radio access technologies */
} cell_info_req_t;
/*
* AS->NAS - Cell Information confirm
* AS search for a suitable cell and respond to NAS. If found, the cell
* is selected to camp on.
*/
typedef struct cell_info_cnf_s {
uint8_t errCode; /* Error code */
ci_t cellID; /* Identity of the cell serving the selected PLMN */
tac_t tac; /* Code of the tracking area the cell belongs to */
AcT_t rat; /* Radio access technology supported by the cell */
uint8_t rsrq; /* Reference signal received quality */
uint8_t rsrp; /* Reference signal received power */
} cell_info_cnf_t;
/*
* AS->NAS - Cell Information indication
* AS may change cell selection if a more suitable cell is found.
*/
typedef struct cell_info_ind_s {
ci_t cellID; /* Identity of the new serving cell */
tac_t tac; /* Code of the tracking area the cell belongs to */
} cell_info_ind_t;
/*
* --------------------------------------------------------------------------
* Paging information
* --------------------------------------------------------------------------
*/
/* Paging cause */
typedef enum paging_cause_s {
AS_CONNECTION_ESTABLISH, /* Establish NAS signalling connection */
AS_EPS_ATTACH, /* Perform local detach and initiate EPS
* attach procedure */
AS_CS_FALLBACK /* Inititate CS fallback procedure */
} paging_cause_t;
/*
* NAS->AS - Paging Information request
* NAS requests the AS that NAS signalling messages or user data is pending
* to be sent.
*/
typedef struct paging_req_s {
as_stmsi_t s_tmsi; /* UE identity */
uint8_t CN_domain; /* Core network domain */
} paging_req_t;
/*
* AS->NAS - Paging Information indication
* AS reports to the NAS that appropriate procedure has to be initiated.
*/
typedef struct paging_ind_s {
paging_cause_t cause; /* Paging cause */
} paging_ind_t;
/*
* --------------------------------------------------------------------------
* NAS signalling connection establishment
* --------------------------------------------------------------------------
*/
/* Cause of RRC connection establishment */
typedef enum as_cause_s {
AS_CAUSE_UNKNOWN = 0,
AS_CAUSE_EMERGENCY = NET_ESTABLISH_CAUSE_EMERGENCY,
AS_CAUSE_HIGH_PRIO = NET_ESTABLISH_CAUSE_HIGH_PRIO,
AS_CAUSE_MT_ACCESS = NET_ESTABLISH_CAUSE_MT_ACCESS,
AS_CAUSE_MO_SIGNAL = NET_ESTABLISH_CAUSE_MO_SIGNAL,
AS_CAUSE_MO_DATA = NET_ESTABLISH_CAUSE_MO_DATA,
AS_CAUSE_V1020 = NET_ESTABLISH_CAUSE_V1020
} as_cause_t;
/* Type of the call associated to the RRC connection establishment */
typedef enum as_call_type_s {
AS_TYPE_ORIGINATING_SIGNAL = NET_ESTABLISH_TYPE_ORIGINATING_SIGNAL,
AS_TYPE_EMERGENCY_CALLS = NET_ESTABLISH_TYPE_EMERGENCY_CALLS,
AS_TYPE_ORIGINATING_CALLS = NET_ESTABLISH_TYPE_ORIGINATING_CALLS,
AS_TYPE_TERMINATING_CALLS = NET_ESTABLISH_TYPE_TERMINATING_CALLS,
AS_TYPE_MO_CS_FALLBACK = NET_ESTABLISH_TYPE_MO_CS_FALLBACK
} as_call_type_t;
/*
* NAS->AS - NAS signalling connection establishment request
* NAS requests the AS to perform the RRC connection establishment procedure
* to transfer initial NAS message to the network while UE is in IDLE mode.
*/
typedef struct nas_establish_req_s {
as_cause_t cause; /* RRC connection establishment cause */
as_call_type_t type; /* RRC associated call type */
as_stmsi_t s_tmsi; /* UE identity */
plmn_t plmnID; /* Selected PLMN identity */
as_nas_info_t initialNasMsg; /* Initial NAS message to transfer */
} nas_establish_req_t;
/*
* AS->NAS - NAS signalling connection establishment indication
* AS transfers the initial NAS message to the NAS.
*/
typedef struct nas_establish_ind_s {
uint32_t UEid; /* UE lower layer identifier */
tac_t tac; /* Code of the tracking area the initiating
* UE belongs to */
as_cause_t asCause; /* Establishment cause */
as_nas_info_t initialNasMsg; /* Initial NAS message to transfer */
} nas_establish_ind_t;
/*
* NAS->AS - NAS signalling connection establishment response
* NAS responds to the AS that initial answer message has to be provided to
* the UE.
*/
typedef struct nas_establish_rsp_s {
uint32_t UEid; /* UE lower layer identifier */
as_stmsi_t s_tmsi; /* UE identity */
nas_error_code_t errCode; /* Transaction status */
as_nas_info_t nasMsg; /* NAS message to transfer */
uint32_t nas_ul_count; /* UL NAS COUNT */
uint16_t selected_encryption_algorithm;
uint16_t selected_integrity_algorithm;
} nas_establish_rsp_t;
/*
* AS->NAS - NAS signalling connection establishment confirm
* AS transfers the initial answer message to the NAS.
*/
typedef struct nas_establish_cnf_s {
uint32_t UEid; /* UE lower layer identifier */
nas_error_code_t errCode; /* Transaction status */
as_nas_info_t nasMsg; /* NAS message to transfer */
uint32_t ul_nas_count;
uint16_t selected_encryption_algorithm;
uint16_t selected_integrity_algorithm;
} nas_establish_cnf_t;
/*
* --------------------------------------------------------------------------
* NAS signalling connection release
* --------------------------------------------------------------------------
*/
/* Release cause */
typedef enum release_cause_s {
AS_AUTHENTICATION_FAILURE = 1, /* Authentication procedure failed */
AS_DETACH /* Detach requested */
} release_cause_t;
/*
* NAS->AS - NAS signalling connection release request
* NAS requests the termination of the connection with the UE.
*/
typedef struct nas_release_req_s {
uint32_t UEid; /* UE lower layer identifier */
as_stmsi_t s_tmsi; /* UE identity */
release_cause_t cause; /* Release cause */
} nas_release_req_t;
/*
* AS->NAS - NAS signalling connection release indication
* AS reports that connection has been terminated by the network.
*/
typedef struct nas_release_ind_s {
release_cause_t cause; /* Release cause */
} nas_release_ind_t;
/*
* --------------------------------------------------------------------------
* NAS information transfer
* --------------------------------------------------------------------------
*/
/*
* NAS->AS - Uplink data transfer request
* NAS requests the AS to transfer uplink information to the NAS that
* operates at the network side.
*/
typedef struct ul_info_transfer_req_s {
uint32_t UEid; /* UE lower layer identifier */
as_stmsi_t s_tmsi; /* UE identity */
as_nas_info_t nasMsg; /* Uplink NAS message */
} ul_info_transfer_req_t;
/*
* AS->NAS - Uplink data transfer confirm
* AS immediately notifies the NAS whether uplink information has been
* successfully sent to the network or not.
*/
typedef struct ul_info_transfer_cnf_s {
uint32_t UEid; /* UE lower layer identifier */
nas_error_code_t errCode; /* Transaction status */
} ul_info_transfer_cnf_t;
/*
* AS->NAS - Uplink data transfer indication
* AS delivers the uplink information message to the NAS that operates
* at the network side.
*/
typedef struct ul_info_transfer_ind_s {
uint32_t UEid; /* UE lower layer identifier */
as_nas_info_t nasMsg; /* Uplink NAS message */
} ul_info_transfer_ind_t;
/*
* NAS->AS - Downlink data transfer request
* NAS requests the AS to transfer downlink information to the NAS that
* operates at the UE side.
*/
typedef ul_info_transfer_req_t dl_info_transfer_req_t;
/*
* AS->NAS - Downlink data transfer confirm
* AS immediately notifies the NAS whether downlink information has been
* successfully sent to the network or not.
*/
typedef ul_info_transfer_cnf_t dl_info_transfer_cnf_t;
/*
* AS->NAS - Downlink data transfer indication
* AS delivers the downlink information message to the NAS that operates
* at the UE side.
*/
typedef ul_info_transfer_ind_t dl_info_transfer_ind_t;
/*
* --------------------------------------------------------------------------
* Radio Access Bearer establishment
* --------------------------------------------------------------------------
*/
/* TODO: Quality of Service parameters */
typedef struct {} as_qos_t;
/*
* NAS->AS - Radio access bearer establishment request
* NAS requests the AS to allocate transmission resources to radio access
* bearer initialized at the network side.
*/
typedef struct rab_establish_req_s {
as_stmsi_t s_tmsi; /* UE identity */
as_rab_id_t rabID; /* Radio access bearer identity */
as_qos_t QoS; /* Requested Quality of Service */
} rab_establish_req_t;
/*
* AS->NAS - Radio access bearer establishment indication
* AS notifies the NAS that specific radio access bearer has to be setup.
*/
typedef struct rab_establish_ind_s {
as_rab_id_t rabID; /* Radio access bearer identity */
} rab_establish_ind_t;
/*
* NAS->AS - Radio access bearer establishment response
* NAS responds to AS whether the specified radio access bearer has been
* successfully setup or not.
*/
typedef struct rab_establish_rsp_s {
as_stmsi_t s_tmsi; /* UE identity */
as_rab_id_t rabID; /* Radio access bearer identity */
nas_error_code_t errCode; /* Transaction status */
} rab_establish_rsp_t;
/*
* AS->NAS - Radio access bearer establishment confirm
* AS notifies NAS whether the specified radio access bearer has been
* successfully setup at the UE side or not.
*/
typedef struct rab_establish_cnf_s {
as_rab_id_t rabID; /* Radio access bearer identity */
nas_error_code_t errCode; /* Transaction status */
} rab_establish_cnf_t;
/*
* --------------------------------------------------------------------------
* Radio Access Bearer release
* --------------------------------------------------------------------------
*/
/*
* NAS->AS - Radio access bearer release request
* NAS requests the AS to release transmission resources previously allocated
* to specific radio access bearer at the network side.
*/
typedef struct rab_release_req_s {
as_stmsi_t s_tmsi; /* UE identity */
as_rab_id_t rabID; /* Radio access bearer identity */
} rab_release_req_t;
/*
* AS->NAS - Radio access bearer release indication
* AS notifies NAS that specific radio access bearer has been released.
*/
typedef struct rab_release_ind_s {
as_rab_id_t rabID; /* Radio access bearer identity */
} rab_release_ind_t;
/*
* --------------------------------------------------------------------------
* Structure of the AS messages handled by the network sublayer
* --------------------------------------------------------------------------
*/
typedef struct as_message_s {
uint16_t msgID;
union {
broadcast_info_ind_t broadcast_info_ind;
cell_info_req_t cell_info_req;
cell_info_cnf_t cell_info_cnf;
cell_info_ind_t cell_info_ind;
paging_req_t paging_req;
paging_ind_t paging_ind;
nas_establish_req_t nas_establish_req;
nas_establish_ind_t nas_establish_ind;
nas_establish_rsp_t nas_establish_rsp;
nas_establish_cnf_t nas_establish_cnf;
nas_release_req_t nas_release_req;
nas_release_ind_t nas_release_ind;
ul_info_transfer_req_t ul_info_transfer_req;
ul_info_transfer_cnf_t ul_info_transfer_cnf;
ul_info_transfer_ind_t ul_info_transfer_ind;
dl_info_transfer_req_t dl_info_transfer_req;
dl_info_transfer_cnf_t dl_info_transfer_cnf;
dl_info_transfer_ind_t dl_info_transfer_ind;
rab_establish_req_t rab_establish_req;
rab_establish_ind_t rab_establish_ind;
rab_establish_rsp_t rab_establish_rsp;
rab_establish_cnf_t rab_establish_cnf;
rab_release_req_t rab_release_req;
rab_release_ind_t rab_release_ind;
} __attribute__((__packed__)) msg;
} as_message_t;
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
int as_message_decode(const char* buffer, as_message_t* msg, int length);
int as_message_encode(char* buffer, as_message_t* msg, int length);
/* Implemented in the network_api.c body file */
int as_message_send(as_message_t* as_msg);
#endif /* __AS_MESSAGE_H__*/
/*
* 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(GTPV1U_CREATE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, Gtpv1uCreateTunnelReq, gtpv1uCreateTunnelReq)
MESSAGE_DEF(GTPV1U_CREATE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, Gtpv1uCreateTunnelResp, gtpv1uCreateTunnelResp)
MESSAGE_DEF(GTPV1U_UPDATE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, Gtpv1uUpdateTunnelReq, gtpv1uUpdateTunnelReq)
MESSAGE_DEF(GTPV1U_UPDATE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, Gtpv1uUpdateTunnelResp, gtpv1uUpdateTunnelResp)
MESSAGE_DEF(GTPV1U_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, Gtpv1uDeleteTunnelReq, gtpv1uDeleteTunnelReq)
MESSAGE_DEF(GTPV1U_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, Gtpv1uDeleteTunnelResp, gtpv1uDeleteTunnelResp)
MESSAGE_DEF(GTPV1U_TUNNEL_DATA_IND, MESSAGE_PRIORITY_MED, Gtpv1uTunnelDataInd, gtpv1uTunnelDataInd)
MESSAGE_DEF(GTPV1U_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, Gtpv1uTunnelDataReq, gtpv1uTunnelDataReq)
/*
* 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 GTPV1_U_MESSAGES_TYPES_H_
#define GTPV1_U_MESSAGES_TYPES_H_
#include "../SGW-LITE/sgw_lite_ie_defs.h"
typedef struct {
Teid_t context_teid; ///< Tunnel Endpoint Identifier
ebi_t eps_bearer_id;
} Gtpv1uCreateTunnelReq;
typedef struct {
uint8_t status; ///< Status of S1U endpoint creation (Failed = 0xFF or Success = 0x0)
Teid_t context_teid; ///< local SGW S11 Tunnel Endpoint Identifier
Teid_t S1u_teid; ///< Tunnel Endpoint Identifier
ebi_t eps_bearer_id;
} Gtpv1uCreateTunnelResp;
typedef struct {
Teid_t context_teid; ///< S11 Tunnel Endpoint Identifier
Teid_t sgw_S1u_teid; ///< SGW S1U local Tunnel Endpoint Identifier
Teid_t enb_S1u_teid; ///< eNB S1U Tunnel Endpoint Identifier
ip_address_t enb_ip_address_for_S1u;
ebi_t eps_bearer_id;
} Gtpv1uUpdateTunnelReq;
typedef struct {
uint8_t status; ///< Status (Failed = 0xFF or Success = 0x0)
Teid_t context_teid; ///< S11 Tunnel Endpoint Identifier
Teid_t sgw_S1u_teid; ///< SGW S1U local Tunnel Endpoint Identifier
Teid_t enb_S1u_teid; ///< eNB S1U Tunnel Endpoint Identifier
ebi_t eps_bearer_id;
} Gtpv1uUpdateTunnelResp;
typedef struct {
Teid_t context_teid; ///< local SGW S11 Tunnel Endpoint Identifier
Teid_t S1u_teid; ///< local S1U Tunnel Endpoint Identifier to be deleted
} Gtpv1uDeleteTunnelReq;
typedef struct {
uint8_t status; ///< Status of S1U endpoint deleteion (Failed = 0xFF or Success = 0x0)
Teid_t context_teid; ///< local SGW S11 Tunnel Endpoint Identifier
Teid_t S1u_teid; ///< local S1U Tunnel Endpoint Identifier to be deleted
} Gtpv1uDeleteTunnelResp;
typedef struct {
uint8_t *buffer;
uint32_t length;
uint32_t offset; ///< start of message offset in buffer
Teid_t local_S1u_teid; ///< Tunnel Endpoint Identifier
} Gtpv1uTunnelDataInd;
typedef struct {
uint8_t *buffer;
uint32_t length;
uint32_t offset; ///< start of message offset in buffer
Teid_t local_S1u_teid; ///< Tunnel Endpoint Identifier
Teid_t S1u_enb_teid; ///< Tunnel Endpoint Identifier
} Gtpv1uTunnelDataReq;
#endif /* GTPV1_U_MESSAGES_TYPES_H_ */
/*
* 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
*/
// These messages files are mandatory and must always be placed in first position
#include "intertask_messages_def.h"
#include "timer_messages_def.h"
// Messages files used between tasks
#include "gtpv1_u_messages_def.h"
#include "ip_forward_messages_def.h"
#include "nas_messages_def.h"
#include "s11_messages_def.h"
#include "s1ap_messages_def.h"
#include "s6a_messages_def.h"
#include "sctp_messages_def.h"
#include "sgw_lite_def.h"
#include "udp_messages_def.h"
#include "mme_app_messages_def.h"
/*
* 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
*/
//WARNING: Do not include this header directly. Use intertask_interface.h instead.
// Messages for NAS logging
MESSAGE_DEF(NAS_DL_EMM_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_dl_emm_raw_msg)
MESSAGE_DEF(NAS_UL_EMM_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_ul_emm_raw_msg)
MESSAGE_DEF(NAS_DL_EMM_PLAIN_MSG, MESSAGE_PRIORITY_MED, nas_emm_plain_msg_t, nas_dl_emm_plain_msg)
MESSAGE_DEF(NAS_UL_EMM_PLAIN_MSG, MESSAGE_PRIORITY_MED, nas_emm_plain_msg_t, nas_ul_emm_plain_msg)
MESSAGE_DEF(NAS_DL_EMM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_emm_protected_msg_t, nas_dl_emm_protected_msg)
MESSAGE_DEF(NAS_UL_EMM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_emm_protected_msg_t, nas_ul_emm_protected_msg)
MESSAGE_DEF(NAS_DL_ESM_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_dl_esm_raw_msg)
MESSAGE_DEF(NAS_UL_ESM_RAW_MSG, MESSAGE_PRIORITY_MED, nas_raw_msg_t, nas_ul_esm_raw_msg)
MESSAGE_DEF(NAS_DL_ESM_PLAIN_MSG, MESSAGE_PRIORITY_MED, nas_esm_plain_msg_t, nas_dl_esm_plain_msg)
MESSAGE_DEF(NAS_UL_ESM_PLAIN_MSG, MESSAGE_PRIORITY_MED, nas_esm_plain_msg_t, nas_ul_esm_plain_msg)
MESSAGE_DEF(NAS_DL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_protected_msg_t, nas_dl_esm_protected_msg)
MESSAGE_DEF(NAS_UL_ESM_PROTECTED_MSG, MESSAGE_PRIORITY_MED, nas_esm_protected_msg_t, nas_ul_esm_protected_msg)
/* */
MESSAGE_DEF(NAS_PAGING_IND, MESSAGE_PRIORITY_MED, nas_paging_ind_t, nas_paging_ind)
MESSAGE_DEF(NAS_PDN_CONNECTIVITY_REQ, MESSAGE_PRIORITY_MED, nas_pdn_connectivity_req_t, nas_pdn_connectivity_req)
MESSAGE_DEF(NAS_CONNECTION_ESTABLISHMENT_IND, MESSAGE_PRIORITY_MED, nas_conn_est_ind_t, nas_conn_est_ind)
MESSAGE_DEF(NAS_CONNECTION_ESTABLISHMENT_CNF, MESSAGE_PRIORITY_MED, nas_conn_est_cnf_t, nas_conn_est_cnf)
MESSAGE_DEF(NAS_CONNECTION_RELEASE_IND, MESSAGE_PRIORITY_MED, nas_conn_rel_ind_t, nas_conn_rel_ind)
MESSAGE_DEF(NAS_UPLINK_DATA_IND, MESSAGE_PRIORITY_MED, nas_ul_data_ind_t, nas_ul_data_ind)
MESSAGE_DEF(NAS_DOWNLINK_DATA_REQ, MESSAGE_PRIORITY_MED, nas_dl_data_req_t, nas_dl_data_req)
MESSAGE_DEF(NAS_DOWNLINK_DATA_CNF, MESSAGE_PRIORITY_MED, nas_dl_data_cnf_t, nas_dl_data_cnf)
MESSAGE_DEF(NAS_DOWNLINK_DATA_REJ, MESSAGE_PRIORITY_MED, nas_dl_data_rej_t, nas_dl_data_rej)
MESSAGE_DEF(NAS_RAB_ESTABLISHMENT_REQ, MESSAGE_PRIORITY_MED, nas_rab_est_req_t, nas_rab_est_req)
MESSAGE_DEF(NAS_RAB_ESTABLISHMENT_RESP, MESSAGE_PRIORITY_MED, nas_rab_est_rsp_t, nas_rab_est_rsp)
MESSAGE_DEF(NAS_RAB_RELEASE_REQ, MESSAGE_PRIORITY_MED, nas_rab_rel_req_t, nas_rab_rel_req)
/* NAS layer -> MME app messages */
MESSAGE_DEF(NAS_AUTHENTICATION_PARAM_REQ, MESSAGE_PRIORITY_MED, nas_auth_param_req_t, nas_auth_param_req)
/* MME app -> NAS layer messages */
MESSAGE_DEF(NAS_PDN_CONNECTIVITY_RSP, MESSAGE_PRIORITY_MED, nas_pdn_connectivity_rsp_t, nas_pdn_connectivity_rsp)
MESSAGE_DEF(NAS_PDN_CONNECTIVITY_FAIL, MESSAGE_PRIORITY_MED, nas_pdn_connectivity_fail_t, nas_pdn_connectivity_fail)
MESSAGE_DEF(NAS_AUTHENTICATION_PARAM_RSP, MESSAGE_PRIORITY_MED, nas_auth_param_rsp_t, nas_auth_param_rsp)
MESSAGE_DEF(NAS_AUTHENTICATION_PARAM_FAIL, MESSAGE_PRIORITY_MED, nas_auth_param_fail_t, nas_auth_param_fail)
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "as_message.h"
#include "nas_message.h"
#ifndef NAS_MESSAGES_TYPES_H_
#define NAS_MESSAGES_TYPES_H_
#define NAS_DL_EMM_RAW_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_emm_raw_msg
#define NAS_UL_EMM_RAW_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_emm_raw_msg
#define NAS_DL_EMM_PROTECTED_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_emm_protected_msg
#define NAS_UL_EMM_PROTECTED_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_emm_protected_msg
#define NAS_DL_EMM_PLAIN_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_emm_plain_msg
#define NAS_UL_EMM_PLAIN_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_emm_plain_msg
#define NAS_DL_ESM_RAW_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_esm_raw_msg
#define NAS_UL_ESM_RAW_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_esm_raw_msg
#define NAS_DL_ESM_PROTECTED_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_esm_protected_msg
#define NAS_UL_ESM_PROTECTED_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_esm_protected_msg
#define NAS_DL_ESM_PLAIN_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_esm_plain_msg
#define NAS_UL_ESM_PLAIN_MSG(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_esm_plain_msg
#define NAS_UL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_ind
#define NAS_DL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_req
#define NAS_DL_DATA_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_cnf
#define NAS_DL_DATA_REJ(mSGpTR) (mSGpTR)->ittiMsg.nas_dl_data_rej
#define NAS_PDN_CONNECTIVITY_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_pdn_connectivity_req
#define NAS_PDN_CONNECTIVITY_RSP(mSGpTR) (mSGpTR)->ittiMsg.nas_pdn_connectivity_rsp
#define NAS_PDN_CONNECTIVITY_FAIL(mSGpTR) (mSGpTR)->ittiMsg.nas_pdn_connectivity_fail
#define NAS_CONN_EST_IND(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_est_ind
#define NAS_CONNECTION_ESTABLISHMENT_CNF(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_est_cnf
#define NAS_BEARER_PARAM(mSGpTR) (mSGpTR)->ittiMsg.nas_bearer_param
#define NAS_AUTHENTICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_req
#define NAS_AUTHENTICATION_PARAM_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_param_req
#define NAS_AUTHENTICATION_PARAM_RSP(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_param_rsp
#define NAS_AUTHENTICATION_PARAM_FAIL(mSGpTR) (mSGpTR)->ittiMsg.nas_auth_param_fail
#define NAS_DATA_LENGHT_MAX 256
typedef enum {
EMM_MSG_HEADER = 1,
EMM_MSG_ATTACH_REQUEST,
EMM_MSG_ATTACH_ACCEPT,
EMM_MSG_ATTACH_COMPLETE,
EMM_MSG_ATTACH_REJECT,
EMM_MSG_DETACH_REQUEST,
EMM_MSG_DETACH_ACCEPT,
EMM_MSG_TRACKING_AREA_UPDATE_REQUEST,
EMM_MSG_TRACKING_AREA_UPDATE_ACCEPT,
EMM_MSG_TRACKING_AREA_UPDATE_COMPLETE,
EMM_MSG_TRACKING_AREA_UPDATE_REJECT,
EMM_MSG_EXTENDED_SERVICE_REQUEST,
EMM_MSG_SERVICE_REQUEST,
EMM_MSG_SERVICE_REJECT,
EMM_MSG_GUTI_REALLOCATION_COMMAND,
EMM_MSG_GUTI_REALLOCATION_COMPLETE,
EMM_MSG_AUTHENTICATION_REQUEST,
EMM_MSG_AUTHENTICATION_RESPONSE,
EMM_MSG_AUTHENTICATION_REJECT,
EMM_MSG_AUTHENTICATION_FAILURE,
EMM_MSG_IDENTITY_REQUEST,
EMM_MSG_IDENTITY_RESPONSE,
EMM_MSG_SECURITY_MODE_COMMAND,
EMM_MSG_SECURITY_MODE_COMPLETE,
EMM_MSG_SECURITY_MODE_REJECT,
EMM_MSG_EMM_STATUS,
EMM_MSG_EMM_INFORMATION,
EMM_MSG_DOWNLINK_NAS_TRANSPORT,
EMM_MSG_UPLINK_NAS_TRANSPORT,
EMM_MSG_CS_SERVICE_NOTIFICATION,
} emm_message_ids_t;
typedef enum {
ESM_MSG_HEADER = 1,
ESM_MSG_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REQUEST,
ESM_MSG_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_ACCEPT,
ESM_MSG_ACTIVATE_DEFAULT_EPS_BEARER_CONTEXT_REJECT,
ESM_MSG_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REQUEST,
ESM_MSG_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_ACCEPT,
ESM_MSG_ACTIVATE_DEDICATED_EPS_BEARER_CONTEXT_REJECT,
ESM_MSG_MODIFY_EPS_BEARER_CONTEXT_REQUEST,
ESM_MSG_MODIFY_EPS_BEARER_CONTEXT_ACCEPT,
ESM_MSG_MODIFY_EPS_BEARER_CONTEXT_REJECT,
ESM_MSG_DEACTIVATE_EPS_BEARER_CONTEXT_REQUEST,
ESM_MSG_DEACTIVATE_EPS_BEARER_CONTEXT_ACCEPT,
ESM_MSG_PDN_CONNECTIVITY_REQUEST,
ESM_MSG_PDN_CONNECTIVITY_REJECT,
ESM_MSG_PDN_DISCONNECT_REQUEST,
ESM_MSG_PDN_DISCONNECT_REJECT,
ESM_MSG_BEARER_RESOURCE_ALLOCATION_REQUEST,
ESM_MSG_BEARER_RESOURCE_ALLOCATION_REJECT,
ESM_MSG_BEARER_RESOURCE_MODIFICATION_REQUEST,
ESM_MSG_BEARER_RESOURCE_MODIFICATION_REJECT,
ESM_MSG_ESM_INFORMATION_REQUEST,
ESM_MSG_ESM_INFORMATION_RESPONSE,
ESM_MSG_ESM_STATUS,
} esm_message_ids_t;
typedef struct nas_raw_msg_s {
uint32_t lenght;
uint8_t data[NAS_DATA_LENGHT_MAX];
} nas_raw_msg_t;
typedef struct nas_emm_plain_msg_s {
emm_message_ids_t present;
EMM_msg choice;
} nas_emm_plain_msg_t;
typedef struct nas_emm_protected_msg_s {
nas_message_security_header_t header;
emm_message_ids_t present;
EMM_msg choice;
} nas_emm_protected_msg_t;
typedef struct nas_esm_plain_msg_s {
esm_message_ids_t present;
ESM_msg choice;
} nas_esm_plain_msg_t;
typedef struct nas_esm_protected_msg_s {
nas_message_security_header_t header;
esm_message_ids_t present;
ESM_msg choice;
} nas_esm_protected_msg_t;
typedef struct nas_paging_ind_s {
} nas_paging_ind_t;
typedef struct nas_pdn_connectivity_req_s {
int pti; // nas ref Identity of the procedure transaction executed to activate the PDN connection entry
unsigned ue_id; // nas ref
char imsi[16];
uint8_t imsi_length;
network_qos_t qos;
pco_flat_t pco;
OctetString apn;
OctetString pdn_addr;
int pdn_type;
void *proc_data;
int request_type;
} nas_pdn_connectivity_req_t;
typedef struct nas_pdn_connectivity_rsp_s {
int pti; // nas ref Identity of the procedure transaction executed to activate the PDN connection entry
unsigned ue_id; // nas ref
network_qos_t qos;
pco_flat_t pco;
OctetString apn;
OctetString pdn_addr;
int pdn_type;
void *proc_data;
int request_type;
unsigned eNB_ue_s1ap_id:24;
uint32_t mme_ue_s1ap_id;
/* Key eNB */
//uint8_t keNB[32];
ambr_t ambr;
ambr_t apn_ambr;
/* EPS bearer ID */
unsigned ebi:4;
/* QoS */
qci_t qci;
priority_level_t prio_level;
pre_emp_vulnerability_t pre_emp_vulnerability;
pre_emp_capability_t pre_emp_capability;
/* S-GW TEID for user-plane */
Teid_t sgw_s1u_teid;
/* S-GW IP address for User-Plane */
ip_address_t sgw_s1u_address;
} nas_pdn_connectivity_rsp_t;
typedef struct nas_pdn_connectivity_fail_s {
unsigned ue_id; // nas ref
} nas_pdn_connectivity_fail_t;
typedef struct nas_conn_est_ind_s {
nas_establish_ind_t nas;
/* Transparent message from s1ap to be forwarded to MME_APP or
* to S1AP if connection establishment is rejected by NAS.
*/
s1ap_initial_ue_message_t transparent;
} nas_conn_est_ind_t;
typedef nas_establish_rsp_t nas_conn_est_rej_t;
typedef nas_establish_cnf_t nas_conn_est_cnf_t;
typedef struct nas_conn_rel_ind_s {
} nas_conn_rel_ind_t;
typedef ul_info_transfer_ind_t nas_ul_data_ind_t;
typedef dl_info_transfer_req_t nas_dl_data_req_t;
typedef dl_info_transfer_cnf_t nas_dl_data_cnf_t;
typedef struct nas_dl_data_rej_s {
uint32_t UEid; /* UE lower layer identifier */
as_nas_info_t nasMsg; /* Uplink NAS message */
} nas_dl_data_rej_t;
typedef struct nas_rab_est_req_s {
} nas_rab_est_req_t;
typedef struct nas_rab_est_rsp_s {
} nas_rab_est_rsp_t;
typedef struct nas_rab_rel_req_s {
} nas_rab_rel_req_t;
typedef struct nas_attach_req_s {
/* TODO: Set the correct size */
char apn[100];
char imsi[16];
#define INITIAL_REQUEST (0x1)
unsigned initial:1;
s1ap_initial_ue_message_t transparent;
} nas_attach_req_t;
typedef struct nas_auth_req_s {
/* UE imsi */
char imsi[16];
#define NAS_FAILURE_OK 0x0
#define NAS_FAILURE_IND 0x1
unsigned failure:1;
int cause;
} nas_auth_req_t;
typedef struct nas_auth_resp_s {
char imsi[16];
} nas_auth_resp_t;
typedef struct nas_auth_param_req_s {
/* UE identifier */
uint32_t ue_id;
/* Imsi of the UE (In case of initial request) */
char imsi[16];
uint8_t imsi_length;
/* Indicates whether the procedure corresponds to a new connection or not */
uint8_t initial_req:1;
uint8_t re_synchronization:1;
uint8_t auts[14];
} nas_auth_param_req_t;
typedef struct nas_auth_param_rsp_s {
/* UE identifier */
uint32_t ue_id;
/* For future use: nb of vectors provided */
uint8_t nb_vectors;
/* Consider only one E-UTRAN vector for the moment... */
eutran_vector_t vector;
} nas_auth_param_rsp_t;
typedef struct nas_auth_param_fail_s {
/* UE identifier */
uint32_t ue_id;
/* S6A mapped to NAS cause */
nas_cause_t cause;
} nas_auth_param_fail_t;
#endif /* NAS_MESSAGES_TYPES_H_ */
/*
* 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
*/
//WARNING: Do not include this header directly. Use intertask_interface.h instead.
/* Messages for S1AP logging */
MESSAGE_DEF(S1AP_UPLINK_NAS_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_uplink_nas_log)
MESSAGE_DEF(S1AP_UE_CAPABILITY_IND_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_capability_ind_log)
MESSAGE_DEF(S1AP_INITIAL_CONTEXT_SETUP_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_initial_context_setup_log)
MESSAGE_DEF(S1AP_NAS_NON_DELIVERY_IND_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_nas_non_delivery_ind_log)
MESSAGE_DEF(S1AP_DOWNLINK_NAS_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_downlink_nas_log)
MESSAGE_DEF(S1AP_S1_SETUP_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_s1_setup_log)
MESSAGE_DEF(S1AP_INITIAL_UE_MESSAGE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_initial_ue_message_log)
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_REQ_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_context_release_req_log)
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMMAND_LOG, MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_context_release_command_log)
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_ue_context_release_log)
MESSAGE_DEF(S1AP_ERROR_INDICATION_LOG , MESSAGE_PRIORITY_MED, IttiMsgText , s1ap_error_indication_log)
MESSAGE_DEF(S1AP_UE_CAPABILITIES_IND , MESSAGE_PRIORITY_MED, s1ap_ue_cap_ind_t , s1ap_ue_cap_ind)
MESSAGE_DEF(S1AP_ENB_DEREGISTERED_IND , MESSAGE_PRIORITY_MED, s1ap_eNB_deregistered_ind_t , s1ap_eNB_deregistered_ind)
MESSAGE_DEF(S1AP_DEREGISTER_UE_REQ , MESSAGE_PRIORITY_MED, s1ap_deregister_ue_req_t , s1ap_deregister_ue_req)
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_REQ , MESSAGE_PRIORITY_MED, s1ap_ue_context_release_req_t , s1ap_ue_context_release_req)
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMMAND, MESSAGE_PRIORITY_MED, s1ap_ue_context_release_command_t, s1ap_ue_context_release_command)
MESSAGE_DEF(S1AP_UE_CONTEXT_RELEASE_COMPLETE, MESSAGE_PRIORITY_MED, s1ap_ue_context_release_complete_t, s1ap_ue_context_release_complete)
/*
* 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 S1AP_MESSAGES_TYPES_H_
#define S1AP_MESSAGES_TYPES_H_
#define S1AP_ENB_DEREGISTERED_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_eNB_deregistered_ind
#define S1AP_DEREGISTER_UE_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_deregister_ue_req
#define S1AP_UE_CONTEXT_RELEASE_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_context_release_req
#define S1AP_UE_CONTEXT_RELEASE_COMMAND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_context_release_command
#define S1AP_UE_CONTEXT_RELEASE_COMPLETE(mSGpTR) (mSGpTR)->ittiMsg.s1ap_ue_context_release_complete
typedef struct s1ap_initial_ue_message_s {
unsigned eNB_ue_s1ap_id:24;
uint32_t mme_ue_s1ap_id;
cgi_t e_utran_cgi;
} s1ap_initial_ue_message_t;
typedef struct s1ap_initial_ctxt_setup_req_s {
unsigned eNB_ue_s1ap_id:24;
uint32_t mme_ue_s1ap_id;
/* Key eNB */
uint8_t keNB[32];
ambr_t ambr;
ambr_t apn_ambr;
/* EPS bearer ID */
unsigned ebi:4;
/* QoS */
qci_t qci;
priority_level_t prio_level;
pre_emp_vulnerability_t pre_emp_vulnerability;
pre_emp_capability_t pre_emp_capability;
/* S-GW TEID for user-plane */
Teid_t teid;
/* S-GW IP address for User-Plane */
ip_address_t s_gw_address;
} s1ap_initial_ctxt_setup_req_t;
typedef struct s1ap_ue_cap_ind_s {
unsigned eNB_ue_s1ap_id:24;
uint32_t mme_ue_s1ap_id;
uint8_t radio_capabilities[100];
uint32_t radio_capabilities_length;
} s1ap_ue_cap_ind_t;
#define S1AP_ITTI_UE_PER_DEREGISTER_MESSAGE 20
typedef struct s1ap_eNB_deregistered_ind_s {
uint8_t nb_ue_to_deregister;
uint32_t mme_ue_s1ap_id[S1AP_ITTI_UE_PER_DEREGISTER_MESSAGE];
} s1ap_eNB_deregistered_ind_t;
typedef struct s1ap_deregister_ue_req_s {
uint32_t mme_ue_s1ap_id;
} s1ap_deregister_ue_req_t;
typedef struct s1ap_ue_context_release_req_s {
uint32_t mme_ue_s1ap_id;
} s1ap_ue_context_release_req_t;
typedef struct s1ap_ue_context_release_command_s {
uint32_t mme_ue_s1ap_id;
} s1ap_ue_context_release_command_t;
typedef struct s1ap_ue_context_release_complete_s {
uint32_t mme_ue_s1ap_id;
} s1ap_ue_context_release_complete_t;
#endif /* S1AP_MESSAGES_TYPES_H_ */
/*
* 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
*/
//WARNING: Do not include this header directly. Use intertask_interface.h instead.
MESSAGE_DEF(SCTP_INIT_MSG, MESSAGE_PRIORITY_MED, SctpInit, sctpInit)
MESSAGE_DEF(SCTP_DATA_REQ, MESSAGE_PRIORITY_MED, sctp_data_req_t, sctp_data_req)
MESSAGE_DEF(SCTP_DATA_IND, MESSAGE_PRIORITY_MED, sctp_data_ind_t, sctp_data_ind)
MESSAGE_DEF(SCTP_NEW_ASSOCIATION, MESSAGE_PRIORITY_MAX, sctp_new_peer_t, sctp_new_peer)
MESSAGE_DEF(SCTP_CLOSE_ASSOCIATION, MESSAGE_PRIORITY_MAX, sctp_close_association_t, sctp_close_association)
/*
* 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 SCTP_MESSAGES_TYPES_H_
#define SCTP_MESSAGES_TYPES_H_
#define SCTP_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.sctp_data_ind
#define SCTP_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.sctp_data_req
#define SCTP_INIT_MSG(mSGpTR) (mSGpTR)->ittiMsg.sctpInit
#define SCTP_CLOSE_ASSOCIATION(mSGpTR) (mSGpTR)->ittiMsg.sctp_close_association
typedef struct sctp_data_req_s {
uint8_t *buffer;
uint32_t bufLen;
uint32_t assocId;
uint16_t stream;
} sctp_data_req_t;
typedef struct sctp_data_ind_s {
uint8_t *buffer; ///< SCTP buffer
uint32_t buf_length; ///< SCTP buffer length
int32_t assoc_id; ///< SCTP physical association ID
uint8_t stream; ///< Stream number on which data had been received
uint16_t instreams; ///< Number of input streams for the SCTP connection between peers
uint16_t outstreams; ///< Number of output streams for the SCTP connection between peers
} sctp_data_ind_t;
typedef struct sctp_init_s {
/* Request usage of ipv4 */
unsigned ipv4:1;
/* Request usage of ipv6 */
unsigned ipv6:1;
uint8_t nb_ipv4_addr;
uint32_t ipv4_address[10];
uint8_t nb_ipv6_addr;
char *ipv6_address[10];
uint16_t port;
uint32_t ppid;
} SctpInit;
typedef struct sctp_close_association_s {
uint32_t assoc_id;
} sctp_close_association_t;
typedef struct sctp_new_peer_s {
uint32_t instreams;
uint32_t outstreams;
uint32_t assoc_id;
} sctp_new_peer_t;
#endif /* SCTP_MESSAGES_TYPES_H_ */
/*
* 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
*/
// This task is mandatory and must always be placed in first position
TASK_DEF(TASK_TIMER, TASK_PRIORITY_MED, 10)
// Other possible tasks in the process
/// GTPV1-U task
TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 200)
/// FW_IP task
TASK_DEF(TASK_FW_IP, TASK_PRIORITY_MED, 200)
/// MME Applicative task
TASK_DEF(TASK_MME_APP, TASK_PRIORITY_MED, 200)
/// NAS task
TASK_DEF(TASK_NAS_MME, TASK_PRIORITY_MED, 200)
/// S11 task
TASK_DEF(TASK_S11, TASK_PRIORITY_MED, 200)
/// S1AP task
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200)
/// S6a task
TASK_DEF(TASK_S6A, TASK_PRIORITY_MED, 200)
/// SCTP task
TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200)
/// Serving and Proxy Gateway Application task
TASK_DEF(TASK_SPGW_APP, TASK_PRIORITY_MED, 200)
/// UDP task
TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 200)
//MESSAGE GENERATOR TASK
TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200)
/*
* 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(UDP_INIT, MESSAGE_PRIORITY_MED, udp_init_t, udp_init)
MESSAGE_DEF(UDP_DATA_REQ, MESSAGE_PRIORITY_MED, udp_data_req_t, udp_data_req)
MESSAGE_DEF(UDP_DATA_IND, MESSAGE_PRIORITY_MED, udp_data_ind_t, udp_data_ind)
/*
* 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 UDP_MESSAGES_TYPES_H_
#define UDP_MESSAGES_TYPES_H_
#define UDP_INIT(mSGpTR) (mSGpTR)->ittiMsg.udp_init
typedef struct {
uint32_t port;
char *address;
} udp_init_t;
typedef struct {
uint8_t *buffer;
uint32_t buffer_length;
uint32_t buffer_offset;
uint32_t peer_address;
uint32_t peer_port;
} udp_data_req_t;
typedef struct {
uint8_t *buffer;
uint32_t buffer_length;
uint32_t peer_address;
uint32_t peer_port;
} udp_data_ind_t;
#endif /* UDP_MESSAGES_TYPES_H_ */
/*
* 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
*/
/*****************************************************************************
Source as_message.h
Version 0.1
Date 2012/10/18
Product NAS stack
Subsystem Application Programming Interface
Author Frederic Maurel
Description Defines the messages supported by the Access Stratum sublayer
protocol (usually RRC and S1AP for E-UTRAN) and functions used
to encode and decode
*****************************************************************************/
#ifndef __AS_MESSAGE_H__
#define __AS_MESSAGE_H__
#include "commonDef.h"
#include "networkDef.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/* Access Stratum Message types */
#define AS_REQUEST 0x0100
#define AS_RESPONSE 0x0200
#define AS_INDICATION 0x0400
#define AS_CONFIRM 0x0800
/*
* Access Stratum Message identifiers
* ----------------------------------
*/
/* Cell information relevant for cell selection processing */
#define AS_CELL_INFO 0x01
#define AS_CELL_INFO_REQ (AS_CELL_INFO | AS_REQUEST)
#define AS_CELL_INFO_RSP (AS_CELL_INFO | AS_RESPONSE)
#define AS_CELL_INFO_IND (AS_CELL_INFO | AS_INDICATION)
/* Security mode control */
#define AS_SECURITY 0x02
#define AS_SECURITY_REQ (AS_SECURITY | AS_REQUEST)
#define AS_SECURITY_RSP (AS_SECURITY | AS_RESPONSE)
/* Paging information */
#define AS_PAGING 0x03
#define AS_PAGING_IND (AS_PAGING | AS_INDICATION)
/* NAS signalling connection establishment */
#define AS_NAS_ESTABLISH 0x04
#define AS_NAS_ESTABLISH_REQ (AS_NAS_ESTABLISH | AS_REQUEST)
#define AS_NAS_ESTABLISH_RSP (AS_NAS_ESTABLISH | AS_RESPONSE)
/* NAS signalling connection release */
#define AS_NAS_RELEASE 0x05
#define AS_NAS_RELEASE_REQ (AS_NAS_RELEASE | AS_REQUEST)
#define AS_NAS_RELEASE_IND (AS_NAS_RELEASE | AS_INDICATION)
/* NAS information transfer */
#define AS_INFO_TRANSFER 0x10
#define AS_UL_INFO_TRANSFER (AS_INFO_TRANSFER | AS_REQUEST)
#define AS_DL_INFO_TRANSFER (AS_INFO_TRANSFER | AS_INDICATION)
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/*
* --------------------------------------------------------------------------
* Available PLMNs and cell Information
* --------------------------------------------------------------------------
*/
/* Radio access technologies supported by the network */
#define AS_GSM (1 << NET_ACCESS_GSM)
#define AS_COMPACT (1 << NET_ACCESS_COMPACT)
#define AS_UTRAN (1 << NET_ACCESS_UTRAN)
#define AS_EGPRS (1 << NET_ACCESS_EGPRS)
#define AS_HSDPA (1 << NET_ACCESS_HSDPA)
#define AS_HSUPA (1 << NET_ACCESS_HSUPA)
#define AS_HSDUPA (1 << NET_ACCESS_HSDUPA)
#define AS_EUTRAN (1 << NET_ACCESS_EUTRAN)
/*
* NAS->AS -K_eNB refresh request
* NAS request AS to refresh its KeNB key
*/
typedef struct kenb_refresh_req_s {
Byte_t kenb[32];
} kenb_refresh_req_t;
/*
* NAS->AS - Cell Information request
* NAS request AS to search for a suitable cell belonging to the selected
* PLMN to camp on.
*/
typedef struct {
plmn_t plmnID; /* PLMN identifier */
Byte_t rat; /* Bitmap - set of radio access technologies */
} cell_info_req_t;
/*
* AS->NAS - Cell Information response
* AS search for a suitable cell and respond to NAS. If found, the cell
* is selected to camp on.
*/
typedef struct {
plmn_t plmnID; /* PLMN identifier */
TAC_t tac; /* identifies a tracking area the PLMN belongs to */
CI_t cellID; /* identifies a cell within a PLMN */
AcT_t rat; /* radio access technology supported by the cell */
} cell_info_rsp_t;
/*
* AS->NAS - Cell Information indication
* AS Reports available PLMNs with associated Radio Access Technologies
* to NAS on request from NAS or autonomously.
*/
typedef struct {
#define PLMN_LIST_MAX_SIZE 6
PLMN_LIST_T(PLMN_LIST_MAX_SIZE) plmnIDs; /* List of PLMN identifiers */
Byte_t rat[PLMN_LIST_MAX_SIZE]; /* Radio access technologies */
TAC_t tac; /* identifies a tracking area within a scope of PLMNs */
CI_t cellID; /* identifies a cell within a PLMN */
} cell_info_ind_t;
/*
* --------------------------------------------------------------------------
* Security mode control
* --------------------------------------------------------------------------
*/
/*
* TODO: NAS->AS - Security command request
*/
typedef struct {} security_req_t;
/*
* TODO: AS->NAS - Security command response
*/
typedef struct {} security_rsp_t;
/*
* --------------------------------------------------------------------------
* Paging information
* --------------------------------------------------------------------------
*/
/*
* TODO: AS->NAS - Paging Information indication
*/
typedef struct {} paging_ind_t;
/*
* --------------------------------------------------------------------------
* NAS signalling connection establishment
* --------------------------------------------------------------------------
*/
/* Cause of RRC connection establishment */
#define AS_CAUSE_EMERGENCY (NET_ESTABLISH_CAUSE_EMERGENCY)
#define AS_CAUSE_HIGH_PRIO (NET_ESTABLISH_CAUSE_HIGH_PRIO)
#define AS_CAUSE_MT_ACCESS (NET_ESTABLISH_CAUSE_MT_ACCESS)
#define AS_CAUSE_MO_SIGNAL (NET_ESTABLISH_CAUSE_MO_SIGNAL)
#define AS_CAUSE_MO_DATA (NET_ESTABLISH_CAUSE_MO_DATA)
#define AS_CAUSE_V1020 (NET_ESTABLISH_CAUSE_V1020)
/* Type of the call associated to the RRC connection establishment */
#define AS_TYPE_ORIGINATING_SIGNAL (NET_ESTABLISH_TYPE_ORIGINATING_SIGNAL)
#define AS_TYPE_EMERGENCY_CALLS (NET_ESTABLISH_TYPE_EMERGENCY_CALLS)
#define AS_TYPE_ORIGINATING_CALLS (NET_ESTABLISH_TYPE_ORIGINATING_CALLS)
#define AS_TYPE_TERMINATING_CALLS (NET_ESTABLISH_TYPE_TERMINATING_CALLS)
#define AS_TYPE_MO_CS_FALLBACK (NET_ESTABLISH_TYPE_MO_CS_FALLBACK)
/* Structure of the SAE Temporary Mobile Subscriber Identity */
typedef struct {
uint8_t MMEcode; /* MME code that allocated the GUTI */
uint32_t m_tmsi; /* M-Temporary Mobile Subscriber Identity */
} as_stmsi_t;
/* Structure of the dedicated NAS information */
typedef struct {
uint32_t length; /* Length of the NAS information data */
Byte_t* data; /* Dedicated NAS information data container */
} as_nas_info_t;
/*
* NAS->AS - NAS signalling connection establishment request
* NAS request AS to perform the RRC connection establishment procedure
* to transfer initial NAS message to the network while UE is in IDLE mode.
*/
typedef struct {
uint8_t cause; /* Connection establishment cause */
uint8_t type; /* Associated call type */
plmn_t plmnID; /* Identifier of the selected PLMN */
as_stmsi_t s_tmsi; /* SAE Temporary Mobile Subscriber Identity */
as_nas_info_t initialNasMsg;/* Initial NAS message to transfer */
} nas_establish_req_t;
/*
* TODO: AS->NAS - NAS signalling connection establishment response
*/
typedef struct {} nas_establish_rsp_t;
/*
* --------------------------------------------------------------------------
* NAS signalling connection release
* --------------------------------------------------------------------------
*/
/*
* TODO: NAS->AS - NAS signalling connection release request
*/
typedef struct {} nas_release_req_t;
/*
* TODO: AS->NAS - NAS signalling connection release indication
*/
typedef struct {} nas_release_ind_t;
/*
* --------------------------------------------------------------------------
* NAS information transfer
* --------------------------------------------------------------------------
*/
/*
* AS->NAS - Downlink data transfer
* AS notifies upper layer that NAS or non-3GPP dedicated downlink information
* has to be transfered to NAS.
*/
typedef as_nas_info_t dl_info_transfer_t;
/*
* NAS->AS - Uplink data transfer request
* NAS requests under layer to transfer NAS or non-3GPP dedicated uplink
* information to AS.
*/
typedef as_nas_info_t ul_info_transfer_t;
/*
* --------------------------------------------------------------------------
* Structure of the AS messages handled by the network sublayer
* --------------------------------------------------------------------------
*/
typedef struct {
uint16_t msgID;
union {
cell_info_req_t cell_info_req;
cell_info_rsp_t cell_info_rsp;
cell_info_ind_t cell_info_ind;
security_req_t security_req;
security_rsp_t security_rsp;
paging_ind_t paging_ind;
nas_establish_req_t nas_establish_req;
nas_establish_rsp_t nas_establish_rsp;
nas_release_req_t nas_release_req;
nas_release_ind_t nas_release_ind;
ul_info_transfer_t ul_info_transfer;
dl_info_transfer_t dl_info_transfer;
} __attribute__((__packed__)) msg;
} as_message_t;
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
int as_message_decode(const char* buffer, int length, as_message_t* msg);
int as_message_encode(char* buffer, int length, const as_message_t* msg);
/* Implemented in the network_api.c body file */
int as_message_send(as_message_t* as_msg, const void* nas_msg);
#endif /* __AS_MESSAGE_H__*/
/*
* 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
*/
/*****************************************************************************
Source network.h
Version 0.1
Date 2013/03/26
Product USIM data generator
Subsystem PLMN network operators
Author Frederic Maurel
Description Defines a list of PLMN network operators
*****************************************************************************/
#ifndef __NETWORK_H__
#define __NETWORK_H__
#include "commonDef.h"
#include "networkDef.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
/*
* PLMN network operator record index
*/
#define TEST1 0
#define SFR1 1
#define SFR2 2
#define SFR3 3
#define OAI_LTEBOX 4
#define TM1 5
#define FCT1 6
#define VDF1 7
#define VDF2 8
#define VDF3 9
#define VDF4 10
#define VDF5 11
#define SELECTED_PLMN TEST1 //SFR1
#define TEST_PLMN {0,0,0x0f,1,1,0} // 00101
#define SFR_PLMN_1 {0,2,0x0f,8,0,1} // 20810
#define SFR_PLMN_2 {0,2,0x0f,8,1,1} // 20811
#define SFR_PLMN_3 {0,2,0x0f,8,3,1} // 20813
#define OAI_LTEBOX_PLMN {0,2,0x0f,8,3,9} //20893
#define TM_PLMN_1 {1,3,0,0,8,2} // 310280
#define FCT_PLMN_1 {1,3,8,0,2,0} // 310028
#define VDF_PLMN_1 {2,2,0x0f,2,0,1} // 22210
#define VDF_PLMN_2 {1,2,0x0f,4,0x0f,1} // 2141
#define VDF_PLMN_3 {1,2,0x0f,4,0x0f,6} // 2146
#define VDF_PLMN_4 {6,2,0x0f,2,0x0f,2} // 2622
#define VDF_PLMN_5 {6,2,0x0f,2,0x0f,4} // 2624
/****************************************************************************/
/************************ G L O B A L T Y P E S ************************/
/****************************************************************************/
/*
* PLMN network operator record
*/
typedef struct {
unsigned int num;
plmn_t plmn;
char fullname[NET_FORMAT_LONG_SIZE + 1];
char shortname[NET_FORMAT_SHORT_SIZE + 1];
tac_t tac_start;
tac_t tac_end;
} network_record_t;
/****************************************************************************/
/******************** G L O B A L V A R I A B L E S ********************/
/****************************************************************************/
/*
* The list of PLMN network operator records
*/
network_record_t network_records[] = {
{00101, TEST_PLMN, "Test network", "OAI4G", 0x0001, 0xfffd},
{20810, SFR_PLMN_1, "SFR France", "SFR", 0x0001, 0xfffd},
{20811, SFR_PLMN_2, "SFR France", "SFR", 0x0001, 0xfffd},
{20813, SFR_PLMN_3, "SFR France", "SFR", 0x0001, 0xfffd},
{20893, OAI_LTEBOX_PLMN, "OAI LTEBOX", "OAIALU", 0x0001, 0xfffd},
{310280,TM_PLMN_1, "T-Mobile USA", "T-Mobile", 0x0001, 0xfffd},
{310028,FCT_PLMN_1, "FICTITIOUS USA", "FICTITIO", 0x0001, 0xfffd},
{22210, VDF_PLMN_1, "Vodafone Italia", "VODAFONE", 0x0001, 0xfffd},
{2141, VDF_PLMN_2, "Vodafone Spain", "VODAFONE", 0x0001, 0xfffd},
{2146, VDF_PLMN_3, "Vodafone Spain", "VODAFONE", 0x0001, 0xfffd},
{2622, VDF_PLMN_4, "Vodafone Germ", "VODAFONE", 0x0001, 0xfffd},
{2624, VDF_PLMN_5, "Vodafone Germ", "VODAFONE", 0x0001, 0xfffd},
};
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
#endif /* __NETWORK_H__*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <string.h>
#include "secu_defs.h"
/*!
* Derive the kNASenc from kasme and perform truncate on the generated key to
* reduce his size to 128 bits. Definition of the derivation function can
* be found in 3GPP TS.33401 #A.7
* @param[in] nas_alg_type NAS algorithm distinguisher
* @param[in] nas_enc_alg_id NAS encryption/integrity algorithm identifier.
* Possible values are:
* - 0 for EIA0 algorithm (Null Integrity Protection algorithm)
* - 1 for 128-EIA1 SNOW 3G
* - 2 for 128-EIA2 AES
* @param[in] kasme Key for MME as provided by AUC
* @param[out] knas Truncated ouput key as derived by KDF
*/
/*int derive_key_nas(algorithm_type_dist_t nas_alg_type, uint8_t nas_enc_alg_id,
const uint8_t kasme[32], uint8_t** knas)
{
uint8_t s[7];
uint8_t knas_temp[32];
// FC
s[0] = 0x15;
// P0 = algorithm type distinguisher
s[1] = nas_alg_type & 0xFF;
// L0 = length(P0) = 1
s[2] = 0x00;
s[3] = 0x01;
// P1
s[4] = nas_enc_alg_id;
// L1 = length(P1) = 1
s[5] = 0x00;
s[6] = 0x01;
kdf((uint8_t*)kasme, 32, s, 7, (uint8_t**)&knas_temp, 32);
// Truncate the generate key to 128 bits
memcpy(knas, knas_temp, 16);
return 0;
}
*/
......@@ -38,11 +38,7 @@
#include "platform_constants.h"
#include "PHY/impl_defs_lte.h"
#include "s1ap_messages_types.h"
#ifdef CMAKER
#include "SystemInformationBlockType2.h"
#else
#include "RRC/LTE/MESSAGES/SystemInformationBlockType2.h"
#endif
#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
struct in_addr inp;\
......
/*
* 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
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <libconfig.h>
#include <arpa/inet.h> /* To provide inet_addr */
#include "intertask_interface.h"
#include "assertions.h"
#include "msc.h"
#include "mme_config.h"
#include "spgw_config.h"
#include "intertask_interface_conf.h"
mme_config_t mme_config;
int mme_config_find_mnc_length(const char mcc_digit1P,
const char mcc_digit2P,
const char mcc_digit3P,
const char mnc_digit1P,
const char mnc_digit2P,
const char mnc_digit3P)
{
uint16_t mcc = 100*mcc_digit1P + 10*mcc_digit2P + mcc_digit3P;
uint16_t mnc3= 100*mnc_digit1P + 10*mnc_digit2P + mnc_digit3P;
uint16_t mnc2= 10*mnc_digit1P + mnc_digit2P;
int plmn_index = 0;
AssertFatal((mcc_digit1P >= 0) && (mcc_digit1P <= 9)
&& (mcc_digit2P >= 0) && (mcc_digit2P <= 9)
&& (mcc_digit3P >= 0) && (mcc_digit3P <= 9) ,
"BAD MCC PARAMETER (%d%d%d)!\n",
mcc_digit1P, mcc_digit2P, mcc_digit3P);
AssertFatal((mnc_digit2P >= 0) && (mnc_digit2P <= 9)
&& (mnc_digit1P >= 0) && (mnc_digit1P <= 9) ,
"BAD MNC PARAMETER (%d.%d.%d)!\n",
mnc_digit1P, mnc_digit2P, mnc_digit3P);
while (plmn_index < mme_config.gummei.nb_plmns) {
if (mme_config.gummei.plmn_mcc[plmn_index] == mcc) {
if ((mme_config.gummei.plmn_mnc[plmn_index] == mnc2) &&
(mme_config.gummei.plmn_mnc_len[plmn_index] == 2)) {
return 2;
} else if ((mme_config.gummei.plmn_mnc[plmn_index] == mnc3) &&
(mme_config.gummei.plmn_mnc_len[plmn_index] == 3)) {
return 3;
}
}
plmn_index += 1;
}
return 0;
}
static
void mme_config_init(mme_config_t *mme_config_p)
{
memset(mme_config_p, 0, sizeof(mme_config_t));
pthread_rwlock_init(&mme_config_p->rw_lock, NULL);
mme_config_p->verbosity_level = 0;
mme_config_p->config_file = NULL;
mme_config_p->max_eNBs = MAX_NUMBER_OF_ENB;
mme_config_p->max_ues = MAX_NUMBER_OF_UE;
mme_config_p->emergency_attach_supported = 0;
mme_config_p->unauthenticated_imsi_supported = 0;
/* Timer configuration */
mme_config_p->gtpv1u_config.port_number = GTPV1_U_PORT_NUMBER;
mme_config_p->s1ap_config.port_number = S1AP_PORT_NUMBER;
/* IP configuration */
mme_config_p->ipv4.sgw_ip_address_for_S1u_S12_S4_up = inet_addr(DEFAULT_SGW_IP_ADDRESS_FOR_S1U_S12_S4_UP);
mme_config_p->ipv4.mme_interface_name_for_S1_MME = DEFAULT_MME_INTERFACE_NAME_FOR_S1_MME;
mme_config_p->ipv4.mme_ip_address_for_S1_MME = inet_addr(DEFAULT_MME_IP_ADDRESS_FOR_S1_MME);
mme_config_p->ipv4.mme_interface_name_for_S11 = DEFAULT_MME_INTERFACE_NAME_FOR_S11;
mme_config_p->ipv4.mme_ip_address_for_S11 = inet_addr(DEFAULT_MME_IP_ADDRESS_FOR_S11);
mme_config_p->ipv4.sgw_ip_address_for_S11 = inet_addr(DEFAULT_SGW_IP_ADDRESS_FOR_S11);
mme_config_p->s6a_config.conf_file = S6A_CONF_FILE;
mme_config_p->itti_config.queue_size = ITTI_QUEUE_MAX_ELEMENTS;
mme_config_p->itti_config.log_file = NULL;
mme_config_p->sctp_config.in_streams = SCTP_IN_STREAMS;
mme_config_p->sctp_config.out_streams = SCTP_OUT_STREAMS;
mme_config_p->relative_capacity = RELATIVE_CAPACITY;
mme_config_p->mme_statistic_timer = MME_STATISTIC_TIMER_S;
mme_config_p->gummei.nb_mme_gid = 1;
mme_config_p->gummei.mme_gid = calloc(1, sizeof(*mme_config_p->gummei.mme_gid));
mme_config_p->gummei.mme_gid[0] = MMEGID;
mme_config_p->gummei.nb_mmec = 1;
mme_config_p->gummei.mmec = calloc(1, sizeof(*mme_config_p->gummei.mmec));
mme_config_p->gummei.mmec[0] = MMEC;
/* Set the TAI */
mme_config_p->gummei.nb_plmns = 1;
mme_config_p->gummei.plmn_mcc = calloc(1, sizeof(*mme_config_p->gummei.plmn_mcc));
mme_config_p->gummei.plmn_mnc = calloc(1, sizeof(*mme_config_p->gummei.plmn_mnc));
mme_config_p->gummei.plmn_mnc_len = calloc(1, sizeof(*mme_config_p->gummei.plmn_mnc_len));
mme_config_p->gummei.plmn_tac = calloc(1, sizeof(*mme_config_p->gummei.plmn_tac));
mme_config_p->gummei.plmn_mcc[0] = PLMN_MCC;
mme_config_p->gummei.plmn_mnc[0] = PLMN_MNC;
mme_config_p->gummei.plmn_mnc_len[0] = PLMN_MNC_LEN;
mme_config_p->gummei.plmn_tac[0] = PLMN_TAC;
mme_config_p->s1ap_config.outcome_drop_timer_sec = S1AP_OUTCOME_TIMER_DEFAULT;
}
int mme_system(char *command_pP, int abort_on_errorP)
{
int ret = -1;
if (command_pP) {
fprintf(stdout, "system command: %s\n",command_pP);
ret = system(command_pP);
if (ret < 0) {
fprintf(stderr, "ERROR in system command %s: %d\n",
command_pP,ret);
if (abort_on_errorP) {
exit(-1); // may be not exit
}
}
}
return ret;
}
static int config_parse_file(mme_config_t *mme_config_p)
{
config_t cfg;
config_setting_t *setting_mme = NULL;
config_setting_t *setting = NULL;
config_setting_t *subsetting = NULL;
config_setting_t *sub2setting = NULL;
long int alongint;
int i, num;
char *astring = NULL;
char *address = NULL;
char *cidr = NULL;
const char* tac = NULL;
const char* mcc = NULL;
const char* mnc = NULL;
char *sgw_ip_address_for_S1u_S12_S4_up = NULL;
char *mme_interface_name_for_S1_MME = NULL;
char *mme_ip_address_for_S1_MME = NULL;
char *mme_interface_name_for_S11 = NULL;
char *mme_ip_address_for_S11 = NULL;
char *sgw_ip_address_for_S11 = NULL;
char system_cmd[256];
config_init(&cfg);
if(mme_config_p->config_file != NULL) {
/* Read the file. If there is an error, report it and exit. */
if(! config_read_file(&cfg, mme_config_p->config_file)) {
fprintf(stdout, "ERROR: %s:%d - %s\n", mme_config_p->config_file, config_error_line(&cfg), config_error_text(&cfg));
config_destroy(&cfg);
AssertFatal (1 == 0, "Failed to parse MME configuration file %s!\n", mme_config_p->config_file);
}
} else {
fprintf(stdout, "ERROR No MME configuration file provided!\n");
config_destroy(&cfg);
AssertFatal (0, "No MME configuration file provided!\n");
}
setting_mme = config_lookup(&cfg, MME_CONFIG_STRING_MME_CONFIG);
if(setting_mme != NULL) {
// GENERAL MME SETTINGS
if( (config_setting_lookup_string( setting_mme, MME_CONFIG_STRING_REALM, (const char **)&astring) )) {
mme_config_p->realm = strdup(astring);
mme_config_p->realm_length = strlen(mme_config_p->realm);
}
if( (config_setting_lookup_int( setting_mme, MME_CONFIG_STRING_MAXENB, &alongint) )) {
mme_config_p->max_eNBs = (uint32_t)alongint;
}
if( (config_setting_lookup_int( setting_mme, MME_CONFIG_STRING_MAXUE, &alongint) )) {
mme_config_p->max_ues = (uint32_t)alongint;
}
if( (config_setting_lookup_int( setting_mme, MME_CONFIG_STRING_RELATIVE_CAPACITY, &alongint) )) {
mme_config_p->relative_capacity = (uint8_t)alongint;
}
if( (config_setting_lookup_int( setting_mme, MME_CONFIG_STRING_STATISTIC_TIMER, &alongint) )) {
mme_config_p->mme_statistic_timer = (uint32_t)alongint;
}
if( (config_setting_lookup_string( setting_mme, MME_CONFIG_STRING_EMERGENCY_ATTACH_SUPPORTED, (const char **)&astring) )) {
if (strcasecmp(astring , "yes") == 0)
mme_config_p->emergency_attach_supported = 1;
else
mme_config_p->emergency_attach_supported = 0;
}
if( (config_setting_lookup_string( setting_mme, MME_CONFIG_STRING_UNAUTHENTICATED_IMSI_SUPPORTED, (const char **)&astring) )) {
if (strcasecmp(astring , "yes") == 0)
mme_config_p->unauthenticated_imsi_supported = 1;
else
mme_config_p->unauthenticated_imsi_supported = 0;
}
if( (config_setting_lookup_string( setting_mme, MME_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) {
if (strcasecmp(astring , MME_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0)
mme_config_p->verbosity_level = 0;
else if (strcasecmp(astring , MME_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0)
mme_config_p->verbosity_level = 2;
else if (strcasecmp(astring , MME_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0)
mme_config_p->verbosity_level = 1;
else
mme_config_p->verbosity_level = 0;
}
// ITTI SETTING
setting = config_setting_get_member (setting_mme, MME_CONFIG_STRING_INTERTASK_INTERFACE_CONFIG);
if (setting != NULL) {
if( (config_setting_lookup_int( setting, MME_CONFIG_STRING_INTERTASK_INTERFACE_QUEUE_SIZE, &alongint) )) {
mme_config_p->itti_config.queue_size = (uint32_t)alongint;
}
}
// S6A SETTING
setting = config_setting_get_member (setting_mme, MME_CONFIG_STRING_S6A_CONFIG);
if (setting != NULL) {
if( (config_setting_lookup_string( setting, MME_CONFIG_STRING_S6A_CONF_FILE_PATH, (const char **)&astring) )) {
if (astring != NULL)
mme_config_p->s6a_config.conf_file = strdup(astring);
}
if( (config_setting_lookup_string( setting, MME_CONFIG_STRING_S6A_HSS_HOSTNAME, (const char **)&astring) )) {
if (astring != NULL)
mme_config_p->s6a_config.hss_host_name = strdup(astring);
else
AssertFatal (1 == 0,
"You have to provide a valid HSS hostname %s=...\n",
MME_CONFIG_STRING_S6A_HSS_HOSTNAME);
}
}
// SCTP SETTING
setting = config_setting_get_member (setting_mme, MME_CONFIG_STRING_SCTP_CONFIG);
if (setting != NULL) {
if( (config_setting_lookup_int( setting, MME_CONFIG_STRING_SCTP_INSTREAMS, &alongint) )) {
mme_config_p->sctp_config.in_streams = (uint16_t)alongint;
}
if( (config_setting_lookup_int( setting, MME_CONFIG_STRING_SCTP_OUTSTREAMS, &alongint) )) {
mme_config_p->sctp_config.out_streams = (uint16_t)alongint;
}
}
// S1AP SETTING
setting = config_setting_get_member (setting_mme, MME_CONFIG_STRING_S1AP_CONFIG);
if (setting != NULL) {
if( (config_setting_lookup_int( setting, MME_CONFIG_STRING_S1AP_OUTCOME_TIMER, &alongint) )) {
mme_config_p->s1ap_config.outcome_drop_timer_sec = (uint8_t)alongint;
}
if( (config_setting_lookup_int( setting, MME_CONFIG_STRING_S1AP_PORT, &alongint) )) {
mme_config_p->s1ap_config.port_number = (uint16_t)alongint;
}
}
// GUMMEI SETTING
setting = config_setting_get_member (setting_mme, MME_CONFIG_STRING_GUMMEI_CONFIG);
if (setting != NULL) {
subsetting = config_setting_get_member (setting, MME_CONFIG_STRING_MME_CODE);
if (subsetting != NULL) {
num = config_setting_length(subsetting);
if (mme_config_p->gummei.nb_mmec != num) {
if (mme_config_p->gummei.mmec != NULL) {
free(mme_config_p->gummei.mmec);
}
mme_config_p->gummei.mmec = calloc(num, sizeof(*mme_config_p->gummei.mmec));
}
mme_config_p->gummei.nb_mmec = num;
for (i = 0; i < num; i++) {
mme_config_p->gummei.mmec[i] = config_setting_get_int_elem(subsetting, i);
}
}
subsetting = config_setting_get_member (setting, MME_CONFIG_STRING_MME_GID);
if (subsetting != NULL) {
num = config_setting_length(subsetting);
if (mme_config_p->gummei.nb_mme_gid != num) {
if (mme_config_p->gummei.mme_gid != NULL) {
free(mme_config_p->gummei.mme_gid);
}
mme_config_p->gummei.mme_gid = calloc(num, sizeof(*mme_config_p->gummei.mme_gid));
}
mme_config_p->gummei.nb_mme_gid = num;
for (i = 0; i < num; i++) {
mme_config_p->gummei.mme_gid[i] = config_setting_get_int_elem(subsetting, i);
}
}
subsetting = config_setting_get_member (setting, MME_CONFIG_STRING_TAI_LIST);
if (subsetting != NULL) {
num = config_setting_length(subsetting);
if (mme_config_p->gummei.nb_plmns != num) {
if (mme_config_p->gummei.plmn_mcc != NULL) free(mme_config_p->gummei.plmn_mcc);
if (mme_config_p->gummei.plmn_mnc != NULL) free(mme_config_p->gummei.plmn_mnc);
if (mme_config_p->gummei.plmn_mnc_len != NULL) free(mme_config_p->gummei.plmn_mnc_len);
if (mme_config_p->gummei.plmn_tac != NULL) free(mme_config_p->gummei.plmn_tac);
mme_config_p->gummei.plmn_mcc = calloc(num, sizeof(*mme_config_p->gummei.plmn_mcc));
mme_config_p->gummei.plmn_mnc = calloc(num, sizeof(*mme_config_p->gummei.plmn_mnc));
mme_config_p->gummei.plmn_mnc_len = calloc(num, sizeof(*mme_config_p->gummei.plmn_mnc_len));
mme_config_p->gummei.plmn_tac = calloc(num, sizeof(*mme_config_p->gummei.plmn_tac));
}
mme_config_p->gummei.nb_plmns = num;
for (i = 0; i < num; i++) {
sub2setting = config_setting_get_elem(subsetting, i);
if (sub2setting != NULL) {
if( (config_setting_lookup_string( sub2setting, MME_CONFIG_STRING_MCC, &mcc) )) {
mme_config_p->gummei.plmn_mcc[i] = (uint16_t)atoi(mcc);
}
if( (config_setting_lookup_string( sub2setting, MME_CONFIG_STRING_MNC, &mnc) )) {
mme_config_p->gummei.plmn_mnc[i] = (uint16_t)atoi(mnc);
mme_config_p->gummei.plmn_mnc_len[i] = strlen(mnc);
AssertFatal((mme_config_p->gummei.plmn_mnc_len[i] == 2) || (mme_config_p->gummei.plmn_mnc_len[i] == 3),
"Bad MNC length %u, must be 2 or 3", mme_config_p->gummei.plmn_mnc_len[i]);
}
if( (config_setting_lookup_string( sub2setting, MME_CONFIG_STRING_TAC, &tac) )) {
mme_config_p->gummei.plmn_tac[i] = (uint16_t)atoi(tac);
AssertFatal(mme_config_p->gummei.plmn_tac[i] != 0,
"TAC must not be 0");
}
}
}
}
}
// NETWORK INTERFACE SETTING
setting = config_setting_get_member (setting_mme, MME_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
if(setting != NULL) {
if( (
config_setting_lookup_string( setting, MME_CONFIG_STRING_INTERFACE_NAME_FOR_S1_MME,
(const char **)&mme_interface_name_for_S1_MME)
&& config_setting_lookup_string( setting, MME_CONFIG_STRING_IPV4_ADDRESS_FOR_S1_MME,
(const char **)&mme_ip_address_for_S1_MME)
&& config_setting_lookup_string( setting, MME_CONFIG_STRING_INTERFACE_NAME_FOR_S11_MME,
(const char **)&mme_interface_name_for_S11)
&& config_setting_lookup_string( setting, MME_CONFIG_STRING_IPV4_ADDRESS_FOR_S11_MME,
(const char **)&mme_ip_address_for_S11)
)
) {
mme_config_p->ipv4.mme_interface_name_for_S1_MME = strdup(mme_interface_name_for_S1_MME);
cidr = strdup(mme_ip_address_for_S1_MME);
address = strtok(cidr, "/");
IPV4_STR_ADDR_TO_INT_NWBO ( address, mme_config_p->ipv4.mme_ip_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR MME S1_MME !\n" )
free(cidr);
mme_config_p->ipv4.mme_interface_name_for_S11 = strdup(mme_interface_name_for_S11);
cidr = strdup(mme_ip_address_for_S11);
address = strtok(cidr, "/");
IPV4_STR_ADDR_TO_INT_NWBO ( address, mme_config_p->ipv4.mme_ip_address_for_S11, "BAD IP ADDRESS FORMAT FOR MME S11 !\n" )
free(cidr);
if (strncasecmp("tun",mme_config_p->ipv4.mme_interface_name_for_S1_MME, strlen("tun")) == 0) {
if (snprintf(system_cmd, 256,
"ip link set %s down ;openvpn --rmtun --dev %s",
mme_config_p->ipv4.mme_interface_name_for_S1_MME,
mme_config_p->ipv4.mme_interface_name_for_S1_MME
) > 0) {
mme_system(system_cmd, 1);
} else {
fprintf(stderr, "Del %s\n", mme_config_p->ipv4.mme_interface_name_for_S1_MME);
}
if (snprintf(system_cmd, 256,
"openvpn --mktun --dev %s;sync;ifconfig %s up;sync",
mme_config_p->ipv4.mme_interface_name_for_S1_MME,
mme_config_p->ipv4.mme_interface_name_for_S1_MME) > 0) {
mme_system(system_cmd, 1);
} else {
fprintf(stderr, "Create %s\n", mme_config_p->ipv4.mme_interface_name_for_S1_MME);
}
if (snprintf(system_cmd, 256,
"ip -4 addr add %s dev %s",
mme_ip_address_for_S1_MME,
mme_config_p->ipv4.mme_interface_name_for_S1_MME) > 0) {
mme_system(system_cmd, 1);
} else {
fprintf(stderr, "Set IPv4 address on %s\n", mme_config_p->ipv4.mme_interface_name_for_S1_MME);
}
}
}
}
// NAS SETTING
setting = config_setting_get_member (setting_mme, MME_CONFIG_STRING_NAS_CONFIG);
if (setting != NULL) {
subsetting = config_setting_get_member (setting, MME_CONFIG_STRING_NAS_SUPPORTED_INTEGRITY_ALGORITHM_LIST);
if (subsetting != NULL) {
num = config_setting_length(subsetting);
if (num <= 8) {
for (i = 0; i < num; i++) {
astring = config_setting_get_string_elem(subsetting, i);
if (strcmp("EIA0", astring) == 0) mme_config_p->nas_config.prefered_integrity_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EIA0;
else if (strcmp("EIA1", astring) == 0) mme_config_p->nas_config.prefered_integrity_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EIA1;
else if (strcmp("EIA2", astring) == 0) mme_config_p->nas_config.prefered_integrity_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EIA2;
else if (strcmp("EIA3", astring) == 0) mme_config_p->nas_config.prefered_integrity_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EIA0;
else if (strcmp("EIA4", astring) == 0) mme_config_p->nas_config.prefered_integrity_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EIA0;
else if (strcmp("EIA5", astring) == 0) mme_config_p->nas_config.prefered_integrity_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EIA0;
else if (strcmp("EIA6", astring) == 0) mme_config_p->nas_config.prefered_integrity_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EIA0;
else if (strcmp("EIA7", astring) == 0) mme_config_p->nas_config.prefered_integrity_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EIA0;
}
for (i = num; i < 8; i++) {
mme_config_p->nas_config.prefered_integrity_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EIA0;
}
}
}
subsetting = config_setting_get_member (setting, MME_CONFIG_STRING_NAS_SUPPORTED_CIPHERING_ALGORITHM_LIST);
if (subsetting != NULL) {
num = config_setting_length(subsetting);
if (num <= 8) {
for (i = 0; i < num; i++) {
astring = config_setting_get_string_elem(subsetting, i);
if (strcmp("EEA0", astring) == 0) mme_config_p->nas_config.prefered_ciphering_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EEA0;
else if (strcmp("EEA1", astring) == 0) mme_config_p->nas_config.prefered_ciphering_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EEA1;
else if (strcmp("EEA2", astring) == 0) mme_config_p->nas_config.prefered_ciphering_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EEA2;
else if (strcmp("EEA3", astring) == 0) mme_config_p->nas_config.prefered_ciphering_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EEA0;
else if (strcmp("EEA4", astring) == 0) mme_config_p->nas_config.prefered_ciphering_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EEA0;
else if (strcmp("EEA5", astring) == 0) mme_config_p->nas_config.prefered_ciphering_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EEA0;
else if (strcmp("EEA6", astring) == 0) mme_config_p->nas_config.prefered_ciphering_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EEA0;
else if (strcmp("EEA7", astring) == 0) mme_config_p->nas_config.prefered_ciphering_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EEA0;
}
for (i = num; i < 8; i++) {
mme_config_p->nas_config.prefered_ciphering_algorithm[i] = NAS_CONFIG_SECURITY_ALGORITHMS_EEA0;
}
}
}
}
}
setting = config_lookup(&cfg, SGW_CONFIG_STRING_SGW_CONFIG);
if(setting != NULL) {
subsetting = config_setting_get_member (setting, SGW_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
if(subsetting != NULL) {
if( (
config_setting_lookup_string( subsetting, SGW_CONFIG_STRING_SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP,
(const char **)&sgw_ip_address_for_S1u_S12_S4_up)
&& config_setting_lookup_string( subsetting, SGW_CONFIG_STRING_SGW_IPV4_ADDRESS_FOR_S11,
(const char **)&sgw_ip_address_for_S11)
&& config_setting_lookup_int( subsetting, SGW_CONFIG_STRING_SGW_PORT_FOR_S1U_S12_S4_UP, &alongint)
)
) {
cidr = strdup(sgw_ip_address_for_S1u_S12_S4_up);
address = strtok(cidr, "/");
IPV4_STR_ADDR_TO_INT_NWBO ( address, mme_config_p->ipv4.sgw_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR SGW S1u_S12_S4 !\n" )
free(cidr);
cidr = strdup(sgw_ip_address_for_S11);
address = strtok(cidr, "/");
IPV4_STR_ADDR_TO_INT_NWBO ( address, mme_config_p->ipv4.sgw_ip_address_for_S11, "BAD IP ADDRESS FORMAT FOR SGW S11 !\n" )
free(cidr);
mme_config_p->gtpv1u_config.port_number = (uint16_t) alongint;
}
}
}
return 0;
}
#define DISPLAY_ARRAY(size, format, args...) \
do { \
int i; \
for (i = 0; i < size; i++) { \
fprintf(stdout, format, args); \
if ((i != (size - 1)) && ((i + 1) % 10 == 0)) \
{ \
fprintf(stdout, "\n "); \
} \
} \
if (i > 0) \
fprintf(stdout, "\n"); \
} while(0)
static void config_display(mme_config_t *mme_config_p)
{
int j;
fprintf(stdout, "==== EURECOM %s v%s ====\n", PACKAGE_NAME, PACKAGE_VERSION);
fprintf(stdout, "Configuration:\n");
fprintf(stdout, "- File ...............: %s\n", mme_config_p->config_file);
fprintf(stdout, "- Verbosity level ....: %d\n", mme_config_p->verbosity_level);
fprintf(stdout, "- Realm ..............: %s\n", mme_config_p->realm);
fprintf(stdout, "- Max eNBs ...........: %u\n", mme_config_p->max_eNBs);
fprintf(stdout, "- Max UEs ............: %u\n", mme_config_p->max_ues);
fprintf(stdout, "- Emergency support ..: %s\n", mme_config_p->emergency_attach_supported == 0 ? "FALSE" : "TRUE");
fprintf(stdout, "- Unauth IMSI support : %s\n", mme_config_p->unauthenticated_imsi_supported == 0 ? "FALSE" : "TRUE");
fprintf(stdout, "- Relative capa ......: %u\n\n", mme_config_p->relative_capacity);
fprintf(stdout, "- Statistics timer ...: %u (seconds)\n\n", mme_config_p->mme_statistic_timer);
fprintf(stdout, "- S1-U:\n");
fprintf(stdout, " port number ......: %d\n", mme_config_p->gtpv1u_config.port_number);
fprintf(stdout, "- S1-MME:\n");
fprintf(stdout, " port number ......: %d\n", mme_config_p->s1ap_config.port_number);
fprintf(stdout, "- IP:\n");
//fprintf(stdout, " s1-u iface .......: %s\n", mme_config_p->ipv4.sgw_interface_name_for_S1u_S12_S4_up);
fprintf(stdout, " s1-u ip ..........: %s\n",
inet_ntoa(*((struct in_addr *)&mme_config_p->ipv4.sgw_ip_address_for_S1u_S12_S4_up)));
//fprintf(stdout, " sgi iface ........: %s\n", mme_config_p->ipv4.pgw_interface_name_for_SGI);
//fprintf(stdout, " sgi ip ...........: %s/%d\n",
// inet_ntoa(*((struct in_addr *)&mme_config_p->ipv4.pgw_ip_addr_for_SGI)),
// mme_config_p->ipv4.pgw_ip_netmask_for_SGI);
fprintf(stdout, " s1-MME iface .....: %s\n", mme_config_p->ipv4.mme_interface_name_for_S1_MME);
fprintf(stdout, " s1-MME ip ........: %s\n",
inet_ntoa(*((struct in_addr *)&mme_config_p->ipv4.mme_ip_address_for_S1_MME)));
//fprintf(stdout, " s11 S-GW iface ...: %s\n", mme_config_p->ipv4.sgw_interface_name_for_S11);
//fprintf(stdout, " s11 S-GW ip ......: %s/%d\n",
// inet_ntoa(*((struct in_addr *)&mme_config_p->ipv4.sgw_ip_address_for_S11)),
// mme_config_p->ipv4.sgw_ip_netmask_for_S11);
fprintf(stdout, " s11 MME iface ....: %s\n", mme_config_p->ipv4.mme_interface_name_for_S11);
fprintf(stdout, " s11 S-GW ip ......: %s\n",
inet_ntoa(*((struct in_addr *)&mme_config_p->ipv4.mme_ip_address_for_S11)));
fprintf(stdout, "- ITTI:\n");
fprintf(stdout, " queue size .......: %u (bytes)\n", mme_config_p->itti_config.queue_size);
fprintf(stdout, " log file .........: %s\n", mme_config_p->itti_config.log_file);
fprintf(stdout, "- SCTP:\n");
fprintf(stdout, " in streams .......: %u\n", mme_config_p->sctp_config.in_streams);
fprintf(stdout, " out streams ......: %u\n", mme_config_p->sctp_config.out_streams);
fprintf(stdout, "- GUMMEI:\n");
fprintf(stdout, " mme group ids ....:\n ");
DISPLAY_ARRAY(mme_config_p->gummei.nb_mme_gid, "| %u ", mme_config_p->gummei.mme_gid[i]);
fprintf(stdout, " mme codes ........:\n ");
DISPLAY_ARRAY(mme_config_p->gummei.nb_mmec, "| %u ", mme_config_p->gummei.mmec[i]);
fprintf(stdout, " plmns ............: (mcc.mnc:tac)\n");
for (j= 0; j < mme_config_p->gummei.nb_plmns; j++) {
if (mme_config_p->gummei.plmn_mnc_len[j] ==2 ) {
fprintf(stdout, " %3u.%3u:%u\n",
mme_config_p->gummei.plmn_mcc[j],
mme_config_p->gummei.plmn_mnc[j],
mme_config_p->gummei.plmn_tac[j]);
} else {
fprintf(stdout, " %3u.%03u:%u\n",
mme_config_p->gummei.plmn_mcc[j],
mme_config_p->gummei.plmn_mnc[j],
mme_config_p->gummei.plmn_tac[j]);
}
}
fprintf(stdout, "- S6A:\n");
fprintf(stdout, " conf file ........: %s\n", mme_config_p->s6a_config.conf_file);
}
static void usage(void)
{
fprintf(stdout, "==== EURECOM %s v%s ====\n", PACKAGE_NAME, PACKAGE_VERSION);
fprintf(stdout, "Please report any bug to: %s\n\n", PACKAGE_BUGREPORT);
fprintf(stdout, "Usage: oaisim_mme [options]\n\n");
fprintf(stdout, "Available options:\n");
fprintf(stdout, "-h Print this help and return\n");
fprintf(stdout, "-c<path>\n");
fprintf(stdout, " Set the configuration file for mme\n");
fprintf(stdout, " See template in UTILS/CONF\n");
fprintf(stdout, "-K<file>\n");
fprintf(stdout, " Output intertask messages to provided file\n");
fprintf(stdout, "-V Print %s version and return\n", PACKAGE_NAME);
fprintf(stdout, "-v[1-2] Debug level:\n");
fprintf(stdout, " 1 -> ASN1 XER printf on and ASN1 debug off\n");
fprintf(stdout, " 2 -> ASN1 XER printf on and ASN1 debug on\n");
}
extern void
nwGtpv1uDisplayBanner(void);
int config_parse_opt_line(int argc, char *argv[], mme_config_t *mme_config_p)
{
int c;
mme_config_init(mme_config_p);
/* Parsing command line */
while ((c = getopt (argc, argv, "O:c:hi:K:v:V")) != -1) {
switch (c) {
case 'O':
case 'c': {
/* Store the given configuration file. If no file is given,
* then the default values will be used.
*/
int config_file_len = 0;
config_file_len = strlen(optarg);
mme_config_p->config_file = malloc(sizeof(char) * (config_file_len + 1));
memcpy(mme_config_p->config_file, optarg, config_file_len);
mme_config_p->config_file[config_file_len] = '\0';
}
break;
case 'v': {
mme_config_p->verbosity_level = atoi(optarg);
}
break;
case 'V': {
fprintf(stdout, "==== EURECOM %s v%s ====\n"
"Please report any bug to: %s\n", PACKAGE_NAME, PACKAGE_VERSION,
PACKAGE_BUGREPORT);
exit(0);
nwGtpv1uDisplayBanner();
}
break;
case 'K':
mme_config_p->itti_config.log_file = strdup(optarg);
break;
case 'h': /* Fall through */
default:
usage();
exit(0);
}
}
/* Parse the configuration file using libconfig */
if (config_parse_file(mme_config_p) != 0) {
return -1;
}
/* Display the configuration */
config_display(mme_config_p);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment