corenet: fix merging UE stacks

This commit is contained in:
mitshell 2018-02-13 21:15:25 +01:00
parent 401e80e18c
commit 28bc68e36d
2 changed files with 5 additions and 6 deletions

View File

@ -1,7 +1,7 @@
# -*- coding: UTF-8 -*-
#/**
# * Software Name : pycrate
# * Version : 0.3
# * Version : 0.2
# *
# * Copyright 2017. Benoit Michau. ANSSI.
# *
@ -171,9 +171,6 @@ class UEd(SigStack):
self.S1.ESM.PDNConfig[apn] = apncfg
def set_ran(self, ran, ctx_id, sid=None, dom=None):
# TODO: handle properly mobility between RNC / eNB
# for Iu reconnection, handle domain correclty, together within ProcCNRua
# UE going connected
if ran.__class__.__name__ == 'HNBd':
#
@ -280,6 +277,7 @@ class UEd(SigStack):
if cksn in self.IuPS.SEC and cksn not in iupsd.SEC:
iupsd.SEC[cksn] = self.IuPS.SEC[cksn]
# merge PDP contexts
iupsd.SM.PDPConfig = self.SM.PDPConfig
for nsapi in range(16):
if nsapi in self.IuPS.SM.PDP and nsapi not in iupsd.SM.PDP:
iupsd.SM.PDP[nsapi] = self.IuPS.SM.PDP[nsapi]
@ -307,9 +305,10 @@ class UEd(SigStack):
if ksi in self.S1.SEC and ksi not in s1d.SEC:
s1d.SEC[ksi] = self.S1.SEC[ksi]
# merge PDN contexts
s1d.ESM.PDNConfig = self.S1.ESM.PDNConfig
for ebi in range(16):
if ebi in self.S1.ESM.PDN and ebi not in s1d.ESM.PDN:
s1d.ESM.PDN[ebi] = self.S1.ESM.PDP[ebi]
s1d.ESM.PDN[ebi] = self.S1.ESM.PDN[ebi]
# transfer UE's reference
self.S1 = s1d
s1d.UE = self

View File

@ -82,7 +82,7 @@ class AuC:
DEBUG = ('ERR', 'WNG', 'INF', 'DBG')
AUC_DB_PATH = os.path.dirname(os.path.abspath( __file__ )) + os.sep
#AuC_db_path = 'C:\Python27\Lib\sitepackages\pycrate_corenet\'
#AUC_DB_PATH = 'C:\Python27\Lib\sitepackages\pycrate_corenet\'
# when rewriting the AuC.db, do a back-up of the last version of the file
DO_BACKUP = True