corenet: add explicit exception handling
This commit is contained in:
parent
da627ace3a
commit
126b695e51
|
@ -123,7 +123,7 @@ class ENBd(object):
|
||||||
# eNB-initiated procedure, instantiate it
|
# eNB-initiated procedure, instantiate it
|
||||||
try:
|
try:
|
||||||
Proc = S1APNonUEProcEnbDispatcher[pdu_rx[1]['procedureCode']](self)
|
Proc = S1APNonUEProcEnbDispatcher[pdu_rx[1]['procedureCode']](self)
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid S1AP PDU, initiatingMessage, code %i'\
|
self._log('ERR', 'invalid S1AP PDU, initiatingMessage, code %i'\
|
||||||
% pdu_rx[1]['procedureCode'])
|
% pdu_rx[1]['procedureCode'])
|
||||||
errcause = ('protocol', 'abstract-syntax-error-reject')
|
errcause = ('protocol', 'abstract-syntax-error-reject')
|
||||||
|
@ -151,7 +151,7 @@ class ENBd(object):
|
||||||
# CN-initiated procedure, transfer the PDU to it
|
# CN-initiated procedure, transfer the PDU to it
|
||||||
try:
|
try:
|
||||||
Proc = self.Proc[pdu_rx[1]['procedureCode']]
|
Proc = self.Proc[pdu_rx[1]['procedureCode']]
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid S1AP PDU, %s, code %i'\
|
self._log('ERR', 'invalid S1AP PDU, %s, code %i'\
|
||||||
% (pdu_rx[0], pdu_rx[1]['procedureCode']))
|
% (pdu_rx[0], pdu_rx[1]['procedureCode']))
|
||||||
errcause = ('protocol', 'message-not-compatible-with-receiver-state')
|
errcause = ('protocol', 'message-not-compatible-with-receiver-state')
|
||||||
|
@ -255,7 +255,7 @@ class ENBd(object):
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
ue = self.UE[ctx_id]
|
ue = self.UE[ctx_id]
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid eNB UE context id provided')
|
self._log('ERR', 'invalid eNB UE context id provided')
|
||||||
errcause = ('radioNetwork', 'unknown-enb-ue-s1ap-id')
|
errcause = ('radioNetwork', 'unknown-enb-ue-s1ap-id')
|
||||||
Proc = self.init_s1ap_proc(S1APErrorIndNonUECN, Cause=errcause)
|
Proc = self.init_s1ap_proc(S1APErrorIndNonUECN, Cause=errcause)
|
||||||
|
@ -271,7 +271,7 @@ class ENBd(object):
|
||||||
def unset_ue_s1(self, ctx_id):
|
def unset_ue_s1(self, ctx_id):
|
||||||
try:
|
try:
|
||||||
del self.UE[ctx_id]
|
del self.UE[ctx_id]
|
||||||
except:
|
except Exception:
|
||||||
self._log('WNG', 'no UE with S1 context-id %i to unset' % ctx_id)
|
self._log('WNG', 'no UE with S1 context-id %i to unset' % ctx_id)
|
||||||
|
|
||||||
def get_ued(self, pdu_rx):
|
def get_ued(self, pdu_rx):
|
||||||
|
@ -466,7 +466,7 @@ class ENBd(object):
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
del self.WARN[msgid]
|
del self.WARN[msgid]
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ class GNBd(object):
|
||||||
# gNB-initiated procedure, instantiate it
|
# gNB-initiated procedure, instantiate it
|
||||||
try:
|
try:
|
||||||
Proc = NGAPNonUEProcRANDispatcher[pdu_rx[1]['procedureCode']](self)
|
Proc = NGAPNonUEProcRANDispatcher[pdu_rx[1]['procedureCode']](self)
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid NGAP PDU, initiatingMessage, code %i'\
|
self._log('ERR', 'invalid NGAP PDU, initiatingMessage, code %i'\
|
||||||
% pdu_rx[1]['procedureCode'])
|
% pdu_rx[1]['procedureCode'])
|
||||||
errcause = ('protocol', 'abstract-syntax-error-reject')
|
errcause = ('protocol', 'abstract-syntax-error-reject')
|
||||||
|
@ -153,7 +153,7 @@ class GNBd(object):
|
||||||
# CN-initiated procedure, transfer the PDU to it
|
# CN-initiated procedure, transfer the PDU to it
|
||||||
try:
|
try:
|
||||||
Proc = self.Proc[pdu_rx[1]['procedureCode']]
|
Proc = self.Proc[pdu_rx[1]['procedureCode']]
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid NGAP PDU, %s, code %i'\
|
self._log('ERR', 'invalid NGAP PDU, %s, code %i'\
|
||||||
% (pdu_rx[0], pdu_rx[1]['procedureCode']))
|
% (pdu_rx[0], pdu_rx[1]['procedureCode']))
|
||||||
errcause = ('protocol', 'message-not-compatible-with-receiver-state')
|
errcause = ('protocol', 'message-not-compatible-with-receiver-state')
|
||||||
|
|
|
@ -143,7 +143,7 @@ class HNBd(SigStack):
|
||||||
# HNB-initiated procedure, instantiate it
|
# HNB-initiated procedure, instantiate it
|
||||||
try:
|
try:
|
||||||
Proc = HNBAPProcHnbDispatcher[pdu_rx[1]['procedureCode']](self)
|
Proc = HNBAPProcHnbDispatcher[pdu_rx[1]['procedureCode']](self)
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid HNBAP PDU, initiatingMessage, code %i'\
|
self._log('ERR', 'invalid HNBAP PDU, initiatingMessage, code %i'\
|
||||||
% pdu_rx[1]['procedureCode'])
|
% pdu_rx[1]['procedureCode'])
|
||||||
errcause = ('protocol', 'abstract-syntax-error-reject')
|
errcause = ('protocol', 'abstract-syntax-error-reject')
|
||||||
|
@ -168,7 +168,7 @@ class HNBd(SigStack):
|
||||||
# GW-initiated procedure, transfer the response PDU to it
|
# GW-initiated procedure, transfer the response PDU to it
|
||||||
try:
|
try:
|
||||||
Proc = self.ProcHnbap[pdu_rx[1]['procedureCode']]
|
Proc = self.ProcHnbap[pdu_rx[1]['procedureCode']]
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid HNBAP PDU, %s, code %i'\
|
self._log('ERR', 'invalid HNBAP PDU, %s, code %i'\
|
||||||
% (pdu_rx[0], pdu_rx[1]['procedureCode']))
|
% (pdu_rx[0], pdu_rx[1]['procedureCode']))
|
||||||
errcause = ('protocol', 'message-not-compatible-with-receiver-state')
|
errcause = ('protocol', 'message-not-compatible-with-receiver-state')
|
||||||
|
@ -239,7 +239,7 @@ class HNBd(SigStack):
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
Proc = RUAProcDispatcher[pdu_rx[1]['procedureCode']](self)
|
Proc = RUAProcDispatcher[pdu_rx[1]['procedureCode']](self)
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid RUA PDU, initiatingMessage, code %i'\
|
self._log('ERR', 'invalid RUA PDU, initiatingMessage, code %i'\
|
||||||
% pdu_rx[1]['procedureCode'])
|
% pdu_rx[1]['procedureCode'])
|
||||||
errcause = ('protocol', 'abstract-syntax-error-reject')
|
errcause = ('protocol', 'abstract-syntax-error-reject')
|
||||||
|
@ -318,7 +318,7 @@ class HNBd(SigStack):
|
||||||
return []
|
return []
|
||||||
try:
|
try:
|
||||||
PDU_RANAP.from_aper(buf)
|
PDU_RANAP.from_aper(buf)
|
||||||
except:
|
except Exception:
|
||||||
asn_ranap_release()
|
asn_ranap_release()
|
||||||
self._log('WNG', 'invalid RANAP PDU transfer-syntax: %s'\
|
self._log('WNG', 'invalid RANAP PDU transfer-syntax: %s'\
|
||||||
% hexlify(buf).decode('ascii'))
|
% hexlify(buf).decode('ascii'))
|
||||||
|
@ -338,7 +338,7 @@ class HNBd(SigStack):
|
||||||
# RNC-initiated procedure, instantiate it
|
# RNC-initiated procedure, instantiate it
|
||||||
try:
|
try:
|
||||||
Proc = RANAPConlessProcRncDispatcher[pdu_rx[1]['procedureCode']](self)
|
Proc = RANAPConlessProcRncDispatcher[pdu_rx[1]['procedureCode']](self)
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid connect-less RANAP PDU, initiatingMessage, code %i'\
|
self._log('ERR', 'invalid connect-less RANAP PDU, initiatingMessage, code %i'\
|
||||||
% pdu_rx[1]['procedureCode'])
|
% pdu_rx[1]['procedureCode'])
|
||||||
# error cause: protocol, abstract-syntax-error-reject
|
# error cause: protocol, abstract-syntax-error-reject
|
||||||
|
@ -367,7 +367,7 @@ class HNBd(SigStack):
|
||||||
# CN-initiated procedure, transfer the PDU to it
|
# CN-initiated procedure, transfer the PDU to it
|
||||||
try:
|
try:
|
||||||
Proc = self.ProcRanap[pdu_rx[1]['procedureCode']]
|
Proc = self.ProcRanap[pdu_rx[1]['procedureCode']]
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid connect-less RANAP PDU, %s, code %i'\
|
self._log('ERR', 'invalid connect-less RANAP PDU, %s, code %i'\
|
||||||
% (pdu_rx[0], pdu_rx[1]['procedureCode']))
|
% (pdu_rx[0], pdu_rx[1]['procedureCode']))
|
||||||
# error cause: protocol, message-not-compatible-with-receiver-state
|
# error cause: protocol, message-not-compatible-with-receiver-state
|
||||||
|
@ -448,19 +448,19 @@ class HNBd(SigStack):
|
||||||
def unset_ue_hnbap(self, ctx_id):
|
def unset_ue_hnbap(self, ctx_id):
|
||||||
try:
|
try:
|
||||||
del self.UE_HNBAP[ctx_id]
|
del self.UE_HNBAP[ctx_id]
|
||||||
except:
|
except Exception:
|
||||||
self._log('WNG', 'no UE with HNBAP context-id %i to unset' % ctx_id)
|
self._log('WNG', 'no UE with HNBAP context-id %i to unset' % ctx_id)
|
||||||
|
|
||||||
def unset_ue_iucs(self, ctx_id):
|
def unset_ue_iucs(self, ctx_id):
|
||||||
try:
|
try:
|
||||||
del self.UE_IuCS[ctx_id]
|
del self.UE_IuCS[ctx_id]
|
||||||
except:
|
except Exception:
|
||||||
self._log('WNG', 'no UE with IuCS context-id %i to unset' % ctx_id)
|
self._log('WNG', 'no UE with IuCS context-id %i to unset' % ctx_id)
|
||||||
|
|
||||||
def unset_ue_iups(self, ctx_id):
|
def unset_ue_iups(self, ctx_id):
|
||||||
try:
|
try:
|
||||||
del self.UE_IuPS[ctx_id]
|
del self.UE_IuPS[ctx_id]
|
||||||
except:
|
except Exception:
|
||||||
self._log('WNG', 'no UE with IuPS context-id %i to unset' % ctx_id)
|
self._log('WNG', 'no UE with IuPS context-id %i to unset' % ctx_id)
|
||||||
|
|
||||||
#--------------------------------------------------------------------------#
|
#--------------------------------------------------------------------------#
|
||||||
|
@ -523,7 +523,7 @@ class HNBd(SigStack):
|
||||||
for ctx_id in reslist:
|
for ctx_id in reslist:
|
||||||
try:
|
try:
|
||||||
ue = self.UE_IuPS[ctx_id]
|
ue = self.UE_IuPS[ctx_id]
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ue.IuPS.unset_ran()
|
ue.IuPS.unset_ran()
|
||||||
|
@ -536,7 +536,7 @@ class HNBd(SigStack):
|
||||||
for ctx_id in reslist:
|
for ctx_id in reslist:
|
||||||
try:
|
try:
|
||||||
ue = self.UE_IuCS[ctx_id]
|
ue = self.UE_IuCS[ctx_id]
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
ue.IuCS.unset_ran()
|
ue.IuCS.unset_ran()
|
||||||
|
|
|
@ -408,7 +408,7 @@ class UEd(SigStack):
|
||||||
if self.TMSI is not None:
|
if self.TMSI is not None:
|
||||||
try:
|
try:
|
||||||
del self.Server.TMSI[self.TMSI]
|
del self.Server.TMSI[self.TMSI]
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
# set the new TMSI
|
# set the new TMSI
|
||||||
self.TMSI = tmsi
|
self.TMSI = tmsi
|
||||||
|
@ -420,7 +420,7 @@ class UEd(SigStack):
|
||||||
if self.PTMSI is not None:
|
if self.PTMSI is not None:
|
||||||
try:
|
try:
|
||||||
del self.Server.PTMSI[self.PTMSI]
|
del self.Server.PTMSI[self.PTMSI]
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
# set the new PTMSI
|
# set the new PTMSI
|
||||||
self.PTMSI = ptmsi
|
self.PTMSI = ptmsi
|
||||||
|
@ -432,7 +432,7 @@ class UEd(SigStack):
|
||||||
if self.MTMSI is not None:
|
if self.MTMSI is not None:
|
||||||
try:
|
try:
|
||||||
del self.Server.MTMSI[self.MTMSI]
|
del self.Server.MTMSI[self.MTMSI]
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
# set the new PTMSI
|
# set the new PTMSI
|
||||||
self.MTMSI = mtmsi
|
self.MTMSI = mtmsi
|
||||||
|
@ -725,7 +725,7 @@ class UEd(SigStack):
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
from IPython.lib.pretty import pretty
|
from IPython.lib.pretty import pretty
|
||||||
except:
|
except Exception:
|
||||||
pretty = repr
|
pretty = repr
|
||||||
else:
|
else:
|
||||||
txt = []
|
txt = []
|
||||||
|
|
|
@ -308,7 +308,7 @@ class UEMMd(SigStack):
|
||||||
Proc = self.init_proc(ProcClass, encod={ProcClass.Init: IEs}, mm_preempt=True)
|
Proc = self.init_proc(ProcClass, encod={ProcClass.Init: IEs}, mm_preempt=True)
|
||||||
try:
|
try:
|
||||||
RanapTxProc = Proc.output()
|
RanapTxProc = Proc.output()
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid IEs for network-initiated procedure %s' % Proc.Name)
|
self._log('ERR', 'invalid IEs for network-initiated procedure %s' % Proc.Name)
|
||||||
Proc.abort()
|
Proc.abort()
|
||||||
return False, Proc
|
return False, Proc
|
||||||
|
@ -677,7 +677,7 @@ class UEIuCSd(UEIuSigStack):
|
||||||
if isinstance(cause, integer_types):
|
if isinstance(cause, integer_types):
|
||||||
try:
|
try:
|
||||||
IEs['PagingCause'] = RANAP.RANAP_IEs.PagingCause._cont_rev[cause]
|
IEs['PagingCause'] = RANAP.RANAP_IEs.PagingCause._cont_rev[cause]
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
elif isinstance(cause, str_types):
|
elif isinstance(cause, str_types):
|
||||||
IEs['PagingCause'] = cause
|
IEs['PagingCause'] = cause
|
||||||
|
@ -696,7 +696,7 @@ class UEIuCSd(UEIuSigStack):
|
||||||
try:
|
try:
|
||||||
rncs = [self.Server.RAN[rncid] for \
|
rncs = [self.Server.RAN[rncid] for \
|
||||||
rncid in self.Server.LAI[(self.UE.PLMN, self.UE.LAC)]]
|
rncid in self.Server.LAI[(self.UE.PLMN, self.UE.LAC)]]
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'paging: no RNC serving the UE LAI %s.%.4x'\
|
self._log('ERR', 'paging: no RNC serving the UE LAI %s.%.4x'\
|
||||||
% (self.UE.PLMN, self.UE.LAC))
|
% (self.UE.PLMN, self.UE.LAC))
|
||||||
return
|
return
|
||||||
|
@ -721,7 +721,7 @@ class UEIuCSd(UEIuSigStack):
|
||||||
try:
|
try:
|
||||||
rncs = [self.Server.RAN[rncid] for \
|
rncs = [self.Server.RAN[rncid] for \
|
||||||
rncid in self.Server.LAI[(self.UE.PLMN, self.UE.LAC)]]
|
rncid in self.Server.LAI[(self.UE.PLMN, self.UE.LAC)]]
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'paging: no RNC serving the UE LAI %s.%.4x'\
|
self._log('ERR', 'paging: no RNC serving the UE LAI %s.%.4x'\
|
||||||
% (self.UE.PLMN, self.UE.LAC))
|
% (self.UE.PLMN, self.UE.LAC))
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -365,7 +365,7 @@ class UEGMMd(SigStack):
|
||||||
Proc = self.init_proc(ProcClass, encod={ProcClass.Init: IEs}, mm_preempt=True)
|
Proc = self.init_proc(ProcClass, encod={ProcClass.Init: IEs}, mm_preempt=True)
|
||||||
try:
|
try:
|
||||||
RanapTxProc = Proc.output()
|
RanapTxProc = Proc.output()
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'invalid IEs for network-initiated procedure %s' % Proc.Name)
|
self._log('ERR', 'invalid IEs for network-initiated procedure %s' % Proc.Name)
|
||||||
Proc.abort()
|
Proc.abort()
|
||||||
return False, Proc
|
return False, Proc
|
||||||
|
@ -996,7 +996,7 @@ class UEIuPSd(UEIuSigStack):
|
||||||
if isinstance(cause, integer_types):
|
if isinstance(cause, integer_types):
|
||||||
try:
|
try:
|
||||||
IEs['PagingCause'] = RANAP.RANAP_IEs.PagingCause._cont_rev[cause]
|
IEs['PagingCause'] = RANAP.RANAP_IEs.PagingCause._cont_rev[cause]
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
elif isinstance(cause, str_types):
|
elif isinstance(cause, str_types):
|
||||||
IEs['PagingCause'] = cause
|
IEs['PagingCause'] = cause
|
||||||
|
@ -1015,7 +1015,7 @@ class UEIuPSd(UEIuSigStack):
|
||||||
rai = (self.UE.PLMN, self.UE.LAC, self.UE.RAC)
|
rai = (self.UE.PLMN, self.UE.LAC, self.UE.RAC)
|
||||||
try:
|
try:
|
||||||
rncs = [self.Server.RAN[rncid] for rncid in self.Server.RAI[rai]]
|
rncs = [self.Server.RAN[rncid] for rncid in self.Server.RAI[rai]]
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'paging: no RNC serving the UE RAI %s.%.4x.%.2x' % rai)
|
self._log('ERR', 'paging: no RNC serving the UE RAI %s.%.4x.%.2x' % rai)
|
||||||
return
|
return
|
||||||
#
|
#
|
||||||
|
@ -1039,7 +1039,7 @@ class UEIuPSd(UEIuSigStack):
|
||||||
rai = (self.UE.PLMN, self.UE.LAC, self.UE.RAC)
|
rai = (self.UE.PLMN, self.UE.LAC, self.UE.RAC)
|
||||||
try:
|
try:
|
||||||
rncs = [self.Server.RAN[rncid] for rncid in self.Server.RAI[rai]]
|
rncs = [self.Server.RAN[rncid] for rncid in self.Server.RAI[rai]]
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'paging: no RNC serving the UE RAI %s.%.4x.%.2x' % rai)
|
self._log('ERR', 'paging: no RNC serving the UE RAI %s.%.4x.%.2x' % rai)
|
||||||
return False
|
return False
|
||||||
#
|
#
|
||||||
|
|
|
@ -622,7 +622,7 @@ class CorenetServer(object):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
PDU_HNBAP.from_aper(buf)
|
PDU_HNBAP.from_aper(buf)
|
||||||
except:
|
except Exception:
|
||||||
asn_hnbap_release()
|
asn_hnbap_release()
|
||||||
hnb._log('WNG', 'invalid HNBAP PDU transfer-syntax: %s'\
|
hnb._log('WNG', 'invalid HNBAP PDU transfer-syntax: %s'\
|
||||||
% hexlify(buf).decode('ascii'))
|
% hexlify(buf).decode('ascii'))
|
||||||
|
@ -647,7 +647,7 @@ class CorenetServer(object):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
PDU_RUA.from_aper(buf)
|
PDU_RUA.from_aper(buf)
|
||||||
except:
|
except Exception:
|
||||||
asn_rua_release()
|
asn_rua_release()
|
||||||
self._log('WNG', 'invalid RUA PDU transfer-syntax: %s'\
|
self._log('WNG', 'invalid RUA PDU transfer-syntax: %s'\
|
||||||
% hexlify(buf).decode('ascii'))
|
% hexlify(buf).decode('ascii'))
|
||||||
|
@ -672,7 +672,7 @@ class CorenetServer(object):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
PDU_S1AP.from_aper(buf)
|
PDU_S1AP.from_aper(buf)
|
||||||
except:
|
except Exception:
|
||||||
asn_s1ap_release()
|
asn_s1ap_release()
|
||||||
enb._log('WNG', 'invalid S1AP PDU transfer-syntax: %s'\
|
enb._log('WNG', 'invalid S1AP PDU transfer-syntax: %s'\
|
||||||
% hexlify(buf).decode('ascii'))
|
% hexlify(buf).decode('ascii'))
|
||||||
|
@ -701,7 +701,7 @@ class CorenetServer(object):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
PDU_NGAP.from_aper(buf)
|
PDU_NGAP.from_aper(buf)
|
||||||
except:
|
except Exception:
|
||||||
asn_ngap_release()
|
asn_ngap_release()
|
||||||
gnb._log('WNG', 'invalid NGAP PDU transfer-syntax: %s'\
|
gnb._log('WNG', 'invalid NGAP PDU transfer-syntax: %s'\
|
||||||
% hexlify(buf).decode('ascii'))
|
% hexlify(buf).decode('ascii'))
|
||||||
|
@ -804,7 +804,7 @@ class CorenetServer(object):
|
||||||
PLMN = plmn_buf_to_str(plmn)
|
PLMN = plmn_buf_to_str(plmn)
|
||||||
CellID = cellid_bstr_to_str(cellid)
|
CellID = cellid_bstr_to_str(cellid)
|
||||||
return PLMN, CellID
|
return PLMN, CellID
|
||||||
except:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _send_s1setuprej(self, sk, cause):
|
def _send_s1setuprej(self, sk, cause):
|
||||||
|
@ -849,7 +849,7 @@ class CorenetServer(object):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
PDU_S1AP.from_aper(buf)
|
PDU_S1AP.from_aper(buf)
|
||||||
except:
|
except Exception:
|
||||||
self._log('WNG', 'invalid S1AP PDU transfer-syntax: %s'\
|
self._log('WNG', 'invalid S1AP PDU transfer-syntax: %s'\
|
||||||
% hexlify(buf).decode('ascii'))
|
% hexlify(buf).decode('ascii'))
|
||||||
# return nothing, no need to bother
|
# return nothing, no need to bother
|
||||||
|
@ -926,7 +926,7 @@ class CorenetServer(object):
|
||||||
for tai in enb.Config['TAIs']:
|
for tai in enb.Config['TAIs']:
|
||||||
try:
|
try:
|
||||||
self.TAI[tai].remove(enb.ID)
|
self.TAI[tai].remove(enb.ID)
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'RAN node %r not referenced into the TAI table' % (enb.ID,))
|
self._log('ERR', 'RAN node %r not referenced into the TAI table' % (enb.ID,))
|
||||||
|
|
||||||
#--------------------------------------------------------------------------#
|
#--------------------------------------------------------------------------#
|
||||||
|
@ -1004,7 +1004,7 @@ class CorenetServer(object):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
PDU_NGAP.from_aper(buf)
|
PDU_NGAP.from_aper(buf)
|
||||||
except:
|
except Exception:
|
||||||
self._log('WNG', 'invalid NGAP PDU transfer-syntax: %s'\
|
self._log('WNG', 'invalid NGAP PDU transfer-syntax: %s'\
|
||||||
% hexlify(buf).decode('ascii'))
|
% hexlify(buf).decode('ascii'))
|
||||||
# return nothing, no need to bother
|
# return nothing, no need to bother
|
||||||
|
@ -1103,7 +1103,7 @@ class CorenetServer(object):
|
||||||
PLMN = plmn_buf_to_str(plmn)
|
PLMN = plmn_buf_to_str(plmn)
|
||||||
CellID = cellid_bstr_to_str(cellid)
|
CellID = cellid_bstr_to_str(cellid)
|
||||||
return PLMN, CellID
|
return PLMN, CellID
|
||||||
except:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def _send_hnbregrej(self, sk, cause):
|
def _send_hnbregrej(self, sk, cause):
|
||||||
|
@ -1147,7 +1147,7 @@ class CorenetServer(object):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
PDU_HNBAP.from_aper(buf)
|
PDU_HNBAP.from_aper(buf)
|
||||||
except:
|
except Exception:
|
||||||
self._log('WNG', 'invalid HNBAP PDU transfer-syntax: %s'\
|
self._log('WNG', 'invalid HNBAP PDU transfer-syntax: %s'\
|
||||||
% hexlify(buf).decode('ascii'))
|
% hexlify(buf).decode('ascii'))
|
||||||
# return nothing, no need to bother
|
# return nothing, no need to bother
|
||||||
|
@ -1232,11 +1232,11 @@ class CorenetServer(object):
|
||||||
rai = lai + (hnb.Config['RAC'], )
|
rai = lai + (hnb.Config['RAC'], )
|
||||||
try:
|
try:
|
||||||
self.LAI[lai].remove(hnb.ID)
|
self.LAI[lai].remove(hnb.ID)
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'HNB not referenced into the LAI table')
|
self._log('ERR', 'HNB not referenced into the LAI table')
|
||||||
try:
|
try:
|
||||||
self.RAI[rai].remove(hnb.ID)
|
self.RAI[rai].remove(hnb.ID)
|
||||||
except:
|
except Exception:
|
||||||
self._log('ERR', 'HNB not referenced into the RAI table')
|
self._log('ERR', 'HNB not referenced into the RAI table')
|
||||||
|
|
||||||
#--------------------------------------------------------------------------#
|
#--------------------------------------------------------------------------#
|
||||||
|
|
Loading…
Reference in New Issue