a sUgfâ ã@sdddlmZddlmZddlmZddlmZddl m Z m Z m Z eeeZGdd„de ƒZ dS)é)Ú GsmtapSource)Ú ApduCommandsé)Ú ApduSourceÚ PacketTypeÚ CardResetcs8eZdZdZd eedœ‡fdd„ Zedœdd „Z‡Z S) ÚGsmtapApduSourceaNApduSource for handling GSMTAP-SIM messages received via UDP, such as those generated by simtrace2-sniff. Note that *if* you use IP loopback and localhost addresses (which is the default), you will need to start this source before starting simtrace2-sniff, as otherwise the latter will claim the GSMTAP UDP port. ú 127.0.0.1éy)Úbind_ipÚ bind_portcstƒ ¡t||ƒ|_dS)aCreate a UDP socket for receiving GSMTAP-SIM messages. Args: bind_ip: IP address to which the socket should be bound (default: 127.0.0.1) bind_port: UDP port number to which the socket should be bound (default: 4729) N)ÚsuperÚ__init__rÚgsmtap)Úselfr r ©Ú __class__©ú…/home/jenkins/workspace/gerrit-pysim-build/JOB_TYPE/test/a1/default/a3/default/a4/default/label/simtester/pySim/apdu_source/gsmtap.pyr$s zGsmtapApduSource.__init__)ÚreturncCsv|j ¡\}}|ddkr*td|dƒ‚|d}|dkrHt |d¡S|dkr\t|dƒS|dvrfn td |ƒ‚dS) NÚtypeÚsimzUnsupported GSMTAP type %sÚsub_typeÚapduÚbodyÚatr)Zpps_reqZpps_rspz"Unsupported GSMTAP-SIM sub-type %s)rÚ read_packetÚ ValueErrorrÚparse_cmd_bytesr)rZ gsmtap_msgZ_addrrrrrr-s  zGsmtapApduSource.read_packet)r r ) Ú__name__Ú __module__Ú __qualname__Ú__doc__ÚstrÚintrrrÚ __classcell__rrrrrs rN)Z pySim.gsmtaprÚpySim.apdu.ts_102_221rÚUiccApduCommandsÚpySim.apdu.ts_31_102ÚUsimApduCommandsÚpySim.apdu.global_platformÚGpApduCommandsÚrrrrrrrrÚs