P1sec / pycrate

A Python library to ease the development of encoders and decoders for various protocols and file formats; contains ASN.1 and CSN.1 compilers.
GNU Lesser General Public License v2.1
381 stars 132 forks source link

i want to add Cont ,NCPOpt ,ProtConfigElt in PCO in GTP-C Create Session Request massage #184

Closed sohel1119 closed 1 year ago

sohel1119 commented 2 years ago

I'm using Python version 3.8.10 and PyCrate version 0.5.3

this is my code.. from pycrate_mobile.TS29274_GTPC import * m = CreateSessionRequest()

m[1].add_ie(78,0) ''' I added Information Element Type 78 means Protocol Configuration Options (PCO)''' print(m[1].show()) ''' Then I printed it'''

'''### CreateSessionRequestIEs ###

PCO

GTPCIEHdr

<Type : 78 (Protocol Configuration Options (PCO))> <Len : 1> <spare : 0> <Inst : 0>

PCO

<Ext : 1> <spare : 0> <Prot : 0 (PPP with IP PDP)>

Config ###'''

After that I try to Set Remaining values But I'm able to set only one value. m[1][0][1][3].set_val([{'ID':13}]) print(m[1].show()) ''' Then I printed it '''

### CreateSessionRequestIEs ###
 ### PCO ###
  ### GTPCIEHdr ###
   <Type : 78 (Protocol Configuration Options (PCO))>
   <Len : 4>
   <spare : 0>
   <Inst : 0>
      ### PCO ###
       <Ext : 1>
       <spare : 0>
       <Prot : 0 (PPP with IP PDP)>
       ### Config ###
        ### ProtConfigElt ###
         <ID : 13 (DNS server IPv4 address request)>
         <Len : 0>
         <Cont : 0x>

I already have a pcap I want to create exact same. I try to add and set ProtConfigElt Cont ,NCPOpt in PCO same as shown in below pcap can you plz help me Screenshot from 2022-03-28 14-55-38 .

mitshell commented 2 years ago

Could you please, at least, do some efforts to make your issue readable ?