Esempio n. 1
0
class RP_DATA_NETToMS(Layer):
    '''
    Net -> MS
    '''
    constructorList = [
        Bit('spare', Pt=0, BitLen=5, Repr='hex'),
        Bit('Type', Pt=1, BitLen=3, Repr='hum', Dict=RPType_dict),
        Int('Ref', Type='uint8'), # reference to be used in ACKed
        RP_Originator_Address(), # length 1-12
        Type4_LV('DestAddrNull', V=''), # null address
        Type4_LV('Data', V=''), # length <= 233
        ]
    
    def map(self, s=''):
        Layer.map(self, s)
        self._map_tp()
                
    def _map_tp(self):
        data = self.Data.V()
        if not data:
            return
        mti = ord(data[0])&0b11
        if mti != 0:
            return
        tp = SMS_DELIVER()
        try:
            tp.map(data)
        except:
            return
        if str(tp) != data:
            return
        self.Data.L > tp
        self.Data.V > tp
        self.Data.V < None    
Esempio n. 2
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('BearerCap', V=BearerCap()),
         Type4_LV('Cause', V='\0\x80'),
         Type4_TLV('LowLayerComp', T=0x7C, V=''),
         Type4_TLV('HighLayerComp', T=0x7D, V='')])
     self._post_init(with_options, **kwargs)
Esempio n. 3
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('QoS', ReprName='Requested QoS', V=QoS()),
         Type4_LV('LinkedTI', V='\0'),
         Type4_TLV('TFT', ReprName='Traffic flow template', T=0x36, V='\0'),
         Type4_TLV('ProtConfig', ReprName='Protocol Config Options',
                   T=0x27, V='\x80')
         ])
     self._post_init(with_options, **kwargs)
Esempio n. 4
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)
Esempio n. 5
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)
Esempio n. 6
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Int('NSAPI', ReprName='Linked network access point id',
             Pt=128, Type='uint8'),
         Type4_LV('PDPAddr', ReprName='Offered multicast address', V='\0\x01'),
         Type4_LV('APN', ReprName='Access point name', V='\0'),
         Type4_TLV('MBMSProtConfig', ReprName='MBMS Protocol Config Options',
                   T=0x35, V='\0')
         ])
     self._post_init(with_options, **kwargs)
Esempio n. 7
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Int('NSAPI', ReprName='Requested network access point id',
             Pt=5, Type='uint8'),
         Int('LLC_SAPI', ReprName='Requested LLC service access point id',
             Pt=0, Type='uint8', Dict=LLCSAPI_dict),
         Type4_LV('QoS', ReprName='Requested QoS', V=QoS()),
         Type4_LV('LinkedTI', V='\0'),
         Type4_TLV('TFT', ReprName='Traffic flow template', T=0x36, V='\0'),
         Type4_TLV('ProtConfig', ReprName='Protocol Config Options',
                   T=0x27, V='\x80')
         ])
     self._post_init(with_options, **kwargs)
Esempio n. 8
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Int('MBMS_NSAPI', ReprName='Requested enhanced network access point id',
             Pt=128, Type='uint8'),
         Int('LLC_SAPI', ReprName='Requested LLC service access point id',
             Pt=0, Type='uint8', Dict=LLCSAPI_dict),
         Type4_LV('MBMSCap', ReprName='Supported MBMS bearer capbilities',
                  V='\0'),
         Type4_LV('PDPAddr', ReprName='Requested multicast address',
                  V='\0\x01'),
         Type4_LV('APN', ReprName='Access point name', V='\0'),
         Type4_TLV('MBMSProtConfig', ReprName='MBMS Protocol Config Options',
                   T=0x35, V='\0')
         ])
     self._post_init(with_options, **kwargs)
Esempio n. 9
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Int('NSAPI', ReprName='Requested Network Access Point ID',
             Pt=5, Type='uint8'),
         Int('LLC_SAPI', ReprName='Requested LLC Service Access Point ID',
             Pt=0, Type='uint8', Dict=LLCSAPI_dict),
         Type4_LV('QoS', ReprName='Requested QoS', V=QoS()),
         Type4_LV('PDPAddr', ReprName='Requested PDP Address', V='\0\x01'),
         Type4_TLV('APN', ReprName='Access Point Name', T=0x28, V='\0'),
         Type4_TLV('ProtConfig', ReprName='Protocol Config Options',
                   T=0x27, V='\x80'),
         Type1_TV('ReqType', ReprName='Request type', T=0xA, V=1,
                  Dict=RequestType_dict)
         ])
     self._post_init(with_options, **kwargs)
Esempio n. 10
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('Cause', V='\0\x80'),
         Str('CallState', Pt='\0', Len=1, Repr='hex'),
         Type4_TLV('AuxState', T=0x24, V=AuxState())])
     self._post_init(with_options, **kwargs)
Esempio n. 11
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([Type4_LV('Facility', V='')])
     if self._initiator != 'Net':
         # MS to network direction
         self.extend([Type4_TLV('SSversion', T=0x7F, V='')])
     self._post_init(with_options, **kwargs)
Esempio n. 12
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('BearerCap', V=BearerCap()),
         Type4_TLV('LowLayerComp', T=0x7C, V=''),
         Type4_TLV('HighLayerComp', T=0x7D, V=''),
         Type2('Reverse', T=0xA3),
         Type2('UpgradeInd', T=0xA4)])
     self._post_init(with_options, **kwargs)
Esempio n. 13
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('PDPAddr', ReprName='Offered PDP address', V='\0\x01'),
         Type4_TLV('APN', ReprName='Access point name', T=0x28, V='\0'),
         Type4_TLV('ProtConfig', ReprName='Protocol Config Options',
                   T=0x27, V='\x80')
         ])
     self._post_init(with_options, **kwargs)
Esempio n. 14
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('TMGI', ReprName='Temporary mobile group id', V='\0\0\0'),
         Int('LLC_SAPI', ReprName='Negociated LLC service access point id',
             Pt=0, Type='uint8', Dict=LLCSAPI_dict),
         Type4_TLV('MBMSProtConfig', ReprName='MBMS Protocol Config Options',
                   T=0x35, V='\0')
         ])
     self._post_init(with_options, **kwargs)
Esempio n. 15
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)
Esempio n. 16
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)
Esempio n. 17
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Int('LLC_SAPI', ReprName='Negociated LLC service access point id',
             Pt=0, Type='uint8', Dict=LLCSAPI_dict),
         Type4_LV('QoS', ReprName='Negociated QoS', V=QoS()),
         Bit('spare', Pt=0, BitLen=4),
         Bit('RadioPrio', ReprName='Radio priority', Pt=1, BitLen=4),
         Type4_TLV('PFlowID', ReprName='Packet flow id', T=0x34, V='\0'),
         Type4_TLV('ProtConfig', ReprName='Protocol Config Options',
                   T=0x27, V='\x80')
         ])
     self._post_init(with_options, **kwargs)
Esempio n. 18
0
class RP_DATA_MSToNET(Layer):
    '''
    MS -> Net
    '''
    constructorList = [
        Bit('spare', Pt=0, BitLen=5, Repr='hex'),
        Bit('Type', Pt=0, BitLen=3, Repr='hum', Dict=RPType_dict),
        Int('Ref', Type='uint8'), # reference to be used in ACKed
        Type4_LV('OrigAddrNull', V=''), # null address
        RP_Destination_Address(), # length 1-12
        Type4_LV('Data', V=''), # length <= 233
        ]
    
    def map(self, s=''):
        Layer.map(self, s)
        self._map_tp()
                
    def _map_tp(self):
        data = self.Data.V()
        if not data:
            return
        mti = ord(data[0])&0b11
        if mti not in (1, 2):
            return
        elif mti == 1:
            tp = SMS_SUBMIT()
        else:
            # mti == 2
            tp = SMS_COMMAND()
        try:
            tp.map(data)
        except:
            return
        if str(tp) != data:
            return
        self.Data.L > tp
        self.Data.V > tp
        self.Data.V < None
Esempio n. 19
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('MSNetCap', ReprName='MS network capability', V='\0\0'),
         Bit('CKSN', ReprName='GPRS ciphering key sequence number',
             Pt=0, BitLen=4, Dict=CKSN_dict),
         Bit('AttachTypeFOR', ReprName='Attach follow-on request pending',
             Pt=0, BitLen=1, Repr='hum', Dict=AttachTypeFOR_dict),
         Bit('AttachType', Pt=1, BitLen=3, Repr='hum', Dict=AttachType_dict),
         Str('DRXPara', ReprName='DRX parameter', Pt='\0\0', Len=2),
         Type4_LV('ID', V=ID()),
         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),
         Type1_TV('TMSIStat', ReprName='TMSI status', T=0x9, V=0,
                  Dict=TMSIStatus_dict),
         Type4_TLV('PSLCSCap', ReprName='PS location service capability',
                   T=0x33, V='\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('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('VoicePref', ReprName='Voice domain preference', T=0x5D,
                   V='\0')])
     self._post_init(with_options, **kwargs)
Esempio n. 20
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)
Esempio n. 21
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('Cause',V='\0\x80'),
         Type4_TLV('Facility', T=0x1C, V='')])
     if self._initiator == 'Net':
         # network to MS direction
         self.extend([ \
         Type4_TLV('ProgressInd', T=0x1E, V='\x80\x80'),
         Type4_TLV('UU', ReprName='User-User', T=0x7E, \
                   V='\0'),
         Type4_TLV('AA', ReprName='Allowed Actions (CCBS)', \
                   T=0x7B, V='\0')])
     else:
         # MS to network direction
         self.extend([Type4_TLV('SSversion', T=0x7F, V='')])
     self._post_init(with_options, **kwargs)
Esempio n. 22
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Str('Recall', Pt='\0', Len=1, Repr='hex'),
         Type4_LV('Facility', V='\0')])
     self._post_init(with_options, **kwargs)
Esempio n. 23
0
 def __init__(self, **kwargs):
     Layer3.__init__(self)
     self.append( Type4_LV('Data', V='') )
     self._post_init(**kwargs)
Esempio n. 24
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('ProgressInd', V='\x80\x80'),
         Type4_TLV('UU', ReprName='User-User', T=0x7E, V='\0')])
     self._post_init(with_options, **kwargs)
Esempio n. 25
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([Type4_LV('Facility', V='\0')])
     self._post_init(with_options, **kwargs)
Esempio n. 26
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('NotifInd', ReprName='SRVCC notification', V='\x01')
         ])
     self._post_init(with_options, **kwargs)
Esempio n. 27
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ Type4_LV('ID', V=ID()) ])
     self._post_init(with_options, **kwargs)
Esempio n. 28
0
 def __init__(self, with_options=True, **kwargs):
     Layer3.__init__(self)
     self.extend([ \
         Type4_LV('UU', ReprName='User-User', V='\0'),
         Type2('MoreData', T=0xA0)])
     self._post_init(with_options, **kwargs)
Esempio n. 29
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)