fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/24342 )

Change subject: contrib: Add sim-rest-{server,client}.py
......................................................................


Patch Set 2:

(7 comments)

https://gerrit.osmocom.org/c/pysim/+/24342/2/contrib/sim-rest-client.py
File contrib/sim-rest-client.py:

https://gerrit.osmocom.org/c/pysim/+/24342/2/contrib/sim-rest-client.py@39
PS2, Line 39:     x2, x3 = struct.unpack('>IH', x)
I guess you could do this without using struct at all:

  int.from_bytes(x, byteorder='big')


https://gerrit.osmocom.org/c/pysim/+/24342/2/contrib/sim-rest-client.py@46
PS2, Line 46:     return struct.pack('>IH', x2, x3)
Also here:

  x.to_bytes(48 // 8, byteorder='big')


https://gerrit.osmocom.org/c/pysim/+/24342/2/contrib/sim-rest-client.py@48
PS2, Line 48: dict
If all values in this dict() are bytes, then:

  Dict[str, bytes]


https://gerrit.osmocom.org/c/pysim/+/24342/2/contrib/sim-rest-client.py@61
PS2, Line 61: def milenage_auts(opc:bytes, k:bytes, rand:bytes, auts:bytes):
I would raise a RuntimeError directly from here, or alternatively:

  -> Optional[bytes]


https://gerrit.osmocom.org/c/pysim/+/24342/2/contrib/sim-rest-client.py@84
PS2, Line 84: js:dict = None
js:Optional[dict]


https://gerrit.osmocom.org/c/pysim/+/24342/2/contrib/sim-rest-client.py@87
PS2, Line 87:     if verbose:
What about log.debug()?


https://gerrit.osmocom.org/c/pysim/+/24342/2/contrib/sim-rest-client.py@99
PS2, Line 99:     global server_port, server_host, verbose
I would just pass 'args' to build_url(), but not critical.



--
To view, visit https://gerrit.osmocom.org/c/pysim/+/24342
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I738ca3109ab038d4f5595cc1dab6a49087df5886
Gerrit-Change-Number: 24342
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria <vyanits...@sysmocom.de>
Gerrit-Comment-Date: Sun, 23 May 2021 15:20:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Reply via email to