Merge remote-tracking branch 'origin/develop' into enhancement-ltem
This commit is contained in:
@@ -218,7 +218,7 @@ pipeline {
|
||||
buildStageStatus = false
|
||||
}
|
||||
}
|
||||
sh "python3 main.py --mode=FinalizeHtml --finalStatus=${buildStageStatus}"
|
||||
sh "python3 main.py --mode=FinalizeHtml --finalStatus=${buildStageStatus} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,8 +197,8 @@ MACRLCs = (
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 200;
|
||||
puCch10xSnr = 200;
|
||||
puSch10xSnr = 160;
|
||||
puCch10xSnr = 160;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -227,7 +227,7 @@ RUs = (
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
|
||||
@@ -197,8 +197,8 @@ MACRLCs = (
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 200;
|
||||
puCch10xSnr = 200;
|
||||
puSch10xSnr = 160;
|
||||
puCch10xSnr = 160;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -218,7 +218,7 @@ RUs = (
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 115;
|
||||
max_rxgain = 125;
|
||||
eNB_instances = [0];
|
||||
|
||||
}
|
||||
@@ -227,7 +227,7 @@ RUs = (
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
|
||||
@@ -197,8 +197,8 @@ MACRLCs = (
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 200;
|
||||
puCch10xSnr = 200;
|
||||
puSch10xSnr = 160;
|
||||
puCch10xSnr = 160;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -218,7 +218,7 @@ RUs = (
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 115;
|
||||
max_rxgain = 120;
|
||||
eNB_instances = [0];
|
||||
|
||||
}
|
||||
@@ -227,7 +227,7 @@ RUs = (
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
|
||||
@@ -200,8 +200,8 @@ MACRLCs = (
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 200;
|
||||
puCch10xSnr = 200;
|
||||
puSch10xSnr = 160;
|
||||
puCch10xSnr = 160;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -234,7 +234,7 @@ RUs = (
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
|
||||
@@ -200,8 +200,8 @@ MACRLCs = (
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 200;
|
||||
puCch10xSnr = 200;
|
||||
puSch10xSnr = 160;
|
||||
puCch10xSnr = 160;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -234,7 +234,7 @@ RUs = (
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
|
||||
@@ -200,8 +200,8 @@ MACRLCs = (
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 200;
|
||||
puCch10xSnr = 200;
|
||||
puSch10xSnr = 160;
|
||||
puCch10xSnr = 160;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -234,7 +234,7 @@ RUs = (
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ RUs = (
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
|
||||
+146
-55
@@ -42,6 +42,7 @@ ENB_PROCESS_OK = +1
|
||||
ENB_PROCESS_SEG_FAULT = -11
|
||||
ENB_PROCESS_ASSERTION = -12
|
||||
ENB_PROCESS_REALTIME_ISSUE = -13
|
||||
ENB_PROCESS_NOLOGFILE_TO_ANALYZE = -14
|
||||
HSS_PROCESS_FAILED = -2
|
||||
HSS_PROCESS_OK = +2
|
||||
MME_PROCESS_FAILED = -3
|
||||
@@ -118,6 +119,12 @@ class SSHConnection():
|
||||
self.htmlTabNames = []
|
||||
self.htmlTabIcons = []
|
||||
self.finalStatus = False
|
||||
self.eNBOsVersion = ''
|
||||
self.eNBKernelVersion = ''
|
||||
self.eNBUhdVersion = ''
|
||||
self.eNBCpuNb = ''
|
||||
self.eNBCpuModel = ''
|
||||
self.eNBCpuMHz = ''
|
||||
|
||||
def open(self, ipaddress, username, password):
|
||||
count = 0
|
||||
@@ -203,59 +210,81 @@ class SSHConnection():
|
||||
logging.debug('\u001B[1;37;41m Unexpected Others during closing\u001B[0m')
|
||||
|
||||
def copyin(self, ipaddress, username, password, source, destination):
|
||||
count = 0
|
||||
copy_status = False
|
||||
logging.debug('scp '+ username + '@' + ipaddress + ':' + source + ' ' + destination)
|
||||
scp_spawn = pexpect.spawn('scp '+ username + '@' + ipaddress + ':' + source + ' ' + destination, timeout = 5)
|
||||
scp_response = scp_spawn.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0:
|
||||
scp_spawn.sendline('yes')
|
||||
scp_spawn.expect('password:')
|
||||
scp_spawn.sendline(password)
|
||||
scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
while count < 10:
|
||||
scp_spawn = pexpect.spawn('scp '+ username + '@' + ipaddress + ':' + source + ' ' + destination, timeout = 5)
|
||||
scp_response = scp_spawn.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0:
|
||||
pass
|
||||
scp_spawn.sendline('yes')
|
||||
scp_spawn.expect('password:')
|
||||
scp_spawn.sendline(password)
|
||||
scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0:
|
||||
count = 10
|
||||
copy_status = True
|
||||
else:
|
||||
logging.debug('1 - scp_response = ' + str(scp_response))
|
||||
elif scp_response == 1:
|
||||
scp_spawn.sendline(password)
|
||||
scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0 or scp_response == 3:
|
||||
count = 10
|
||||
copy_status = True
|
||||
else:
|
||||
logging.debug('2 - scp_response = ' + str(scp_response))
|
||||
elif scp_response == 2:
|
||||
count = 10
|
||||
copy_status = True
|
||||
else:
|
||||
logging.debug('1 - scp_response = ' + str(scp_response))
|
||||
sys.exit('SCP failed')
|
||||
elif scp_response == 1:
|
||||
scp_spawn.sendline(password)
|
||||
scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0 or scp_response == 3:
|
||||
pass
|
||||
else:
|
||||
logging.debug('2 - scp_response = ' + str(scp_response))
|
||||
sys.exit('SCP failed')
|
||||
elif scp_response == 2:
|
||||
pass
|
||||
logging.debug('3 - scp_response = ' + str(scp_response))
|
||||
# adding a tempo when failure
|
||||
if not copy_status:
|
||||
time.sleep(1)
|
||||
count += 1
|
||||
if copy_status:
|
||||
return 0
|
||||
else:
|
||||
logging.debug('3 - scp_response = ' + str(scp_response))
|
||||
sys.exit('SCP failed')
|
||||
return -1
|
||||
|
||||
def copyout(self, ipaddress, username, password, source, destination):
|
||||
count = 0
|
||||
copy_status = False
|
||||
logging.debug('scp ' + source + ' ' + username + '@' + ipaddress + ':' + destination)
|
||||
scp_spawn = pexpect.spawn('scp ' + source + ' ' + username + '@' + ipaddress + ':' + destination, timeout = 5)
|
||||
scp_response = scp_spawn.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0:
|
||||
scp_spawn.sendline('yes')
|
||||
scp_spawn.expect('password:')
|
||||
scp_spawn.sendline(password)
|
||||
scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
while count < 4:
|
||||
scp_spawn = pexpect.spawn('scp ' + source + ' ' + username + '@' + ipaddress + ':' + destination, timeout = 5)
|
||||
scp_response = scp_spawn.expect(['Are you sure you want to continue connecting (yes/no)?', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0:
|
||||
pass
|
||||
scp_spawn.sendline('yes')
|
||||
scp_spawn.expect('password:')
|
||||
scp_spawn.sendline(password)
|
||||
scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0:
|
||||
count = 10
|
||||
copy_status = True
|
||||
else:
|
||||
logging.debug('1 - scp_response = ' + str(scp_response))
|
||||
elif scp_response == 1:
|
||||
scp_spawn.sendline(password)
|
||||
scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0 or scp_response == 3:
|
||||
count = 10
|
||||
copy_status = True
|
||||
else:
|
||||
logging.debug('2 - scp_response = ' + str(scp_response))
|
||||
elif scp_response == 2:
|
||||
count = 10
|
||||
copy_status = True
|
||||
else:
|
||||
logging.debug('1 - scp_response = ' + str(scp_response))
|
||||
sys.exit('SCP failed')
|
||||
elif scp_response == 1:
|
||||
scp_spawn.sendline(password)
|
||||
scp_response = scp_spawn.expect(['\$', 'Permission denied', 'password:', pexpect.EOF, pexpect.TIMEOUT])
|
||||
if scp_response == 0 or scp_response == 3:
|
||||
pass
|
||||
else:
|
||||
logging.debug('2 - scp_response = ' + str(scp_response))
|
||||
sys.exit('SCP failed')
|
||||
elif scp_response == 2:
|
||||
logging.debug('3 - scp_response = ' + str(scp_response))
|
||||
# adding a tempo when failure
|
||||
if not copy_status:
|
||||
time.sleep(1)
|
||||
count += 1
|
||||
if copy_status:
|
||||
pass
|
||||
else:
|
||||
logging.debug('3 - scp_response = ' + str(scp_response))
|
||||
sys.exit('SCP failed')
|
||||
|
||||
def BuildeNB(self):
|
||||
@@ -438,8 +467,9 @@ class SSHConnection():
|
||||
self.close()
|
||||
time.sleep(1)
|
||||
pcap_log_file = 'enb_' + self.testCase_id + '_s1log.pcap'
|
||||
self.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, '/tmp/' + pcap_log_file, '.')
|
||||
self.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, pcap_log_file, self.eNBSourceCodePath + '/cmake_targets/.')
|
||||
copyin_res = self.copyin(self.EPCIPAddress, self.EPCUserName, self.EPCPassword, '/tmp/' + pcap_log_file, '.')
|
||||
if (copyin_res == 0):
|
||||
self.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, pcap_log_file, self.eNBSourceCodePath + '/cmake_targets/.')
|
||||
sys.exit(1)
|
||||
else:
|
||||
self.command('stdbuf -o0 cat enb_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync"', '\$', 4)
|
||||
@@ -1694,7 +1724,8 @@ class SSHConnection():
|
||||
return ENB_PROCESS_ASSERTION
|
||||
if foundRealTimeIssue:
|
||||
logging.debug('\u001B[1;37;41m eNB faced real time issues! \u001B[0m')
|
||||
return ENB_PROCESS_REALTIME_ISSUE
|
||||
self.htmleNBFailureMsg += 'eNB faced real time issues!\n'
|
||||
#return ENB_PROCESS_REALTIME_ISSUE
|
||||
if rlcDiscardBuffer > 0:
|
||||
rlcMsg = 'eNB RLC discarded ' + str(rlcDiscardBuffer) + ' buffer(s)'
|
||||
logging.debug('\u001B[1;37;41m ' + rlcMsg + ' \u001B[0m')
|
||||
@@ -1713,6 +1744,7 @@ class SSHConnection():
|
||||
result = re.search('lte-softmodem', str(self.ssh.before))
|
||||
if result is not None:
|
||||
self.command('echo ' + self.eNBPassword + ' | sudo -S killall --signal SIGKILL lte-softmodem || true', '\$', 5)
|
||||
time.sleep(5)
|
||||
self.close()
|
||||
# If tracer options is on, stopping tshark on EPC side
|
||||
result = re.search('T_stdout', str(self.Initialize_eNB_args))
|
||||
@@ -1745,7 +1777,13 @@ class SSHConnection():
|
||||
else:
|
||||
result = re.search('enb_', str(self.eNBLogFile))
|
||||
if result is not None:
|
||||
self.copyin(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, self.eNBSourceCodePath + '/cmake_targets/' + self.eNBLogFile, '.')
|
||||
copyin_res = self.copyin(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, self.eNBSourceCodePath + '/cmake_targets/' + self.eNBLogFile, '.')
|
||||
if (copyin_res == -1):
|
||||
logging.debug('\u001B[1;37;41m Could not copy eNB logfile to analyze it! \u001B[0m')
|
||||
self.htmleNBFailureMsg = 'Could not copy eNB logfile to analyze it!'
|
||||
self.CreateHtmlTestRow('N/A', 'KO', ENB_PROCESS_NOLOGFILE_TO_ANALYZE)
|
||||
self.eNBLogFile = ''
|
||||
return
|
||||
logging.debug('\u001B[1m Analyzing eNB logfile \u001B[0m')
|
||||
logStatus = self.AnalyzeLogFile_eNB(self.eNBLogFile)
|
||||
if (logStatus < 0):
|
||||
@@ -1924,6 +1962,37 @@ class SSHConnection():
|
||||
self.command('cp /opt/ltebox/var/log/xGwLog.0 .', '\$', 5)
|
||||
self.command('zip spgw.log.zip xGwLog.0', '\$', 60)
|
||||
self.close()
|
||||
def RetrieveSystemVersion(self):
|
||||
if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '':
|
||||
Usage()
|
||||
sys.exit('Insufficient Parameter')
|
||||
self.open(self.eNBIPAddress, self.eNBUserName, self.eNBPassword)
|
||||
self.command('lsb_release -a', '\$', 5)
|
||||
result = re.search('Description:\\\\t(?P<os_type>[a-zA-Z0-9\-\_\.\ ]+)', str(self.ssh.before))
|
||||
if result is not None:
|
||||
self.eNBOsVersion = result.group('os_type')
|
||||
logging.debug('OS is: ' + self.eNBOsVersion)
|
||||
self.command('uname -r', '\$', 5)
|
||||
result = re.search('uname -r\\\\r\\\\n(?P<kernel_version>[a-zA-Z0-9\-\_\.]+)', str(self.ssh.before))
|
||||
if result is not None:
|
||||
self.eNBKernelVersion = result.group('kernel_version')
|
||||
logging.debug('Kernel Version is: ' + self.eNBKernelVersion)
|
||||
self.command('dpkg --list | egrep --color=never uhd-host', '\$', 5)
|
||||
result = re.search('uhd-host *(?P<uhd_version>[0-9\.]+)', str(self.ssh.before))
|
||||
if result is not None:
|
||||
self.eNBUhdVersion = result.group('uhd_version')
|
||||
logging.debug('UHD Version is: ' + self.eNBUhdVersion)
|
||||
self.command('lscpu', '\$', 5)
|
||||
result = re.search('CPU\(s\): *(?P<nb_cpus>[0-9]+).*Model name: *(?P<model>[a-zA-Z0-9\-\_\.\ \(\)]+).*CPU MHz: *(?P<cpu_mhz>[0-9\.]+)', str(self.ssh.before))
|
||||
if result is not None:
|
||||
self.eNBCpuNb = result.group('nb_cpus')
|
||||
logging.debug('nb_cpus: ' + self.eNBCpuNb)
|
||||
self.eNBCpuModel = result.group('model')
|
||||
logging.debug('model: ' + self.eNBCpuModel)
|
||||
self.eNBCpuMHz = result.group('cpu_mhz') + ' MHz'
|
||||
logging.debug('cpu_mhz: ' + self.eNBCpuMHz)
|
||||
self.close()
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# HTML Reporting....
|
||||
#-----------------------------------------------------------
|
||||
@@ -2061,7 +2130,7 @@ class SSHConnection():
|
||||
|
||||
def CreateHtmlTabFooter(self, passStatus):
|
||||
if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)):
|
||||
self.htmlFile.write(' <tr">\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <th bgcolor = "#33CCFF" colspan=2>Final Tab Status</th>\n')
|
||||
if passStatus:
|
||||
self.htmlFile.write(' <th bgcolor = "green" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">PASS <span class="glyphicon glyphicon-ok"></span> </font></th>\n')
|
||||
@@ -2074,17 +2143,37 @@ class SSHConnection():
|
||||
|
||||
def CreateHtmlFooter(self, passStatus):
|
||||
if (os.path.isfile('test_results.html')):
|
||||
self.RetrieveSystemVersion()
|
||||
self.htmlFile = open('test_results.html', 'a')
|
||||
self.htmlFile.write('</div>\n')
|
||||
self.htmlFile.write(' <p></p>\n')
|
||||
self.htmlFile.write(' <table class="table">\n')
|
||||
self.htmlFile.write(' <tr">\n')
|
||||
self.htmlFile.write(' <th bgcolor = "#33CCFF">Final Status</th>\n')
|
||||
self.htmlFile.write(' <table class="table table-condensed">\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <th colspan=6>eNB Server Characteristics</th>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td>OS Version</td>\n')
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBOsVersion + '</span></td>\n')
|
||||
self.htmlFile.write(' <td>Kernel Version</td>\n')
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBKernelVersion + '</span></td>\n')
|
||||
self.htmlFile.write(' <td>UHD Version</td>\n')
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBUhdVersion + '</span></td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <td>Nb CPUs</td>\n')
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBCpuNb + '</span></td>\n')
|
||||
self.htmlFile.write(' <td>CPU Model Name</td>\n')
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBCpuModel + '</span></td>\n')
|
||||
self.htmlFile.write(' <td>CPU Frequency</td>\n')
|
||||
self.htmlFile.write(' <td><span class="label label-default">' + self.eNBCpuMHz + '</span></td>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <th colspan=4 bgcolor = "#33CCFF">Final Status</th>\n')
|
||||
if passStatus:
|
||||
self.htmlFile.write(' <th bgcolor="green"><font color="white">PASS <span class="glyphicon glyphicon-ok"></span></font></th>\n')
|
||||
self.htmlFile.write(' <th colspan=2 bgcolor="green"><font color="white">PASS <span class="glyphicon glyphicon-ok"></span></font></th>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <th bgcolor="red"><font color="white">FAIL <span class="glyphicon glyphicon-remove"></span> </font></th>\n')
|
||||
self.htmlFile.write(' </tr">\n')
|
||||
self.htmlFile.write(' <th colspan=2 bgcolor="red"><font color="white">FAIL <span class="glyphicon glyphicon-remove"></span> </font></th>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' </table>\n')
|
||||
self.htmlFile.write(' <p></p>\n')
|
||||
self.htmlFile.write(' <div class="well well-lg">End of Test Report -- Copyright <span class="glyphicon glyphicon-copyright-mark"></span> 2018 <a href="http://www.openairinterface.org/">OpenAirInterface</a>. All Rights Reserved.</div>\n')
|
||||
@@ -2110,7 +2199,9 @@ class SSHConnection():
|
||||
elif (processesStatus == ENB_PROCESS_ASSERTION):
|
||||
self.htmlFile.write(' <td bgcolor = "lightcoral" >KO - eNB process ended in Assertion</td>\n')
|
||||
elif (processesStatus == ENB_PROCESS_REALTIME_ISSUE):
|
||||
self.htmlFile.write(' <td bgcolor = "lightcoral" >KO - eNB process faced Real Time issue(s)/td>\n')
|
||||
self.htmlFile.write(' <td bgcolor = "lightcoral" >KO - eNB process faced Real Time issue(s)</td>\n')
|
||||
elif (processesStatus == ENB_PROCESS_NOLOGFILE_TO_ANALYZE):
|
||||
self.htmlFile.write(' <td bgcolor = "orange" >OK</td>\n')
|
||||
elif (processesStatus == HSS_PROCESS_FAILED):
|
||||
self.htmlFile.write(' <td bgcolor = "lightcoral" >KO - HSS process not found</td>\n')
|
||||
elif (processesStatus == MME_PROCESS_FAILED):
|
||||
@@ -2129,7 +2220,7 @@ class SSHConnection():
|
||||
if result is not None:
|
||||
cellBgColor = 'red'
|
||||
else:
|
||||
result = re.search('showed|Reestablishment', self.htmleNBFailureMsg)
|
||||
result = re.search('showed|Reestablishment|Could not copy eNB logfile', self.htmleNBFailureMsg)
|
||||
if result is not None:
|
||||
cellBgColor = 'orange'
|
||||
self.htmlFile.write(' <td bgcolor = "' + cellBgColor + '" colspan=' + str(self.htmlUEConnected) + '><pre style="background-color:' +
|
||||
|
||||
+50
-49
@@ -961,55 +961,56 @@ function run_test_on_vm {
|
||||
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
sleep 10
|
||||
|
||||
echo "############################################################"
|
||||
echo "Starting the eNB in TDD-20MHz mode"
|
||||
echo "############################################################"
|
||||
CURRENT_ENB_LOG_FILE=tdd_20MHz_enb.log
|
||||
start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 100 lte-tdd-basic-sim.conf none
|
||||
|
||||
echo "############################################################"
|
||||
echo "Starting the UE in TDD-20MHz mode"
|
||||
echo "############################################################"
|
||||
CURRENT_UE_LOG_FILE=tdd_20MHz_ue.log
|
||||
start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 100 2350
|
||||
if [ $UE_SYNC -eq 0 ]
|
||||
then
|
||||
echo "Problem w/ eNB and UE not syncing"
|
||||
terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
|
||||
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
|
||||
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
|
||||
exit -1
|
||||
fi
|
||||
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
|
||||
|
||||
echo "############################################################"
|
||||
echo "Pinging the UE"
|
||||
echo "############################################################"
|
||||
PING_LOG_FILE=tdd_20MHz_ping_ue.txt
|
||||
ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
|
||||
check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
|
||||
|
||||
echo "############################################################"
|
||||
echo "Iperf DL"
|
||||
echo "############################################################"
|
||||
CURR_IPERF_LOG_BASE=tdd_20MHz_iperf_dl
|
||||
iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
|
||||
check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6
|
||||
|
||||
echo "############################################################"
|
||||
echo "Terminate enb/ue simulators"
|
||||
echo "############################################################"
|
||||
terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
|
||||
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
sleep 10
|
||||
# Disabling TDD-20MHz in order to stop getting false negatives
|
||||
# echo "############################################################"
|
||||
# echo "Starting the eNB in TDD-20MHz mode"
|
||||
# echo "############################################################"
|
||||
# CURRENT_ENB_LOG_FILE=tdd_20MHz_enb.log
|
||||
# start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 100 lte-tdd-basic-sim.conf none
|
||||
#
|
||||
# echo "############################################################"
|
||||
# echo "Starting the UE in TDD-20MHz mode"
|
||||
# echo "############################################################"
|
||||
# CURRENT_UE_LOG_FILE=tdd_20MHz_ue.log
|
||||
# start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 100 2350
|
||||
# if [ $UE_SYNC -eq 0 ]
|
||||
# then
|
||||
# echo "Problem w/ eNB and UE not syncing"
|
||||
# terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR
|
||||
# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
|
||||
# recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
# terminate_ltebox_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
|
||||
# echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
|
||||
# exit -1
|
||||
# fi
|
||||
# get_ue_ip_addr $VM_CMDS $VM_IP_ADDR
|
||||
#
|
||||
# echo "############################################################"
|
||||
# echo "Pinging the UE"
|
||||
# echo "############################################################"
|
||||
# PING_LOG_FILE=tdd_20MHz_ping_ue.txt
|
||||
# ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE
|
||||
# scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
|
||||
# check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
|
||||
#
|
||||
# echo "############################################################"
|
||||
# echo "Iperf DL"
|
||||
# echo "############################################################"
|
||||
# CURR_IPERF_LOG_BASE=tdd_20MHz_iperf_dl
|
||||
# iperf_dl $VM_CMDS $VM_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR 6 $CURR_IPERF_LOG_BASE
|
||||
# scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
|
||||
# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
|
||||
# check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE 6
|
||||
#
|
||||
# echo "############################################################"
|
||||
# echo "Terminate enb/ue simulators"
|
||||
# echo "############################################################"
|
||||
# terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR
|
||||
# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
# scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
|
||||
# recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
# sleep 10
|
||||
|
||||
echo "############################################################"
|
||||
echo "Terminate EPC"
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
040101
|
||||
030121 040301 040521 040623 040624 040625 040626 040627 040662 040661 040663 040664 040401 040201 030201
|
||||
030121 040301 040521 040623 040624 040625 040662 040401 040201 030201
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
<TestCaseExclusionList>040626 040627 040661 040663 040664</TestCaseExclusionList>
|
||||
|
||||
<testCase id="030121">
|
||||
<class>Initialize_eNB</class>
|
||||
@@ -110,16 +110,16 @@
|
||||
|
||||
<testCase id="040661">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - UL/20Mbps/UDP)(30 sec)(balanced profile)</desc>
|
||||
<iperf_args>-u -b 20M -t 30 -i 1 -R</iperf_args>
|
||||
<desc>iperf (20MHz - UL/12Mbps/UDP)(30 sec)(balanced profile)</desc>
|
||||
<iperf_args>-u -b 12M -t 30 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040662">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 20M -t 30 -i 1 -R</iperf_args>
|
||||
<desc>iperf (20MHz - UL/17Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 17M -t 30 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
@@ -94,9 +94,9 @@
|
||||
|
||||
<testCase id="040652">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 20M -t 30 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<desc>iperf (10MHz - UL/5Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 5M -t 30 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>60</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
|
||||
@@ -86,16 +86,16 @@
|
||||
|
||||
<testCase id="040624">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - DL/70Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 70M -t 30 -i 1</iperf_args>
|
||||
<desc>iperf (20MHz - DL/50Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 50M -t 30 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040662">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - UL/20Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 20M -t 30 -i 1 -R</iperf_args>
|
||||
<desc>iperf (20MHz - UL/10Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 10M -t 30 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -2156,7 +2155,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
|
||||
@@ -2176,7 +2174,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")
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
if ( value == NULL) {
|
||||
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
|
||||
fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
|
||||
exit_fun("[CONFIG] command line parsing fatal error");
|
||||
return 0;
|
||||
} else { /* boolean value option without argument, set value to true*/
|
||||
tmpval = defbool;
|
||||
@@ -143,7 +144,10 @@ int processoption(paramdef_t *cfgoptions, char *value) {
|
||||
return optisset;
|
||||
}
|
||||
|
||||
int config_check_cmdlineopt(char *prefix) {
|
||||
/*--------------------------------------------------------------------*/
|
||||
/* check unknown options in the command line
|
||||
*/
|
||||
int config_check_unknown_cmdlineopt(char *prefix) {
|
||||
int unknowndetected=0;
|
||||
char testprefix[CONFIG_MAXOPTLENGTH]="";
|
||||
int finalcheck = 0;
|
||||
@@ -161,6 +165,8 @@ int config_check_cmdlineopt(char *prefix) {
|
||||
|
||||
if ( !finalcheck && testprefix[0]==0 && index(config_get_if()->argv[i],'.') != NULL) continue;
|
||||
|
||||
if ( !finalcheck && isdigit(config_get_if()->argv[i][0])) continue;
|
||||
|
||||
if ( !finalcheck && config_get_if()->argv[i][0] == '-' && isdigit(config_get_if()->argv[i][1])) continue;
|
||||
|
||||
if ( (config_get_if()->argv_info[i] & CONFIG_CMDLINEOPT_PROCESSED) == 0 ) {
|
||||
@@ -173,7 +179,7 @@ int config_check_cmdlineopt(char *prefix) {
|
||||
printf_cmdl("[CONFIG] %i unknown option(s) in command line starting with %s (section %s)\n",
|
||||
unknowndetected,testprefix,((prefix==NULL)?"":prefix));
|
||||
return unknowndetected;
|
||||
} /* parse_cmdline*/
|
||||
} /* config_check_unknown_cmdlineopt */
|
||||
|
||||
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) {
|
||||
int c = config_get_if()->argc;
|
||||
@@ -269,7 +275,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
|
||||
|
||||
if ( !(CONFIG_ISFLAGSET( CONFIG_NOCHECKUNKOPT )) ) {
|
||||
i=config_check_cmdlineopt(prefix);
|
||||
i=config_check_unknown_cmdlineopt(prefix);
|
||||
|
||||
if (i > 0) {
|
||||
fprintf(stderr,"[CONFIG] %i unknown options for section %s detected in command line\n",
|
||||
|
||||
@@ -370,6 +370,12 @@ int config_checkstr_assign_integer(paramdef_t *param) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
void config_set_checkfunctions(paramdef_t *params, checkedparam_t *checkfunctions, int numparams) {
|
||||
for (int i=0; i< numparams ; i++ ) {
|
||||
params[i].chkPptr = &(checkfunctions[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int config_setdefault_string(paramdef_t *cfgoptions, char *prefix) {
|
||||
int status = 0;
|
||||
|
||||
|
||||
@@ -57,10 +57,13 @@ extern int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr);
|
||||
|
||||
/* apis to get/check parameters, to be used by oai modules, at configuration time */
|
||||
#define CONFIG_CHECKALLSECTIONS "ALLSECTIONS"
|
||||
extern int config_check_cmdlineopt(char *prefix);
|
||||
extern int config_check_unknown_cmdlineopt(char *prefix);
|
||||
extern int config_get(paramdef_t *params,int numparams, char *prefix);
|
||||
extern int config_getlist(paramlist_def_t *ParamList, paramdef_t *params, int numparams, char *prefix);
|
||||
|
||||
/* apis to set some of the paramdef_t fields before using the get/getlist api's */
|
||||
extern void config_set_checkfunctions(paramdef_t *params, checkedparam_t *checkfunctions, int numparams);
|
||||
|
||||
/* apis to retrieve parameters info after calling get or getlist functions */
|
||||
extern int config_isparamset(paramdef_t *params,int paramidx);
|
||||
extern int config_get_processedint(paramdef_t *cfgoption);
|
||||
|
||||
@@ -42,60 +42,60 @@
|
||||
#include "errno.h"
|
||||
|
||||
#if ( LIBCONFIG_VER_MAJOR == 1 && LIBCONFIG_VER_MINOR < 5)
|
||||
#define config_setting_lookup config_lookup_from
|
||||
#define config_setting_lookup config_lookup_from
|
||||
#endif
|
||||
|
||||
void config_libconfig_end(void );
|
||||
|
||||
int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath)
|
||||
{
|
||||
const char *str;
|
||||
int st;
|
||||
int numelt;
|
||||
int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath) {
|
||||
const char *str;
|
||||
int st;
|
||||
int numelt;
|
||||
numelt=config_setting_length(setting);
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt);
|
||||
st=0;
|
||||
|
||||
numelt=config_setting_length(setting);
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt);
|
||||
st=0;
|
||||
for (int i=0; i< numelt ; i++) {
|
||||
str=config_setting_get_string_elem(setting,i);
|
||||
if (str==NULL) {
|
||||
printf("[LIBCONFIG] %s%i not found in config file\n", cfgoptions->optname,i);
|
||||
} else {
|
||||
config_check_valptr(cfgoptions,&(cfgoptions->strlistptr[i]),strlen(str)+1);
|
||||
sprintf(cfgoptions->strlistptr[i],"%s",str);
|
||||
st++;
|
||||
printf_params("[LIBCONFIG] %s%i: %s\n", cfgpath,i,cfgoptions->strlistptr[i]);
|
||||
}
|
||||
}
|
||||
cfgoptions->numelt=numelt;
|
||||
return st;
|
||||
for (int i=0; i< numelt ; i++) {
|
||||
str=config_setting_get_string_elem(setting,i);
|
||||
|
||||
if (str==NULL) {
|
||||
printf("[LIBCONFIG] %s%i not found in config file\n", cfgoptions->optname,i);
|
||||
} else {
|
||||
config_check_valptr(cfgoptions,&(cfgoptions->strlistptr[i]),strlen(str)+1);
|
||||
sprintf(cfgoptions->strlistptr[i],"%s",str);
|
||||
st++;
|
||||
printf_params("[LIBCONFIG] %s%i: %s\n", cfgpath,i,cfgoptions->strlistptr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
cfgoptions->numelt=numelt;
|
||||
return st;
|
||||
}
|
||||
|
||||
int read_intarray(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath)
|
||||
{
|
||||
int read_intarray(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath) {
|
||||
cfgoptions->numelt=config_setting_length(setting);
|
||||
|
||||
cfgoptions->numelt=config_setting_length(setting);
|
||||
|
||||
if (cfgoptions->numelt > 0) {
|
||||
cfgoptions->iptr=malloc(sizeof(int) * (cfgoptions->numelt));
|
||||
for (int i=0; i< cfgoptions->numelt && cfgoptions->iptr != NULL; i++) {
|
||||
cfgoptions->iptr[i]=config_setting_get_int_elem(setting,i);
|
||||
printf_params("[LIBCONFIG] %s[%i]: %i\n", cfgpath,i,cfgoptions->iptr[i]);
|
||||
} /* for loop on array element... */
|
||||
}
|
||||
return cfgoptions->numelt;
|
||||
if (cfgoptions->numelt > 0) {
|
||||
cfgoptions->iptr=malloc(sizeof(int) * (cfgoptions->numelt));
|
||||
|
||||
for (int i=0; i< cfgoptions->numelt && cfgoptions->iptr != NULL; i++) {
|
||||
cfgoptions->iptr[i]=config_setting_get_int_elem(setting,i);
|
||||
printf_params("[LIBCONFIG] %s[%i]: %i\n", cfgpath,i,cfgoptions->iptr[i]);
|
||||
} /* for loop on array element... */
|
||||
}
|
||||
|
||||
return cfgoptions->numelt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
{
|
||||
int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix ) {
|
||||
config_setting_t *setting;
|
||||
char *str;
|
||||
int i,u;
|
||||
long long int llu;
|
||||
double dbl;
|
||||
double dbl;
|
||||
int rst;
|
||||
int status=0;
|
||||
int notfound;
|
||||
@@ -104,211 +104,244 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
int numdefvals=0;
|
||||
char cfgpath[512]; /* 512 should be enough for the sprintf below */
|
||||
|
||||
for(i=0;i<numoptions;i++) {
|
||||
for(i=0; i<numoptions; i++) {
|
||||
if (prefix != NULL) {
|
||||
sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname);
|
||||
} else {
|
||||
sprintf(cfgpath,"%s",cfgoptions[i].optname);
|
||||
}
|
||||
|
||||
if (prefix != NULL) {
|
||||
sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname);
|
||||
} else {
|
||||
sprintf(cfgpath,"%s",cfgoptions[i].optname);
|
||||
}
|
||||
if( (cfgoptions->paramflags & PARAMFLAG_DONOTREAD) != 0) {
|
||||
printf_params("[LIBCONFIG] %s.%s ignored\n", cfgpath,cfgoptions[i].optname );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( (cfgoptions->paramflags & PARAMFLAG_DONOTREAD) != 0) {
|
||||
printf_params("[LIBCONFIG] %s.%s ignored\n", cfgpath,cfgoptions[i].optname );
|
||||
continue;
|
||||
}
|
||||
notfound=0;
|
||||
defval=0;
|
||||
switch(cfgoptions[i].type)
|
||||
{
|
||||
case TYPE_STRING:
|
||||
if ( config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
|
||||
if ( cfgoptions[i].numelt > 0 && str != NULL && strlen(str) >= cfgoptions[i].numelt ) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
|
||||
cfgpath,str,cfgoptions[i].numelt);
|
||||
str[strlen(str)-1] = 0;
|
||||
}
|
||||
if (cfgoptions[i].numelt == 0 ) {
|
||||
// config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1);
|
||||
sprintf( *(cfgoptions[i].strptr) , "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath,*(cfgoptions[i].strptr) );
|
||||
} else {
|
||||
sprintf( (char *)(cfgoptions[i].strptr) , "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath,(char *)cfgoptions[i].strptr );
|
||||
}
|
||||
} else {
|
||||
defval=config_setdefault_string(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_STRINGLIST:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
if ( setting != NULL) {
|
||||
read_strlist(&cfgoptions[i],setting,cfgpath);
|
||||
} else {
|
||||
defval=config_setdefault_stringlist(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_UINT8:
|
||||
case TYPE_INT8:
|
||||
case TYPE_UINT16:
|
||||
case TYPE_INT16:
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
case TYPE_MASK:
|
||||
if ( config_lookup_int(&(libconfig_privdata.cfg),cfgpath, &u)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].iptr)),sizeof(int32_t));
|
||||
config_assign_int(&(cfgoptions[i]),cfgpath,u);
|
||||
} else {
|
||||
defval=config_setdefault_int(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
if ( config_lookup_int64(&(libconfig_privdata.cfg),cfgpath, &llu)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].i64ptr),sizeof(long long));
|
||||
if(cfgoptions[i].type==TYPE_UINT64) {
|
||||
*(cfgoptions[i].u64ptr) = (uint64_t)llu;
|
||||
printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long unsigned)(*(cfgoptions[i].u64ptr)) );
|
||||
} else {
|
||||
*(cfgoptions[i].iptr) = llu;
|
||||
printf_params("[LIBCONFIG] %s: %lli\n", cfgpath,(long long unsigned)(*(cfgoptions[i].i64ptr)) );
|
||||
}
|
||||
} else {
|
||||
defval=config_setdefault_int64(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_UINTARRAY:
|
||||
case TYPE_INTARRAY:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
if ( setting != NULL) {
|
||||
read_intarray(&cfgoptions[i],setting,cfgpath);
|
||||
} else {
|
||||
defval=config_setdefault_intlist(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_DOUBLE:
|
||||
if ( config_lookup_float(&(libconfig_privdata.cfg),cfgpath, &dbl)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].dblptr),sizeof(double));
|
||||
*(cfgoptions[i].dblptr) = dbl;
|
||||
printf_params("[LIBCONFIG] %s: %lf\n", cfgpath,*(cfgoptions[i].dblptr) );
|
||||
} else {
|
||||
defval=config_setdefault_double(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_IPV4ADDR:
|
||||
if ( !config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
|
||||
defval=config_setdefault_ipv4addr(&(cfgoptions[i]),prefix);
|
||||
} else {
|
||||
rst=config_assign_ipv4addr(cfgoptions, str);
|
||||
if (rst < 0) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s not valid for %s \n", str, cfgpath);
|
||||
fatalerror=1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TYPE_LIST:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
if ( setting) {
|
||||
cfgoptions[i].numelt=config_setting_length(setting);
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"[LIBCONFIG] %s type %i not supported\n", cfgpath,cfgoptions[i].type);
|
||||
fatalerror=1;
|
||||
break;
|
||||
} /* switch on param type */
|
||||
if( notfound == 1) {
|
||||
printf("[LIBCONFIG] %s not found in %s ", cfgpath,libconfig_privdata.configfile );
|
||||
if ( (cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) != 0) {
|
||||
fatalerror=1;
|
||||
printf(" mandatory parameter missing\n");
|
||||
notfound=0;
|
||||
defval=0;
|
||||
|
||||
switch(cfgoptions[i].type) {
|
||||
case TYPE_STRING:
|
||||
if ( config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
|
||||
if ( cfgoptions[i].numelt > 0 && str != NULL && strlen(str) >= cfgoptions[i].numelt ) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
|
||||
cfgpath,str,cfgoptions[i].numelt);
|
||||
str[strlen(str)-1] = 0;
|
||||
}
|
||||
|
||||
if (cfgoptions[i].numelt == 0 ) {
|
||||
// config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1);
|
||||
sprintf( *(cfgoptions[i].strptr) , "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath,*(cfgoptions[i].strptr) );
|
||||
} else {
|
||||
sprintf( (char *)(cfgoptions[i].strptr) , "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath,(char *)cfgoptions[i].strptr );
|
||||
}
|
||||
} else {
|
||||
printf("\n");
|
||||
defval=config_setdefault_string(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPE_STRINGLIST:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
|
||||
if ( setting != NULL) {
|
||||
read_strlist(&cfgoptions[i],setting,cfgpath);
|
||||
} else {
|
||||
defval=config_setdefault_stringlist(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPE_UINT8:
|
||||
case TYPE_INT8:
|
||||
case TYPE_UINT16:
|
||||
case TYPE_INT16:
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
case TYPE_MASK:
|
||||
if ( config_lookup_int(&(libconfig_privdata.cfg),cfgpath, &u)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].iptr)),sizeof(int32_t));
|
||||
config_assign_int(&(cfgoptions[i]),cfgpath,u);
|
||||
} else {
|
||||
defval=config_setdefault_int(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
if ( config_lookup_int64(&(libconfig_privdata.cfg),cfgpath, &llu)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].i64ptr),sizeof(long long));
|
||||
|
||||
if(cfgoptions[i].type==TYPE_UINT64) {
|
||||
*(cfgoptions[i].u64ptr) = (uint64_t)llu;
|
||||
printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long unsigned)(*(cfgoptions[i].u64ptr)) );
|
||||
} else {
|
||||
*(cfgoptions[i].iptr) = llu;
|
||||
printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long unsigned)(*(cfgoptions[i].i64ptr)) );
|
||||
}
|
||||
} else {
|
||||
defval=config_setdefault_int64(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPE_UINTARRAY:
|
||||
case TYPE_INTARRAY:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
|
||||
if ( setting != NULL) {
|
||||
read_intarray(&cfgoptions[i],setting,cfgpath);
|
||||
} else {
|
||||
defval=config_setdefault_intlist(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
if ( config_lookup_float(&(libconfig_privdata.cfg),cfgpath, &dbl)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].dblptr),sizeof(double));
|
||||
*(cfgoptions[i].dblptr) = dbl;
|
||||
printf_params("[LIBCONFIG] %s: %lf\n", cfgpath,*(cfgoptions[i].dblptr) );
|
||||
} else {
|
||||
defval=config_setdefault_double(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPE_IPV4ADDR:
|
||||
if ( !config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
|
||||
defval=config_setdefault_ipv4addr(&(cfgoptions[i]),prefix);
|
||||
} else {
|
||||
rst=config_assign_ipv4addr(cfgoptions, str);
|
||||
|
||||
if (rst < 0) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s not valid for %s \n", str, cfgpath);
|
||||
fatalerror=1;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPE_LIST:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
|
||||
if ( setting) {
|
||||
cfgoptions[i].numelt=config_setting_length(setting);
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr,"[LIBCONFIG] %s type %i not supported\n", cfgpath,cfgoptions[i].type);
|
||||
fatalerror=1;
|
||||
break;
|
||||
} /* switch on param type */
|
||||
|
||||
if( notfound == 1) {
|
||||
printf("[LIBCONFIG] %s not found in %s ", cfgpath,libconfig_privdata.configfile );
|
||||
|
||||
if ( (cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) != 0) {
|
||||
fatalerror=1;
|
||||
printf(" mandatory parameter missing\n");
|
||||
} else {
|
||||
printf("\n");
|
||||
}
|
||||
} else {
|
||||
if (defval == 1) {
|
||||
numdefvals++;
|
||||
cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSETDEF;
|
||||
numdefvals++;
|
||||
cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSETDEF;
|
||||
} else {
|
||||
cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSET;
|
||||
cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSET;
|
||||
}
|
||||
|
||||
status++;
|
||||
}
|
||||
} /* for loop on options */
|
||||
|
||||
printf("[LIBCONFIG] %s: %i/%i parameters successfully set, (%i to default value)\n",
|
||||
((prefix == NULL)?"(root)":prefix),
|
||||
((prefix == NULL)?"(root)":prefix),
|
||||
status,numoptions,numdefvals );
|
||||
|
||||
if (fatalerror == 1) {
|
||||
fprintf(stderr,"[LIBCONFIG] fatal errors found when processing %s \n", libconfig_privdata.configfile );
|
||||
config_libconfig_end();
|
||||
end_configmodule();
|
||||
fprintf(stderr,"[LIBCONFIG] fatal errors found when processing %s \n", libconfig_privdata.configfile );
|
||||
config_libconfig_end();
|
||||
end_configmodule();
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_libconfig_getlist(paramlist_def_t *ParamList,
|
||||
paramdef_t *params, int numparams, char *prefix)
|
||||
{
|
||||
config_setting_t *setting;
|
||||
int i,j,status;
|
||||
char *listpath=NULL;
|
||||
char cfgpath[MAX_OPTNAME_SIZE*2 + 6]; /* prefix.listname.[listindex] */
|
||||
int config_libconfig_getlist(paramlist_def_t *ParamList,
|
||||
paramdef_t *params, int numparams, char *prefix) {
|
||||
config_setting_t *setting;
|
||||
int i,j,status;
|
||||
char *listpath=NULL;
|
||||
char cfgpath[MAX_OPTNAME_SIZE*2 + 6]; /* prefix.listname.[listindex] */
|
||||
|
||||
if (prefix != NULL)
|
||||
{
|
||||
i=asprintf(&listpath ,"%s.%s",prefix,ParamList->listname);
|
||||
}
|
||||
else
|
||||
{
|
||||
i=asprintf(&listpath ,"%s",ParamList->listname);
|
||||
}
|
||||
setting = config_lookup(&(libconfig_privdata.cfg), listpath);
|
||||
if ( setting) {
|
||||
status = ParamList->numelt = config_setting_length(setting);
|
||||
printf_params("[LIBCONFIG] %i %s in config file %s \n",
|
||||
ParamList->numelt,listpath,libconfig_privdata.configfile );
|
||||
if (prefix != NULL) {
|
||||
i=asprintf(&listpath ,"%s.%s",prefix,ParamList->listname);
|
||||
} else {
|
||||
i=asprintf(&listpath ,"%s",ParamList->listname);
|
||||
}
|
||||
|
||||
setting = config_lookup(&(libconfig_privdata.cfg), listpath);
|
||||
|
||||
if ( setting) {
|
||||
status = ParamList->numelt = config_setting_length(setting);
|
||||
printf_params("[LIBCONFIG] %i %s in config file %s \n",
|
||||
ParamList->numelt,listpath,libconfig_privdata.configfile );
|
||||
} else {
|
||||
printf("[LIBCONFIG] list %s not found in config file %s \n",
|
||||
listpath,libconfig_privdata.configfile );
|
||||
ParamList->numelt= 0;
|
||||
status = -1;
|
||||
}
|
||||
|
||||
if (ParamList->numelt > 0 && params != NULL) {
|
||||
ParamList->paramarray = malloc(ParamList->numelt * sizeof(paramdef_t *));
|
||||
|
||||
if ( ParamList->paramarray != NULL) {
|
||||
config_get_if()->ptrs[config_get_if()->numptrs] = (char *)(ParamList->paramarray);
|
||||
config_get_if()->numptrs++;
|
||||
} else {
|
||||
printf("[LIBCONFIG] list %s not found in config file %s \n",
|
||||
listpath,libconfig_privdata.configfile );
|
||||
ParamList->numelt= 0;
|
||||
status = -1;
|
||||
fprintf (stderr,"[LIBCONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
}
|
||||
if (ParamList->numelt > 0 && params != NULL) {
|
||||
ParamList->paramarray = malloc(ParamList->numelt * sizeof(paramdef_t *));
|
||||
if ( ParamList->paramarray != NULL) {
|
||||
config_get_if()->ptrs[config_get_if()->numptrs] = (char *)(ParamList->paramarray);
|
||||
config_get_if()->numptrs++;
|
||||
} else {
|
||||
fprintf (stderr,"[LIBCONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
}
|
||||
for (i=0 ; i < ParamList->numelt ; i++) {
|
||||
ParamList->paramarray[i] = malloc(numparams * sizeof(paramdef_t));
|
||||
if ( ParamList->paramarray[i] != NULL) {
|
||||
config_get_if()->ptrs[config_get_if()->numptrs] = (char *)(ParamList->paramarray[i]);
|
||||
config_get_if()->numptrs++;
|
||||
} else {
|
||||
fprintf (stderr,"[LIBCONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
memcpy(ParamList->paramarray[i], params, sizeof(paramdef_t)*numparams);
|
||||
for (j=0;j<numparams;j++) {
|
||||
ParamList->paramarray[i][j].strptr = NULL ;
|
||||
}
|
||||
sprintf(cfgpath,"%s.[%i]",listpath,i);
|
||||
config_libconfig_get(ParamList->paramarray[i], numparams, cfgpath );
|
||||
} /* for i... */
|
||||
} /* ParamList->numelt > 0 && params != NULL */
|
||||
if (listpath != NULL)
|
||||
free(listpath);
|
||||
return status;
|
||||
|
||||
for (i=0 ; i < ParamList->numelt ; i++) {
|
||||
ParamList->paramarray[i] = malloc(numparams * sizeof(paramdef_t));
|
||||
|
||||
if ( ParamList->paramarray[i] != NULL) {
|
||||
config_get_if()->ptrs[config_get_if()->numptrs] = (char *)(ParamList->paramarray[i]);
|
||||
config_get_if()->numptrs++;
|
||||
} else {
|
||||
fprintf (stderr,"[LIBCONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
memcpy(ParamList->paramarray[i], params, sizeof(paramdef_t)*numparams);
|
||||
|
||||
for (j=0; j<numparams; j++) {
|
||||
ParamList->paramarray[i][j].strptr = NULL ;
|
||||
}
|
||||
|
||||
sprintf(cfgpath,"%s.[%i]",listpath,i);
|
||||
config_libconfig_get(ParamList->paramarray[i], numparams, cfgpath );
|
||||
} /* for i... */
|
||||
} /* ParamList->numelt > 0 && params != NULL */
|
||||
|
||||
if (listpath != NULL)
|
||||
free(listpath);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_libconfig_init(char *cfgP[], int numP)
|
||||
{
|
||||
int config_libconfig_init(char *cfgP[], int numP) {
|
||||
config_init(&(libconfig_privdata.cfg));
|
||||
libconfig_privdata.configfile = strdup((char *)cfgP[0]);
|
||||
config_get_if()->numptrs=0;
|
||||
@@ -317,24 +350,22 @@ int config_libconfig_init(char *cfgP[], int numP)
|
||||
/* Read the file. If there is an error, report it and exit. */
|
||||
if(! config_read_file(&(libconfig_privdata.cfg), libconfig_privdata.configfile)) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s %d file %s - %d - %s\n",__FILE__, __LINE__,
|
||||
libconfig_privdata.configfile, config_error_line(&(libconfig_privdata.cfg)),
|
||||
config_error_text(&(libconfig_privdata.cfg)));
|
||||
libconfig_privdata.configfile, config_error_line(&(libconfig_privdata.cfg)),
|
||||
config_error_text(&(libconfig_privdata.cfg)));
|
||||
config_destroy(&(libconfig_privdata.cfg));
|
||||
printf( "\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void config_libconfig_end(void )
|
||||
{
|
||||
void config_libconfig_end(void ) {
|
||||
config_destroy(&(libconfig_privdata.cfg));
|
||||
|
||||
if ( libconfig_privdata.configfile != NULL ) {
|
||||
free(libconfig_privdata.configfile);
|
||||
libconfig_privdata.configfile=NULL;
|
||||
}
|
||||
|
||||
free(libconfig_privdata.configfile);
|
||||
libconfig_privdata.configfile=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
/* array used to activate/disactivate a log */
|
||||
static int T_IDs[T_NUMBER_OF_IDS];
|
||||
int *T_active = T_IDs;
|
||||
int T_stdout;
|
||||
int T_stdout = 1;
|
||||
|
||||
static int T_socket;
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#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_ */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@
|
||||
void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
PHY_VARS_UE *ue,
|
||||
module_id_t eNB_id,
|
||||
uint8_t subframe,
|
||||
uint8_t subframe,
|
||||
unsigned char clear,
|
||||
short coef)
|
||||
{
|
||||
@@ -96,6 +96,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
else
|
||||
count_max_pos_ok = 0;
|
||||
|
||||
|
||||
if(count_max_pos_ok > 10 && first_time == 1)
|
||||
{
|
||||
first_time = 0;
|
||||
@@ -103,7 +104,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
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);
|
||||
//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 {
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* 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);
|
||||
@@ -461,14 +461,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);
|
||||
|
||||
@@ -1442,8 +1442,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);
|
||||
|
||||
/*!
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* 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];
|
||||
@@ -1,91 +0,0 @@
|
||||
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
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
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
|
||||
@@ -1332,12 +1332,13 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
prach_power = generate_prach(ue,eNB_id,subframe_tx,frame_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT);
|
||||
// stop_meas(&ue->tx_prach);
|
||||
LOG_D(PHY,"[UE %d][RAPROC] PRACH PL %d dB, power %d dBm, digital power %d dB (amp %d)\n",
|
||||
ue->Mod_id,
|
||||
get_PL(ue->Mod_id,ue->CC_id,eNB_id),
|
||||
ue->tx_power_dBm[subframe_tx],
|
||||
dB_fixed(prach_power),
|
||||
ue->prach_vars[eNB_id]->amp);
|
||||
LOG_I(PHY,"[UE %d][RAPROC] PRACH PL %d dB, power %d dBm (max %d dBm), digital power %d dB (amp %d)\n",
|
||||
ue->Mod_id,
|
||||
get_PL(ue->Mod_id,ue->CC_id,eNB_id),
|
||||
ue->tx_power_dBm[subframe_tx],
|
||||
ue->tx_power_max_dBm,
|
||||
dB_fixed(prach_power),
|
||||
ue->prach_vars[eNB_id]->amp);
|
||||
|
||||
if (ue->mac_enabled==1) {
|
||||
Msg1_transmitted(ue->Mod_id,
|
||||
@@ -2178,8 +2179,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
|
||||
}
|
||||
|
||||
if (subframe_select(&ue->frame_parms,proc->subframe_tx) == SF_UL ||
|
||||
ue->frame_parms.frame_type == FDD) {
|
||||
if (ue->UE_mode[eNB_id] != PRACH ) {
|
||||
ue->frame_parms.frame_type == FDD) {
|
||||
if (ue->UE_mode[eNB_id] > PRACH ) {
|
||||
// check cell srs subframe and ue srs subframe. This has an impact on pusch encoding
|
||||
isSubframeSRS = is_srs_occasion_common(&ue->frame_parms,proc->frame_tx,proc->subframe_tx);
|
||||
ue_compute_srs_occasion(ue,proc,eNB_id,isSubframeSRS);
|
||||
@@ -2409,8 +2410,8 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
|
||||
ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0);
|
||||
}
|
||||
|
||||
// if this is the first PBCH after initial synchronization, make L1 state = PRACH
|
||||
if (ue->UE_mode[eNB_id]==NOT_SYNCHED) ue->UE_mode[eNB_id] = PRACH;
|
||||
// if this is the first PBCH after initial synchronization and no timing correction is performed, make L1 state = PRACH
|
||||
if (ue->UE_mode[eNB_id]==NOT_SYNCHED && ue->no_timing_correction == 1) ue->UE_mode[eNB_id] = PRACH;
|
||||
|
||||
if (first_run) {
|
||||
first_run = 0;
|
||||
@@ -4783,7 +4784,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;
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* 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"
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
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>
|
||||
#include "enb_paramdef.h"
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
@@ -2077,7 +2077,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
if (sdu_lengths[num_sdus]) {
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
sdu_lcids[num_sdus] = lcid;
|
||||
LOG_D(MAC,
|
||||
LOG_I(MAC,
|
||||
"[UE %d] TX Multiplex RLC PDU TX Got %d bytes for LcId%d\n",
|
||||
module_idP, sdu_lengths[num_sdus], lcid);
|
||||
|
||||
|
||||
@@ -1,118 +0,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
|
||||
|
||||
@@ -182,6 +182,7 @@ boolean_t pdcp_data_req(
|
||||
(unsigned char*)&pdcp_pdu_p->data[0],
|
||||
sdu_buffer_sizeP);
|
||||
#endif
|
||||
LOG_D(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP);
|
||||
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,NULL, NULL
|
||||
@@ -366,6 +367,7 @@ boolean_t pdcp_data_req(
|
||||
LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)pdcp_pdu_p->data,pdcp_pdu_size,
|
||||
"[MSG] PDCP DL %s PDU on rb_id %d\n",(srb_flagP)? "CONTROL" : "DATA", rb_idP);
|
||||
|
||||
LOG_D(PDCP, "Before rlc_data_req 2, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP);
|
||||
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
,sourceL2Id
|
||||
@@ -471,6 +473,7 @@ pdcp_data_ind(
|
||||
LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)sdu_buffer_pP->data,sdu_buffer_sizeP,
|
||||
"[MSG] PDCP UL %s PDU on rb_id %d\n", (srb_flagP)? "CONTROL" : "DATA", rb_idP);
|
||||
|
||||
|
||||
#if T_TRACER
|
||||
if (ctxt_pP->enb_flag != ENB_FLAG_NO)
|
||||
T(T_ENB_PDCP_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_buffer_sizeP));
|
||||
@@ -800,13 +803,16 @@ pdcp_data_ind(
|
||||
} else {
|
||||
((pdcp_data_ind_header_t*) new_sdu_p->data)->rb_id = rb_id + (ctxt_pP->module_id * LTE_maxDRB);
|
||||
}
|
||||
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
|
||||
//Panos: Commented this out because it cancels the assignment in #if defined(ENABLE_USE_MME) case
|
||||
//((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = ctxt_pP->module_id;
|
||||
|
||||
#ifdef DEBUG_PDCP_FIFO_FLUSH_SDU
|
||||
static uint32_t pdcp_inst = 0;
|
||||
((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = pdcp_inst++;
|
||||
LOG_D(PDCP, "inst=%d size=%d\n", ((pdcp_data_ind_header_t*) new_sdu_p->data)->inst, ((pdcp_data_ind_header_t *) new_sdu_p->data)->data_size);
|
||||
#endif
|
||||
//((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 1; //pdcp_inst++;
|
||||
|
||||
memcpy(&new_sdu_p->data[sizeof (pdcp_data_ind_header_t)], \
|
||||
&sdu_buffer_pP->data[payload_offset], \
|
||||
@@ -962,7 +968,7 @@ pdcp_run (
|
||||
RRC_DCCH_DATA_REQ (msg_p).frame,
|
||||
0,
|
||||
RRC_DCCH_DATA_REQ (msg_p).eNB_index);
|
||||
LOG_I(PDCP, PROTOCOL_CTXT_FMT"Received %s from %s: instance %d, rb_id %d, muiP %d, confirmP %d, mode %d\n",
|
||||
LOG_D(PDCP, PROTOCOL_CTXT_FMT"Received %s from %s: instance %d, rb_id %d, muiP %d, confirmP %d, mode %d\n",
|
||||
PROTOCOL_CTXT_ARGS(&ctxt),
|
||||
ITTI_MSG_NAME (msg_p),
|
||||
ITTI_MSG_ORIGIN_NAME(msg_p),
|
||||
@@ -972,6 +978,7 @@ pdcp_run (
|
||||
RRC_DCCH_DATA_REQ (msg_p).confirmp,
|
||||
RRC_DCCH_DATA_REQ (msg_p).mode);
|
||||
|
||||
LOG_D(PDCP, "Before calling pdcp_data_req from pdcp_run! RRC_DCCH_DATA_REQ (msg_p).rb_id: %d \n", RRC_DCCH_DATA_REQ (msg_p).rb_id);
|
||||
result = pdcp_data_req (&ctxt,
|
||||
SRB_FLAG_YES,
|
||||
RRC_DCCH_DATA_REQ (msg_p).rb_id,
|
||||
|
||||
@@ -168,7 +168,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
|
||||
((pdcp_data_ind_header_t*) sdu_p->data)->inst,
|
||||
((pdcp_data_ind_header_t *) sdu_p->data)->data_size);
|
||||
#else
|
||||
((pdcp_data_ind_header_t *)(sdu_p->data))->inst = 0;
|
||||
//((pdcp_data_ind_header_t *)(sdu_p->data))->inst = 0;
|
||||
#endif
|
||||
|
||||
#if defined(LINK_ENB_PDCP_TO_GTPV1U)
|
||||
@@ -195,7 +195,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
|
||||
|
||||
#endif /* defined(ENABLE_USE_MME) */
|
||||
#ifdef PDCP_DEBUG
|
||||
LOG_D(PDCP, "PDCP->IP TTI %d INST %d: Preparing %d Bytes of data from rab %d to Nas_mesh\n",
|
||||
LOG_I(PDCP, "PDCP->IP TTI %d INST %d: Preparing %d Bytes of data from rab %d to Nas_mesh\n",
|
||||
ctxt_pP->frame, ((pdcp_data_ind_header_t *)(sdu_p->data))->inst,
|
||||
((pdcp_data_ind_header_t *)(sdu_p->data))->data_size, ((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id);
|
||||
#endif //PDCP_DEBUG
|
||||
@@ -719,11 +719,11 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
if (!ctxt.enb_flag) {
|
||||
if (rab_id != 0) {
|
||||
if (rab_id == UE_IP_DEFAULT_RAB_ID) {
|
||||
LOG_I(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%x, enb_flag=%d)\n",
|
||||
LOG_D(PDCP, "PDCP_COLL_KEY_DEFAULT_DRB_VALUE(module_id=%d, rnti=%x, enb_flag=%d)\n",
|
||||
ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
|
||||
key = PDCP_COLL_KEY_DEFAULT_DRB_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag);
|
||||
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
|
||||
LOG_I(PDCP,"request key %x : (%d,%x,%d,%d)\n",
|
||||
LOG_D(PDCP,"request key %x : (%d,%x,%d,%d)\n",
|
||||
(uint8_t)key,ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id);
|
||||
} else {
|
||||
rab_id = rab_id % LTE_maxDRB;
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
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
|
||||
@@ -403,11 +403,18 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t* const ctxt_pP,
|
||||
key = RLC_COLL_KEY_MBMS_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_id_p->service_id, mbms_id_p->session_id);
|
||||
}
|
||||
if (sourceL2Id && destinationL2Id){
|
||||
key = RLC_COLL_KEY_SOURCE_DEST_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, *sourceL2Id, *destinationL2Id, srb_flagP);
|
||||
LOG_I (RLC, "RLC_COLL_KEY_VALUE: ctxt_pP->module_id: %d, ctxt_pP->rnti: %d, ctxt_pP->enb_flag: %d, rb_idP:%d, srb_flagP: %d \n \n", ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
|
||||
key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
|
||||
|
||||
//Thinh's line originally uncommented
|
||||
//key = RLC_COLL_KEY_SOURCE_DEST_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, *sourceL2Id, *destinationL2Id, srb_flagP);
|
||||
|
||||
|
||||
//key_lcid = RLC_COLL_KEY_LCID_SOURCE_DEST_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, chan_idP, *sourceL2Id, *destinationL2Id, srb_flagP);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
LOG_I (RLC, "RLC_COLL_KEY_VALUE: ctxt_pP->module_id: %d, ctxt_pP->rnti: %d, ctxt_pP->enb_flag: %d, rb_idP:%d, srb_flagP: %d \n \n", ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
|
||||
key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
|
||||
}
|
||||
|
||||
|
||||
@@ -254,6 +254,7 @@ void mac_rlc_data_ind (
|
||||
srb_flag_t srb_flag = (channel_idP <= 2) ? SRB_FLAG_YES : SRB_FLAG_NO;
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, enb_flagP, rntiP, frameP, 0, eNB_index);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_DATA_IND,VCD_FUNCTION_IN);
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -1,91 +0,0 @@
|
||||
|
||||
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)
|
||||
@@ -1,439 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#ifeq ($(NAS_FLAG),1)
|
||||
NAS_OBJS = $(OPENAIR2_TOP)/RRC/NAS/nas_config.o
|
||||
NAS_OBJS += $(OPENAIR2_TOP)/RRC/NAS/rb_config.o
|
||||
#endif
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* 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);
|
||||
@@ -1,108 +0,0 @@
|
||||
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)
|
||||
@@ -1,175 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -1,107 +0,0 @@
|
||||
|
||||
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)
|
||||
@@ -1,578 +0,0 @@
|
||||
/*
|
||||
* 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__*/
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* 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)
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* 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"
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* 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)
|
||||
|
||||
@@ -1,329 +0,0 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* 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)
|
||||
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* 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)
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* 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)
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* 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)
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* 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_ */
|
||||
@@ -1,310 +0,0 @@
|
||||
/*
|
||||
* 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__*/
|
||||
@@ -1,123 +0,0 @@
|
||||
/*
|
||||
* 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__*/
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* 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;\
|
||||
|
||||
@@ -1,716 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
@@ -8,33 +8,47 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
int fullread(int fd, void *_buf, int count)
|
||||
{
|
||||
const int port = 4043;
|
||||
#define helpTxt "\
|
||||
\x1b[31m\
|
||||
tcp_bridge: error: you have to run one UE and one eNB\n\
|
||||
For this, export TCPBRIDGE=enb (eNB case) or \n\
|
||||
TCPBRIDGE=<an ip address> (UE case)\n\
|
||||
\x1b[m"
|
||||
|
||||
int fullread(int fd, void *_buf, int count) {
|
||||
char *buf = _buf;
|
||||
int ret = 0;
|
||||
int l;
|
||||
|
||||
while (count) {
|
||||
l = read(fd, buf, count);
|
||||
|
||||
if (l <= 0) return -1;
|
||||
|
||||
count -= l;
|
||||
buf += l;
|
||||
ret += l;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int fullwrite(int fd, void *_buf, int count)
|
||||
{
|
||||
int fullwrite(int fd, void *_buf, int count) {
|
||||
char *buf = _buf;
|
||||
int ret = 0;
|
||||
int l;
|
||||
|
||||
while (count) {
|
||||
l = write(fd, buf, count);
|
||||
|
||||
if (l <= 0) return -1;
|
||||
|
||||
count -= l;
|
||||
buf += l;
|
||||
ret += l;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -46,155 +60,208 @@ typedef struct {
|
||||
uint64_t timestamp;
|
||||
uint64_t next_tx_timestamp;
|
||||
int is_enb;
|
||||
char *ip;
|
||||
} tcp_bridge_state_t;
|
||||
|
||||
void verify_connection(int fd, int is_enb)
|
||||
{
|
||||
void verify_connection(int fd, int is_enb) {
|
||||
char c = is_enb;
|
||||
|
||||
if (fullwrite(fd, &c, 1) != 1) exit(1);
|
||||
|
||||
if (fullread(fd, &c, 1) != 1) exit(1);
|
||||
|
||||
if (c == is_enb) {
|
||||
printf("\x1b[31mtcp_bridge: error: you have to run one UE and one eNB"
|
||||
" (did you run 'export ENODEB=1' in the eNB terminal?)\x1b[m\n");
|
||||
printf(helpTxt);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
int tcp_bridge_start(openair0_device *device)
|
||||
{
|
||||
int port = 4043;
|
||||
tcp_bridge_state_t *tcp_bridge = device->priv;
|
||||
int try;
|
||||
int max_try = 5;
|
||||
|
||||
int sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (sock == -1) { perror("tcp_bridge: socket"); exit(1); }
|
||||
|
||||
int enable = 1;
|
||||
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int)))
|
||||
{ perror("tcp_bridge: SO_REUSEADDR"); exit(1); }
|
||||
|
||||
int start_enb(tcp_bridge_state_t *tcp_bridge) {
|
||||
struct sockaddr_in addr = {
|
||||
sin_family: AF_INET,
|
||||
sin_port: htons(port),
|
||||
sin_addr: { s_addr: INADDR_ANY }
|
||||
sin_family:
|
||||
AF_INET,
|
||||
sin_port:
|
||||
htons(port),
|
||||
sin_addr:
|
||||
{ s_addr: INADDR_ANY }
|
||||
};
|
||||
|
||||
if (bind(sock, (struct sockaddr *)&addr, sizeof(addr))) {
|
||||
if (errno == EADDRINUSE) goto client_mode;
|
||||
{ perror("tcp_bridge: bind"); exit(1); }
|
||||
if (bind(tcp_bridge->sock, (struct sockaddr *)&addr, sizeof(addr))) {
|
||||
perror("tcp_bridge: bind");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (listen(sock, 5))
|
||||
{ perror("tcp_bridge: listen"); exit(1); }
|
||||
if (listen(tcp_bridge->sock, 5)) {
|
||||
perror("tcp_bridge: listen");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("tcp_bridge: wait for connection on port %d\n", port);
|
||||
|
||||
socklen_t len = sizeof(addr);
|
||||
int sock2 = accept(sock, (struct sockaddr *)&addr, &len);
|
||||
if (sock2 == -1)
|
||||
{ perror("tcp_bridge: accept"); exit(1); }
|
||||
int sockServ = accept(tcp_bridge->sock, (struct sockaddr *)&addr, &len);
|
||||
|
||||
close(sock);
|
||||
|
||||
tcp_bridge->sock = sock2;
|
||||
if ( sockServ == -1) {
|
||||
perror("tcp_bridge: accept");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
verify_connection(sockServ, tcp_bridge->is_enb);
|
||||
printf("tcp_bridge: connection established\n");
|
||||
|
||||
verify_connection(sock2, tcp_bridge->is_enb);
|
||||
|
||||
close(tcp_bridge->sock);
|
||||
tcp_bridge->sock=sockServ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
client_mode:
|
||||
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
|
||||
int start_ue(tcp_bridge_state_t *tcp_bridge) {
|
||||
struct sockaddr_in addr = {sin_family:
|
||||
AF_INET,
|
||||
sin_port:
|
||||
htons(port),
|
||||
sin_addr:
|
||||
{ s_addr: INADDR_ANY }
|
||||
};
|
||||
addr.sin_addr.s_addr = inet_addr(tcp_bridge->ip);
|
||||
|
||||
for (try = 0; try < max_try; try++) {
|
||||
if (try != 0) sleep(1);
|
||||
while(1) {
|
||||
printf("tcp_bridge: trying to connect to %s:%d\n", tcp_bridge->ip, port);
|
||||
|
||||
printf("tcp_bridge: trying to connect to 127.0.0.1:%d (attempt %d/%d)\n",
|
||||
port, try+1, max_try);
|
||||
|
||||
if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) {
|
||||
if (connect(tcp_bridge->sock, (struct sockaddr *)&addr, sizeof(addr)) == 0) {
|
||||
verify_connection(tcp_bridge->sock, tcp_bridge->is_enb);
|
||||
printf("tcp_bridge: connection established\n");
|
||||
tcp_bridge->sock = sock;
|
||||
verify_connection(sock, tcp_bridge->is_enb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
perror("tcp_bridge");
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
printf("tcp_bridge: connection failed\n");
|
||||
|
||||
exit(1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tcp_bridge_request(openair0_device *device, void *msg, ssize_t msg_len) { abort(); return 0; }
|
||||
int tcp_bridge_reply(openair0_device *device, void *msg, ssize_t msg_len) { abort(); return 0; }
|
||||
int tcp_bridge_get_stats(openair0_device* device) { return 0; }
|
||||
int tcp_bridge_reset_stats(openair0_device* device) { return 0; }
|
||||
int tcp_bridge_start(openair0_device *device) {
|
||||
tcp_bridge_state_t *tcp_bridge = device->priv;
|
||||
tcp_bridge->sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
||||
if (tcp_bridge->sock == -1) {
|
||||
perror("tcp_bridge: socket");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int enable = 1;
|
||||
|
||||
if (setsockopt(tcp_bridge->sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int))) {
|
||||
perror("tcp_bridge: SO_REUSEADDR");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ( tcp_bridge->is_enb )
|
||||
return start_enb(tcp_bridge);
|
||||
else
|
||||
return start_ue(tcp_bridge);
|
||||
}
|
||||
|
||||
int tcp_bridge_request(openair0_device *device, void *msg, ssize_t msg_len) {
|
||||
abort();
|
||||
return 0;
|
||||
}
|
||||
int tcp_bridge_reply(openair0_device *device, void *msg, ssize_t msg_len) {
|
||||
abort();
|
||||
return 0;
|
||||
}
|
||||
int tcp_bridge_get_stats(openair0_device *device) {
|
||||
return 0;
|
||||
}
|
||||
int tcp_bridge_reset_stats(openair0_device *device) {
|
||||
return 0;
|
||||
}
|
||||
void tcp_bridge_end(openair0_device *device) {}
|
||||
int tcp_bridge_stop(openair0_device *device) { return 0; }
|
||||
int tcp_bridge_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) { return 0; }
|
||||
int tcp_bridge_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { return 0; }
|
||||
int tcp_bridge_stop(openair0_device *device) {
|
||||
return 0;
|
||||
}
|
||||
int tcp_bridge_set_freq(openair0_device *device, openair0_config_t *openair0_cfg,int exmimo_dump_config) {
|
||||
return 0;
|
||||
}
|
||||
int tcp_bridge_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
|
||||
if (cc != 1) {
|
||||
printf("tcp_bridge: only 1 antenna supported\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int tcp_bridge_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags)
|
||||
{
|
||||
if (cc != 1) { printf("tcp_bridge: only 1 antenna supported\n"); exit(1); }
|
||||
tcp_bridge_state_t *t = device->priv;
|
||||
|
||||
/* deal with discontinuities in output (think: eNB in TDD mode) */
|
||||
if (t->next_tx_timestamp && timestamp != t->next_tx_timestamp) {
|
||||
uint32_t b[4096];
|
||||
uint64_t to_send = timestamp - t->next_tx_timestamp;
|
||||
memset(b, 0, 4096 * sizeof(uint32_t));
|
||||
|
||||
while (to_send) {
|
||||
int len = to_send > 4096 ? 4096 : to_send;
|
||||
int n = fullwrite(t->sock, b, len * 4);
|
||||
|
||||
if (n != len * 4) {
|
||||
printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno));
|
||||
abort();
|
||||
}
|
||||
|
||||
to_send -= len;
|
||||
}
|
||||
}
|
||||
|
||||
int n = fullwrite(t->sock, buff[0], nsamps * 4);
|
||||
|
||||
if (n != nsamps * 4) {
|
||||
printf("tcp_bridge: write error ret %d (wanted %d) error %s\n", n, nsamps*4, strerror(errno));
|
||||
abort();
|
||||
}
|
||||
|
||||
t->next_tx_timestamp = timestamp + nsamps;
|
||||
return nsamps;
|
||||
}
|
||||
|
||||
int tcp_bridge_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc)
|
||||
{
|
||||
if (cc != 1) { printf("tcp_bridge: only 1 antenna supported\n"); exit(1); }
|
||||
int tcp_bridge_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
|
||||
if (cc != 1) {
|
||||
printf("tcp_bridge: only 1 antenna supported\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
tcp_bridge_state_t *t = device->priv;
|
||||
int n = fullread(t->sock, buff[0], nsamps * 4);
|
||||
|
||||
if (n != nsamps * 4) {
|
||||
printf("tcp_bridge: read error ret %d nsamps*4 %d error %s\n", n, nsamps * 4, strerror(errno));
|
||||
abort();
|
||||
}
|
||||
|
||||
*timestamp = t->timestamp;
|
||||
t->timestamp += nsamps;
|
||||
return nsamps;
|
||||
}
|
||||
|
||||
int tcp_bridge_read_ue(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc)
|
||||
{
|
||||
if (cc != 1) { printf("tcp_bridge: only 1 antenna supported\n"); exit(1); }
|
||||
int tcp_bridge_read_ue(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
|
||||
if (cc != 1) {
|
||||
printf("tcp_bridge: only 1 antenna supported\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
tcp_bridge_state_t *t = device->priv;
|
||||
int n;
|
||||
|
||||
/* In synch mode, UE does not write, but we need to
|
||||
* send something to the eNodeB.
|
||||
* We know that UE is in synch mode when it reads
|
||||
* 10 subframes at a time.
|
||||
*/
|
||||
send something to the eNodeB.
|
||||
We know that UE is in synch mode when it reads
|
||||
10 subframes at a time.
|
||||
*/
|
||||
if (nsamps == t->samples_per_subframe * 10) {
|
||||
uint32_t b[nsamps];
|
||||
memset(b, 0, nsamps * 4);
|
||||
n = fullwrite(t->sock, b, nsamps * 4);
|
||||
|
||||
if (n != nsamps * 4) {
|
||||
printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno));
|
||||
abort();
|
||||
@@ -205,96 +272,106 @@ int tcp_bridge_read_ue(openair0_device *device, openair0_timestamp *timestamp, v
|
||||
}
|
||||
|
||||
/* To startup proper communcation between eNB and UE,
|
||||
* we need to understand that:
|
||||
* - eNodeB starts reading subframe 0
|
||||
* - then eNodeB starts sending subframe 4
|
||||
* and then repeats read/write for each subframe.
|
||||
* The UE:
|
||||
* - reads 10 subframes at a time until it is synchronized
|
||||
* - then reads subframe n and writes subframe n+2
|
||||
* We also want to enforce that the subframe 0 is read
|
||||
* at the beginning of the UE RX buffer, not in the middle
|
||||
* of it.
|
||||
* So it means:
|
||||
* - for the eNodeB: let it run as in normal mode (as with a B210)
|
||||
* - for the UE, on its very first read:
|
||||
* - we want this read to get data from subframe 0
|
||||
* but the first write of eNodeB is subframe 4
|
||||
* so we first need to read and ignore 6 subframes
|
||||
* - the UE will start its TX only at the subframe 2
|
||||
* corresponding to the subframe 0 it just read,
|
||||
* so we need to write 12 subframes before anything
|
||||
* (the function tcp_bridge_read_ue takes care to
|
||||
* insert dummy TX data during the synch phase)
|
||||
*
|
||||
* Here is a drawing of the beginning of things to make
|
||||
* this logic clearer.
|
||||
*
|
||||
* We see that eNB starts RX at subframe 0, starts TX at subfram 4,
|
||||
* and that UE starts RX at subframe 10 and TX at subframe 12.
|
||||
*
|
||||
* We understand that the UE has to transmit 12 empty
|
||||
* subframes for the eNodeB to start its processing.
|
||||
*
|
||||
* And because the eNodeB starts its TX at subframe 4 and we
|
||||
* want the UE to start its RX at subframe 10, we need to
|
||||
* read and ignore 6 subframes in the UE.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
* eNB RX: | *0* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 ...
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
* eNB TX: | 0 | 1 | 2 | 3 | *4* | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 ...
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
* UE RX: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | *10* | 11 | 12 | 13 | 14 ...
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
* UE TX: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | *12* | 13 | 14 ...
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* As a final note, we do TX before RX to ensure that the eNB will
|
||||
* get some data and send us something so there is no deadlock
|
||||
* at the beginning of things. Hopefully the kernel buffers for
|
||||
* the sockets are big enough so that the first (big) TX can
|
||||
* return to user mode before the buffers are full. If this
|
||||
* is wrong in some environment, we will need to work by smaller
|
||||
* units of data at a time.
|
||||
*/
|
||||
int tcp_bridge_ue_first_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc)
|
||||
{
|
||||
if (cc != 1) { printf("tcp_bridge: only 1 antenna supported\n"); exit(1); }
|
||||
tcp_bridge_state_t *t = device->priv;
|
||||
we need to understand that:
|
||||
- eNodeB starts reading subframe 0
|
||||
- then eNodeB starts sending subframe 4
|
||||
and then repeats read/write for each subframe.
|
||||
The UE:
|
||||
- reads 10 subframes at a time until it is synchronized
|
||||
- then reads subframe n and writes subframe n+2
|
||||
We also want to enforce that the subframe 0 is read
|
||||
at the beginning of the UE RX buffer, not in the middle
|
||||
of it.
|
||||
So it means:
|
||||
- for the eNodeB: let it run as in normal mode (as with a B210)
|
||||
- for the UE, on its very first read:
|
||||
- we want this read to get data from subframe 0
|
||||
but the first write of eNodeB is subframe 4
|
||||
so we first need to read and ignore 6 subframes
|
||||
- the UE will start its TX only at the subframe 2
|
||||
corresponding to the subframe 0 it just read,
|
||||
so we need to write 12 subframes before anything
|
||||
(the function tcp_bridge_read_ue takes care to
|
||||
insert dummy TX data during the synch phase)
|
||||
|
||||
Here is a drawing of the beginning of things to make
|
||||
this logic clearer.
|
||||
|
||||
We see that eNB starts RX at subframe 0, starts TX at subfram 4,
|
||||
and that UE starts RX at subframe 10 and TX at subframe 12.
|
||||
|
||||
We understand that the UE has to transmit 12 empty
|
||||
subframes for the eNodeB to start its processing.
|
||||
|
||||
And because the eNodeB starts its TX at subframe 4 and we
|
||||
want the UE to start its RX at subframe 10, we need to
|
||||
read and ignore 6 subframes in the UE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
eNB RX: | *0* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 ...
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
eNB TX: | 0 | 1 | 2 | 3 | *4* | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 ...
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
UE RX: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | *10* | 11 | 12 | 13 | 14 ...
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
UE TX: | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | *12* | 13 | 14 ...
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
As a final note, we do TX before RX to ensure that the eNB will
|
||||
get some data and send us something so there is no deadlock
|
||||
at the beginning of things. Hopefully the kernel buffers for
|
||||
the sockets are big enough so that the first (big) TX can
|
||||
return to user mode before the buffers are full. If this
|
||||
is wrong in some environment, we will need to work by smaller
|
||||
units of data at a time.
|
||||
*/
|
||||
int tcp_bridge_ue_first_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
|
||||
if (cc != 1) {
|
||||
printf("tcp_bridge: only 1 antenna supported\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
tcp_bridge_state_t *t = device->priv;
|
||||
uint32_t b[t->samples_per_subframe * 12];
|
||||
memset(b, 0, t->samples_per_subframe * 12 * 4);
|
||||
int n = fullwrite(t->sock, b, t->samples_per_subframe * 12 * 4);
|
||||
|
||||
if (n != t->samples_per_subframe * 12 * 4) {
|
||||
printf("tcp_bridge: write error ret %d error %s\n", n, strerror(errno));
|
||||
abort();
|
||||
}
|
||||
|
||||
n = fullread(t->sock, b, t->samples_per_subframe * 6 * 4);
|
||||
|
||||
if (n != t->samples_per_subframe * 6 * 4) {
|
||||
printf("tcp_bridge: read error ret %d error %s\n", n, strerror(errno));
|
||||
abort();
|
||||
}
|
||||
|
||||
device->trx_read_func = tcp_bridge_read_ue;
|
||||
|
||||
return tcp_bridge_read_ue(device, timestamp, buff, nsamps, cc);
|
||||
}
|
||||
|
||||
__attribute__((__visibility__("default")))
|
||||
int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
|
||||
{
|
||||
tcp_bridge_state_t *tcp_bridge = (tcp_bridge_state_t*)malloc(sizeof(tcp_bridge_state_t));
|
||||
memset(tcp_bridge, 0, sizeof(tcp_bridge_state_t));
|
||||
int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
tcp_bridge_state_t *tcp_bridge = (tcp_bridge_state_t *)calloc(sizeof(tcp_bridge_state_t),1);
|
||||
|
||||
tcp_bridge->is_enb = getenv("ENODEB") != NULL;
|
||||
if ((tcp_bridge->ip=getenv("TCPBRIDGE")) == NULL ) {
|
||||
/* for compatibility, we test the ENB environment variable */
|
||||
if ((tcp_bridge->ip=getenv("ENODEB")) != NULL ) {
|
||||
tcp_bridge->ip=strdup("enb");
|
||||
} else {
|
||||
tcp_bridge->ip=strdup("127.0.0.1");
|
||||
}
|
||||
}
|
||||
|
||||
tcp_bridge->is_enb = strncasecmp(tcp_bridge->ip,"enb",3) == 0;
|
||||
printf("tcp_bridge: running as %s\n", tcp_bridge->is_enb ? "eNB" : "UE");
|
||||
|
||||
/* only 25, 50 or 100 PRBs handled for the moment */
|
||||
@@ -323,15 +400,21 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
|
||||
device->priv = tcp_bridge;
|
||||
|
||||
switch ((int)openair0_cfg[0].sample_rate) {
|
||||
case 30720000: tcp_bridge->samples_per_subframe = 30720; break;
|
||||
case 15360000: tcp_bridge->samples_per_subframe = 15360; break;
|
||||
case 7680000: tcp_bridge->samples_per_subframe = 7680; break;
|
||||
case 30720000:
|
||||
tcp_bridge->samples_per_subframe = 30720;
|
||||
break;
|
||||
|
||||
case 15360000:
|
||||
tcp_bridge->samples_per_subframe = 15360;
|
||||
break;
|
||||
|
||||
case 7680000:
|
||||
tcp_bridge->samples_per_subframe = 7680;
|
||||
break;
|
||||
}
|
||||
|
||||
/* let's pretend to be a b2x0 */
|
||||
device->type = USRP_B200_DEV;
|
||||
|
||||
device->openair0_cfg=&openair0_cfg[0];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -689,7 +689,7 @@ int main( int argc, char **argv ) {
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
#endif
|
||||
ret=config_check_cmdlineopt(NULL);
|
||||
ret=config_check_unknown_cmdlineopt(NULL);
|
||||
|
||||
if (ret != 0) {
|
||||
LOG_E(ENB_APP, "%i unknown options in command line\n",ret);
|
||||
@@ -938,7 +938,7 @@ int main( int argc, char **argv ) {
|
||||
sync_var=0;
|
||||
pthread_cond_broadcast(&sync_cond);
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
ret=config_check_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
||||
ret=config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
||||
|
||||
if (ret != 0) {
|
||||
LOG_E(ENB_APP, "%i unknown options in command line (invalid section name)\n",ret);
|
||||
|
||||
@@ -1010,7 +1010,7 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
|
||||
#endif
|
||||
ret=config_check_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
||||
ret=config_check_unknown_cmdlineopt(CONFIG_CHECKALLSECTIONS);
|
||||
|
||||
if (ret != 0) {
|
||||
LOG_E(ENB_APP, "%i unknown options in command line (invalid section name)\n",ret);
|
||||
|
||||
Reference in New Issue
Block a user