python-rac 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyrac/__init__.py +4 -0
- pyrac/__main__.py +4 -0
- pyrac/cli.py +921 -0
- pyrac/client.py +2382 -0
- pyrac/desktop.py +5003 -0
- pyrac/legacy.py +8 -0
- pyrac/mcp_server.py +3845 -0
- pyrac/protocol/__init__.py +0 -0
- pyrac/protocol/v851.py +32 -0
- pyrac/protocol/v851_client.py +3453 -0
- pyrac/read_service.py +831 -0
- pyrac/v8311.py +1400 -0
- pyrac/web/__init__.py +0 -0
- pyrac/web/__main__.py +355 -0
- pyrac/web/app.py +2835 -0
- pyrac/web/workspace.py +1905 -0
- python_rac-0.2.0.dist-info/METADATA +843 -0
- python_rac-0.2.0.dist-info/RECORD +22 -0
- python_rac-0.2.0.dist-info/WHEEL +5 -0
- python_rac-0.2.0.dist-info/entry_points.txt +5 -0
- python_rac-0.2.0.dist-info/licenses/LICENSE +21 -0
- python_rac-0.2.0.dist-info/top_level.txt +1 -0
|
File without changes
|
pyrac/protocol/v851.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Observed 1C 8.5.1 protocol metadata, not a speculative write codec."""
|
|
2
|
+
SERVICE_NAME = b'v8.service.Admin.Cluster'
|
|
3
|
+
SERVICE_VERSION = b'16.0'
|
|
4
|
+
HELLO = bytes.fromhex('1c53575001000100')
|
|
5
|
+
CONNECT_ACK = bytes.fromhex('020180')
|
|
6
|
+
ENDPOINT_OPEN_ACK = bytes.fromhex('0c201876382e736572766963652e41646d696e2e436c75737465720431362e300180')
|
|
7
|
+
GET_CLUSTERS_REQUEST = bytes.fromhex('0e05010000010b')
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def decode_frame(data):
|
|
11
|
+
"""Return (packet type, payload), rejecting incomplete frames."""
|
|
12
|
+
if not data:
|
|
13
|
+
raise ValueError('Empty frame')
|
|
14
|
+
shift, pos, size = 0, 1, 0
|
|
15
|
+
for _ in range(4):
|
|
16
|
+
if pos >= len(data):
|
|
17
|
+
raise ValueError('Incomplete or oversized frame')
|
|
18
|
+
byte = data[pos]
|
|
19
|
+
pos += 1
|
|
20
|
+
size |= (byte & 127) << shift
|
|
21
|
+
if size > 4_000_000:
|
|
22
|
+
raise ValueError('Incomplete or oversized frame')
|
|
23
|
+
if byte < 128:
|
|
24
|
+
if shift and byte == 0:
|
|
25
|
+
raise ValueError('Incomplete or oversized frame')
|
|
26
|
+
break
|
|
27
|
+
shift += 7
|
|
28
|
+
else:
|
|
29
|
+
raise ValueError('Incomplete or oversized frame')
|
|
30
|
+
if len(data) != pos + size:
|
|
31
|
+
raise ValueError('Incomplete or oversized frame')
|
|
32
|
+
return data[0], data[pos:]
|