mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-30 02:21:03 +03:00
pylint: apdu_source/pyshark_gsmtap
pySim/apdu_source/pyshark_gsmtap.py:90:0: C0305: Trailing newlines (trailing-newlines) pySim/apdu_source/pyshark_gsmtap.py:68:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) pySim/apdu_source/pyshark_gsmtap.py:30:0: C0411: first party import "from pySim.apdu.ts_102_221 import ApduCommands as UiccApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order) pySim/apdu_source/pyshark_gsmtap.py:31:0: C0411: first party import "from pySim.apdu.ts_31_102 import ApduCommands as UsimApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order) pySim/apdu_source/pyshark_gsmtap.py:32:0: C0411: first party import "from pySim.apdu.global_platform import ApduCommands as GpApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order) pySim/apdu_source/pyshark_gsmtap.py:19:0: W0611: Unused import sys (unused-import) pySim/apdu_source/pyshark_gsmtap.py:21:0: W0611: Unused pprint imported from pprint as pp (unused-import) pySim/apdu_source/pyshark_gsmtap.py:25:0: W0611: Unused b2h imported from pySim.utils (unused-import) pySim/apdu_source/pyshark_gsmtap.py:26:0: W0611: Unused Tpdu imported from pySim.apdu (unused-import) Change-Id: I0f2bfed2f671e02fc48bcc2a03c785edc691584f
This commit is contained in:
@@ -16,20 +16,19 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import logging
|
import logging
|
||||||
from pprint import pprint as pp
|
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
import pyshark
|
import pyshark
|
||||||
|
|
||||||
from pySim.utils import h2b, b2h
|
from pySim.utils import h2b
|
||||||
from pySim.apdu import Tpdu
|
|
||||||
from pySim.gsmtap import GsmtapMessage
|
from pySim.gsmtap import GsmtapMessage
|
||||||
from . import ApduSource, PacketType, CardReset
|
|
||||||
|
|
||||||
from pySim.apdu.ts_102_221 import ApduCommands as UiccApduCommands
|
from pySim.apdu.ts_102_221 import ApduCommands as UiccApduCommands
|
||||||
from pySim.apdu.ts_31_102 import ApduCommands as UsimApduCommands
|
from pySim.apdu.ts_31_102 import ApduCommands as UsimApduCommands
|
||||||
from pySim.apdu.global_platform import ApduCommands as GpApduCommands
|
from pySim.apdu.global_platform import ApduCommands as GpApduCommands
|
||||||
|
|
||||||
|
from . import ApduSource, PacketType, CardReset
|
||||||
|
|
||||||
ApduCommands = UiccApduCommands + UsimApduCommands + GpApduCommands
|
ApduCommands = UiccApduCommands + UsimApduCommands + GpApduCommands
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -67,10 +66,10 @@ class _PysharkGsmtap(ApduSource):
|
|||||||
sub_type = gsmtap_msg['sub_type']
|
sub_type = gsmtap_msg['sub_type']
|
||||||
if sub_type == 'apdu':
|
if sub_type == 'apdu':
|
||||||
return ApduCommands.parse_cmd_bytes(gsmtap_msg['body'])
|
return ApduCommands.parse_cmd_bytes(gsmtap_msg['body'])
|
||||||
elif sub_type == 'atr':
|
if sub_type == 'atr':
|
||||||
# card has been reset
|
# card has been reset
|
||||||
return CardReset(gsmtap_msg['body'])
|
return CardReset(gsmtap_msg['body'])
|
||||||
elif sub_type in ['pps_req', 'pps_rsp']:
|
if sub_type in ['pps_req', 'pps_rsp']:
|
||||||
# simply ignore for now
|
# simply ignore for now
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
@@ -87,4 +86,3 @@ class PysharkGsmtapPcap(_PysharkGsmtap):
|
|||||||
"""
|
"""
|
||||||
pyshark_inst = pyshark.FileCapture(pcap_filename, display_filter='gsm_sim', use_json=True, keep_packets=False)
|
pyshark_inst = pyshark.FileCapture(pcap_filename, display_filter='gsm_sim', use_json=True, keep_packets=False)
|
||||||
super().__init__(pyshark_inst)
|
super().__init__(pyshark_inst)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user