Esempio n. 1
0
 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))
Esempio n. 2
0
 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())
Esempio n. 3
0
 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())
Esempio n. 4
0
 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) )
Esempio n. 5
0
    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))
Esempio n. 6
0
    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
Esempio n. 7
0
 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
Esempio n. 8
0
 def __init__(self, msg_type=L1CTL_RESET_IND):
     Block.__init__(self, Name="L1CTL")
     self.append( l1ctl_hdr() )
     self[0].msg_type > msg_type
Esempio n. 9
0
 def __init__(self, C=1, I=0):
     Block.__init__(self, Name="EAP-AKA")
     self.append( EAPAKA_hdr(C=C, I=I) )
Esempio n. 10
0
 def __init__(self):
     Block.__init__(self, Name='BGP4')
     self.append(HEADER())
Esempio n. 11
0
 def __init__(self):
     Block.__init__(self, Name="BMP")
     hdr = FileHeader()
     self.append(hdr)
Esempio n. 12
0
 def __init__(self):
     Block.__init__(self, Name='MPEG4')
     self.append(atom())
Esempio n. 13
0
 def __init__(self, src=0, dst=0, verif=4 * "\x00"):
     Block.__init__(self, Name="SCTP")
     self.append(SCTP_hdr(src, dst, verif))
Esempio n. 14
0
 def __init__(self):
     Block.__init__(self, Name='IEEE 802.15.4')
     self.append(PHY())
Esempio n. 15
0
 def __init__(self, src=0, dst=0, verif=4 * '\x00'):
     Block.__init__(self, Name="SCTP")
     self.append(SCTP_hdr(src, dst, verif))
Esempio n. 16
0
 def __init__(self, prot='SUA', cla=0, typ=1):
     Block.__init__(self, Name='Sigtran')
     self.append( Hdr(prot, cla, typ) )
Esempio n. 17
0
 def __init__(self, C=1, I=0):
     Block.__init__(self, Name="EAP-SIM")
     self.append( EAPSIM_hdr(C=C, I=I) )
Esempio n. 18
0
 def __init__(self):
     Block.__init__(self, Name="TLS")
     self.append(RecordLayer())
Esempio n. 19
0
 def __init__(self):
     Block.__init__(self, Name="BMP")
     hdr = FileHeader()
     self.append(hdr)
Esempio n. 20
0
 def __init__(self):
     Block.__init__(self, Name="PNG")
     self.append(PNG_sig())
Esempio n. 21
0
 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) )
Esempio n. 22
0
 def __init__(self, ):
     Block.__init__(self, Name="JPEG")
     self << segment(type=Seg_dict['SOI'])
Esempio n. 23
0
 def __init__(self, ):
     Block.__init__(self, Name="JPEG")
     self << segment(type=Seg_dict['SOI'])
Esempio n. 24
0
 def __init__(self):
     Block.__init__(self, 'RANAP')
     self.append(PDU_HDR())
Esempio n. 25
0
 def __init__(self):
     Block.__init__(self, Name='MPEG4')
     self.append(atom())
Esempio n. 26
0
 def __init__(self, **kwargs):
     Block.__init__(self, 'S1AP')
     self.append(S1AP_HDR(**kwargs))
Esempio n. 27
0
 def __init__(self, prot="SUA", cla=0, typ=1):
     Block.__init__(self, Name="Sigtran")
     self.append(Hdr(prot, cla, typ))
Esempio n. 28
0
 def __init__(self):
     Block.__init__(self, Name="BGP4")
     self.append(HEADER())
Esempio n. 29
0
 def __init__(self, msg_type=L1CTL_RESET_IND):
     Block.__init__(self, Name="L1CTL")
     self.append(l1ctl_hdr())
     self[0].msg_type > msg_type
Esempio n. 30
0
 def __init__(self, **kwargs):
     Block.__init__(self, 'S1AP')
     self.append( S1AP_HDR(**kwargs) )