예제 #1
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Bit('ForceStdby', ReprName='Force to standby', Pt=0, BitLen=4,
             Repr='hum', Dict=ForceStdby_dict),
         Bit('AttachResFOP', ReprName='Attach follow-on proceed',
             Pt=0, BitLen=1, Repr='hum', Dict=AttachResFOP_dict),
         Bit('AttachRes', ReprName='Attach result', Pt=1, BitLen=3,
             Repr='hum', Dict=AttachRes_dict),
         Int('GPRSTimer', ReprName='Periodic RA update timer', Pt=0,
             Type='uint8'),
         Bit('RadioPrio_2', ReprName='Radio priority 2', Pt=1, BitLen=4),
         Bit('RadioPrio', ReprName='Radio priority', Pt=1, BitLen=4),
         Str('RAI', ReprName='Routing area identification', Pt=6*'\0',
             Len=6),
         Type3_TV('PTMSISign', ReprName='Old P-TMSI signature', T=0x19,
                  V=3*'\0', Len=3),
         Type3_TV('GPRSTimer_2', ReprName='Negotiated READY timer', T=0x17,
                  V='\0', Len=1),
         Type4_TLV('ID', ReprName='Allocated P-TMSI', T=0x18,
                   V=ID(type='TMSI')),
         Type4_TLV('ID_2', ReprName='MS identity', T=0x23, V=ID()),
         Type3_TV('GMMCause', T=0x25, V='\x01', Len=1), # see GMMCause_dict
         Type4_TLV('T3302', T=0x2A, V='\0'),
         Type2('CellNotif', T=0x8C),
         Type4_TLV('PLMNList', ReprName='Equivalent PLMNs', T=0x4A, 
                   V=PLMNList()),
         Type1_TV('NetFeatSupport', T=0xA, V=0),
         Type4_TLV('T3319', T=0x37, V='\0'),
         Type4_TLV('T3323', T=0x38, V='\0'),
         ])
     self._post_init(with_options, **kwargs)
예제 #2
0
 def _map_eps_id(self):
     # some additional processing for interpreting EPS_ID as ID or GUTI
     for ie in self[3:]:
         if ie.CallName == 'EPS_ID' and not ie.Trans:
             s = str(ie.V)
             if not s:
                 return
             typ = ord(s[0]) & 0b111
             ident = None
             if typ in (1, 3):
                 ident = ID()
             elif typ == 6:
                 ident = GUTI()
             if ident:
                 ident.map(s)
                 if str(ident) == s:
                     ie.V < None
                     ie.V > ident
예제 #3
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Bit('CKSN', ReprName='GPRS ciphering key sequence number',
             Pt=0, BitLen=4, Dict=CKSN_dict),
         Bit('UpdateTypeFOR', ReprName='Update follow-on request pending',
             Pt=0, BitLen=1, Repr='hum', Dict=AttachTypeFOR_dict),
         Bit('UpdateType', Pt=0, BitLen=3, Repr='hum', Dict=UpdateType_dict),
         Str('RAI', ReprName='Old routing area identification', Pt=6*'\0',
             Len=6),
         Type4_LV('MSRACap', ReprName='MS radio access capability',
                  V=5*'\0'),
         Type3_TV('PTMSISign', ReprName='Old P-TMSI signature', T=0x19,
                  V=3*'\0', Len=3),
         Type3_TV('GPRSTimer', ReprName='Request READY timer', T=0x17,
                  V='\0', Len=1),
         Type3_TV('DRXPara', ReprName='DRX parameter', T=0x27,
                  V='\0\0', Len=2),
         Type1_TV('TMSIStat', ReprName='TMSI status', T=0x9, V=0,
                  Dict=TMSIStatus_dict),
         Type4_TLV('ID', T=0x18, V=ID(type='TMSI')),
         Type4_TLV('MSNetCap', ReprName='MS network capability', T=0x31,
                   V='\0\0'),
         Type4_TLV('PDPCtxStat', ReprName='PDP context status', T=0x32,
                   V='\0\0'),
         Type4_TLV('PSLCSCap', ReprName='PS location service capability',
                   T=0x33, V='\0'),
         Type4_TLV('MBMSCtxStat', ReprName='MBMS context status', T=0x35,
                   V=''),
         Type4_TLV('UENetCap', ReprName='UE network capability', T=0x58,
                   V='\0\0'),
         Type4_TLV('ID_2', ReprName='Additional mobile identity', T=0x1A,
                   V=ID()),
         Type4_TLV('RAI_2', ReprName='Additional old routing area identification',
                   T=0x1B, V=6*'\0'),
         Type4_TLV('MSCm2', T=0x11, V=MSCm2()),
         Type4_TLV('MSCm3', T=0x20, V=MSCm3()),
         Type4_TLV('SuppCodecs', ReprName='Supported codecs list',
                   T=0x40, V='\0\0\0'),
         Type4_TLV('VoicePref', ReprName='Voice domain preference', T=0x5D,
                   V='\0'),
         ])
     self._post_init(with_options, **kwargs)
예제 #4
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Bit('spare', Pt=0, BitLen=4),
         Bit('CKSN', ReprName='Ciphering Key Sequence Number', \
             Pt=0, BitLen=4, Dict=CKSN_dict, Repr='hum'),
         Type4_LV('MSCm2', V=MSCm2()),
         Type4_LV('ID', V=ID()),
         Type3_TV('LAI', T=0x13, V=LAI(), Len=5)])
     self._post_init(with_options, **kwargs)
예제 #5
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Bit('CKSN', ReprName='Ciphering Key Sequence Number', \
             Pt=0, BitLen=4, Dict=CKSN_dict, Repr='hum'),
         Bit('Service', Pt=1, BitLen=4, Dict=CMService_dict, Repr='hum'),
         Type4_LV('MSCm2', V=MSCm2()),
         Type4_LV('ID', V=ID()),
         Type1_TV('Priority', T=0x8, V=0)])
     self._post_init(with_options, **kwargs)
예제 #6
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Str('LAI', Pt=LAI(), Len=5),
         Type4_TLV('ID', T=0x17, V=ID()),
         Type2('FollowOnProceed', T=0xA1),
         Type2('CTSperm', T=0xA2),
         Type4_TLV('PLMNList', T=0x4A, V=PLMNList()),
         Type4_TLV('ECNList', ReprName='Emergency Number List', T=0x34, \
                   V='\0\0\0')])
     self._post_init(with_options, **kwargs)
예제 #7
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Bit('CKSN', ReprName='Ciphering Key Sequence Number', \
             Pt=0, BitLen=4, Dict=CKSN_dict, Repr='hum'),
         Bit('LUType', ReprName='Location Update Type', \
             Pt=0, BitLen=4, Dict=LUType_dict, Repr='hum'),
         Str('LAI', Pt=LAI(), Len=5),
         Str('MSCm1', Pt=MSCm1(), Len=1),
         Type4_LV('ID', V=ID()),
         Type4_TLV('MSCm2', T=0x33, V=MSCm2())])
     self._post_init(with_options, **kwargs)
예제 #8
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('ID', ReprName='Allocated M-TMSI', V=ID(type='TMSI')),
         Str('RAI', ReprName='Routing area identification',
             Pt=6*'\0', Len=6),
         Bit('spare', Pt=0, BitLen=4, Repr='hex'),
         Bit('ForceStdby', ReprName='Force to standby', Pt=0, BitLen=4,
             Repr='hum', Dict=ForceStdby_dict),
         Type3_TV('PTMSISign', ReprName='P-TMSI signature', T=0x19,
                   V='\0\0\0', Len=3),
         ])
     self._post_init(with_options, **kwargs)
예제 #9
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Bit('UpdateResFOP', ReprName='Update follow-on proceed',
             Pt=0, BitLen=1, Repr='hum', Dict=AttachResFOP_dict),
         Bit('UpdateRes', ReprName='Update result', Pt=1, BitLen=3,
             Repr='hum', Dict=UpdateRes_dict),
         Bit('ForceStdby', ReprName='Force to standby', Pt=0, BitLen=4,
             Repr='hum', Dict=ForceStdby_dict),
         Int('GPRSTimer', ReprName='Periodic RA update timer', Pt=0,
             Type='uint8'),
         Str('RAI', ReprName='Routing area identification', Pt=6*'\0',
             Len=6),
         Type3_TV('PTMSISign', ReprName='Old P-TMSI signature', T=0x19,
                  V=3*'\0', Len=3),
         Type4_TLV('ID', ReprName='Allocated P-TMSI', T=0x18,
                   V=ID(type='TMSI')),
         Type4_TLV('ID_2', ReprName='MS identity', T=0x23, V=ID()),
         Type4_TLV('RxNPDU', ReprName='Receive N-PDU number list', T=0x26,
                   V='\0\0'),
         Type3_TV('GPRSTimer_2', ReprName='Negotiated READY timer', T=0x17,
                  V='\0', Len=1),
         Type3_TV('GMMCause', T=0x25, V='\x01', Len=1), # see GMMCause_dict
         Type4_TLV('T3302', T=0x2A, V='\0'),
         Type2('CellNotif', T=0x8C),
         Type4_TLV('PLMNList', T=0x4A, V=PLMNList()),
         Type4_TLV('PDPCtxStat', ReprName='PDP context status', T=0x32,
                   V='\0\0'),
         Type1_TV('NetFeatSupport', T=0xB, V=0),
         Type4_TLV('ECNumber', ReprName='Emergency number list', T=0x34,
                   V='\0\0\0'),
         Type4_TLV('MBMSCtxStat', ReprName='MBMS context status', T=0x35,
                   V=''),
         Type1_TV('MSInfo', ReprName='MS info requested', T=0xA, V=0),
         Type4_TLV('T3319', T=0x37, V='\0'),
         Type4_TLV('T3323', T=0x38, V='\0'),
         ])
     self._post_init(with_options, **kwargs)
예제 #10
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Bit('ServiceType', Pt=0, BitLen=4, Repr='hum',
             Dict=ServiceType_dict),
         Bit('CKSN', ReprName='GPRS ciphering key sequence number',
             Pt=0, BitLen=4, Dict=CKSN_dict),
         Type4_LV('ID', V=ID(type='TMSI')),
         Type4_TLV('PDPCtxStat', ReprName='PDP context status', T=0x32,
                   V='\0\0'),
         Type4_TLV('MBMSCtxStat', ReprName='MBMS context status', T=0x35,
                   V=''),
         Type4_TLV('ULDataStat', ReprName='Uplink data status', T=0x36,
                   V='\0\0'),
         ])
     self._post_init(with_options, **kwargs)
예제 #11
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     if self._initiator == 'Net':
         # Mobile terminated detach procedure
         self.extend([ \
         Bit('ForceStdby', ReprName='Force to standby', Pt=0, BitLen=4,
             Repr='hum', Dict=ForceStdby_dict),
         Bit('DetachType', Pt=1, BitLen=4, Repr='hum', \
             Dict=DetachTypeNet_dict),
         Type3_TV('GMMCause', T=0x25, V='\x01', Len=1), # see GMMCause_dict
         ])
     else:
         # Mobile originating detach procedure
         self.extend([ \
         Bit('spare', Pt=0, BitLen=4, Repr='hex'),
         Bit('DetachType', Pt=1, BitLen=4, Repr='hum',
             Dict=DetachTypeMS_dict),
         Type4_TLV('ID', T=0x18, V=ID(type='TMSI')),
         Type4_TLV('PTMSISign', ReprName='P-TMSI signature', T=0x19,
                   V='\0\0\0'),
         ])
     self._post_init(with_options, **kwargs)
예제 #12
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ Type4_LV('ID', V=ID()) ])
     self._post_init(with_options, **kwargs)
예제 #13
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Str('LAI', Pt=LAI(), Len=5),
         Type4_LV('ID', V=ID())])
     self._post_init(with_options, **kwargs)
예제 #14
0
def encode_IMSI(digit_str=''):
    # Length + IMSI ID as vector
    if not digit_str.isdigit():
        print('[-] we need a string of digits')
        return
    return [0x08] + stringToByte(str(ID(val=digit_str[:16], type='IMSI')))