def __init__(self, SPIi=8 * '\x00', SPIr=8 * '\x00', type=34, flag='\x08', msgID=0): Block.__init__(self, Name="IKEv2") self.append(IKEv2_hdr(SPIi, SPIr, type, flag, msgID))
def __init__(self, arch='Elf32'): Block.__init__(self, Name='ELF') if arch != 'Elf32': print('pfff... no 64 bit yet') raise() else: self._arch=arch self.append(Elf32_Ehdr())
def __init__(self, arch='Elf32'): Block.__init__(self, Name='ELF') if arch != 'Elf32': print('pfff... no 64 bit yet') raise () else: self._arch = arch self.append(Elf32_Ehdr())
def __init__(self, mode='control', protocol='GA_RC', type=RCMsgType['GA-RC DISCOVERY REQUEST']): Block.__init__(self, Name='UMA') if mode == 'user': if protocol == 'GA_PSR': self.append( GA_PSR_UP_hdr(type=type) ) elif protocol == 'GA_RRC': self.append( GA_RRC_UP_hdr(type=type) ) elif mode == 'control': if protocol == 'GA_RC': self.append( GA_RC_hdr(type=type) ) elif protocol == 'GA_CSR': self.append( GA_CSR_hdr(type=type) ) elif protocol == 'GA_PSR': self.append( GA_PSR_hdr(type=type) ) elif protocol == 'GA_RRC': self.append( GA_RRC_hdr(type=type) )
def __init__(self, mode='control', protocol='GA_RC', type=RCMsgType['GA-RC DISCOVERY REQUEST']): Block.__init__(self, Name='UMA') if mode == 'user': if protocol == 'GA_PSR': self.append(GA_PSR_UP_hdr(type=type)) elif protocol == 'GA_RRC': self.append(GA_RRC_UP_hdr(type=type)) elif mode == 'control': if protocol == 'GA_RC': self.append(GA_RC_hdr(type=type)) elif protocol == 'GA_CSR': self.append(GA_CSR_hdr(type=type)) elif protocol == 'GA_PSR': self.append(GA_PSR_hdr(type=type)) elif protocol == 'GA_RRC': self.append(GA_RRC_hdr(type=type))
def parse(self, s='', mode='control'): # map GA header, after checking the protocol discriminator value pd = ord(s[2]) & 0x0F Block.__init__(self, Name='UMA') if pd in hdrCall.keys(): # now easy way to distinguish CP from UP at the UMA layer # (may depend if its carried over TCP or UDP?) self.append(hdrCall[pd]()) else: self.append(GA_RC_hdr()) self[0].map(s) s = s[len(self[0]):] # map iteratively the TLV Information Element while len(s) > 0: if self._IE_type == 'old': self < UMA_IE_old() else: self < UMA_IE() self[-1].map(s) s = s[len(self[-1]):] # check if can also handle V with L3Mobile_IE: if self[-1].T() == IEType['Location Area Identification']: self.map_last_to_IE(LAI) elif self[-1].T() == IEType['Mobile Identity']: self.map_last_to_IE(ID) elif self[-1].T() == IEType['Mobile Station Classmark 2']: self.map_last_to_IE(MSCm2) elif self[-1].T() == IEType['GAN PLMN List']: self.map_last_to_IE(PLMNList) elif self.process_L3 and self[-1].T() == IEType['L3 Message']: l3 = parse_L3(self[-1].V()) if isinstance(l3, Layer3): # otherwise, cill get a RawLayer() self[-1].V < None self[-1].V > l3
def parse(self, s='', mode='control'): # map GA header, after checking the protocol discriminator value pd = ord(s[2]) & 0x0F Block.__init__(self, Name='UMA') if pd in hdrCall.keys(): # now easy way to distinguish CP from UP at the UMA layer # (may depend if its carried over TCP or UDP?) self.append( hdrCall[pd]() ) else: self.append( GA_RC_hdr() ) self[0].map(s) s = s[ len(self[0]) : ] # map iteratively the TLV Information Element while len(s) > 0: if self._IE_type == 'old': self < UMA_IE_old() else: self < UMA_IE() self[-1].map(s) s = s[ len(self[-1]) : ] # check if can also handle V with L3Mobile_IE: if self[-1].T() == IEType['Location Area Identification']: self.map_last_to_IE(LAI) elif self[-1].T() == IEType['Mobile Identity']: self.map_last_to_IE(ID) elif self[-1].T() == IEType['Mobile Station Classmark 2']: self.map_last_to_IE(MSCm2) elif self[-1].T() == IEType['GAN PLMN List']: self.map_last_to_IE(PLMNList) elif self.process_L3 and self[-1].T() == IEType['L3 Message']: l3 = parse_L3(self[-1].V()) if isinstance(l3, Layer3): # otherwise, cill get a RawLayer() self[-1].V < None self[-1].V > l3
def __init__(self, msg_type=L1CTL_RESET_IND): Block.__init__(self, Name="L1CTL") self.append( l1ctl_hdr() ) self[0].msg_type > msg_type
def __init__(self, C=1, I=0): Block.__init__(self, Name="EAP-AKA") self.append( EAPAKA_hdr(C=C, I=I) )
def __init__(self): Block.__init__(self, Name='BGP4') self.append(HEADER())
def __init__(self): Block.__init__(self, Name="BMP") hdr = FileHeader() self.append(hdr)
def __init__(self): Block.__init__(self, Name='MPEG4') self.append(atom())
def __init__(self, src=0, dst=0, verif=4 * "\x00"): Block.__init__(self, Name="SCTP") self.append(SCTP_hdr(src, dst, verif))
def __init__(self): Block.__init__(self, Name='IEEE 802.15.4') self.append(PHY())
def __init__(self, src=0, dst=0, verif=4 * '\x00'): Block.__init__(self, Name="SCTP") self.append(SCTP_hdr(src, dst, verif))
def __init__(self, prot='SUA', cla=0, typ=1): Block.__init__(self, Name='Sigtran') self.append( Hdr(prot, cla, typ) )
def __init__(self, C=1, I=0): Block.__init__(self, Name="EAP-SIM") self.append( EAPSIM_hdr(C=C, I=I) )
def __init__(self): Block.__init__(self, Name="TLS") self.append(RecordLayer())
def __init__(self): Block.__init__(self, Name="PNG") self.append(PNG_sig())
def __init__(self, SPIi=8*'\x00', SPIr=8*'\x00', type=34, flag='\x08', msgID=0): Block.__init__(self, Name="IKEv2") self.append( IKEv2_hdr(SPIi, SPIr, type, flag, msgID) )
def __init__(self, ): Block.__init__(self, Name="JPEG") self << segment(type=Seg_dict['SOI'])
def __init__(self): Block.__init__(self, 'RANAP') self.append(PDU_HDR())
def __init__(self, **kwargs): Block.__init__(self, 'S1AP') self.append(S1AP_HDR(**kwargs))
def __init__(self, prot="SUA", cla=0, typ=1): Block.__init__(self, Name="Sigtran") self.append(Hdr(prot, cla, typ))
def __init__(self): Block.__init__(self, Name="BGP4") self.append(HEADER())
def __init__(self, msg_type=L1CTL_RESET_IND): Block.__init__(self, Name="L1CTL") self.append(l1ctl_hdr()) self[0].msg_type > msg_type
def __init__(self, **kwargs): Block.__init__(self, 'S1AP') self.append( S1AP_HDR(**kwargs) )