Initial draft.

This commit is contained in:
brent saner
2024-07-09 18:30:10 -04:00
parent c329fc916e
commit 9a90a55aa8
7 changed files with 204 additions and 202 deletions

View File

@@ -6,8 +6,10 @@
################################################################################################################################
import binascii
import os
import pathlib
import re
import sys
import zlib
prefixes = ('request', 'response')
@@ -17,6 +19,8 @@ linecharlimit = 80
linestrp = re.compile(r'^\s*(?P<hex>[A-Fa-f0-9N]+)?(?:\s*//.*)?$')
thisdir = pathlib.Path(__file__).absolute().parent
is_tty = os.isatty(sys.stdout.fileno())
def parse(text):
ret = []
@@ -57,6 +61,7 @@ for p in prefixes:
repr_split = []
for i in range(0, len(repr), 16):
repr_split.append(repr[i:i + 16])
print(fnamebase)
for i in repr_split:
print(', '.join(i), end = ',\n')
if is_tty:
print(fnamebase)
for i in repr_split:
print(', '.join(i), end = ',\n')

View File

@@ -1,4 +1,4 @@
061bd0ba719f010000000102000000020000019800000002000000c4000000010000001e00000038
061bae88bed2010000000102000000020000019800000002000000c4000000010000001e00000038
00000006000000106461746141313c61726269747261727920646174613e00000002000000300000
0008000000086669656c6441314176616c756541314100000008000000086669656c644131427661
6c7565413142000000010000001e0000003800000006000000106461746141323c61726269747261

View File

@@ -1,7 +1,7 @@
// RESPONSE (Complex)
06 // HDR:RESPSTART (Status: OK)
1b // HDR:CKSUM
d0ba719f // Checksum Value (3501879711)
ae88bed2 // Checksum Value (2928197330)
01 // HDR:MSGSTART
00000001 // Protocol Version (1)
02 // HDR:BODYSTART

View File

@@ -1,3 +1,3 @@
061b5fde82e501000000010200000001000000610000000100000059000000010000001d00000030
061bcefd072001000000010200000001000000610000000100000059000000010000001d00000030
000000050000001064617461313c61726269747261727920646174613e0000000200000028000000
06000000066669656c643176616c75653100000006000000066669656c643276616c7565320304

View File

@@ -1,7 +1,7 @@
// RESPONSE (Simple)
06 // HDR:RESPSTART (Status: OK)
1b // HDR:CKSUM
5fde82e5 // Checksum Value (1608418021)
cefd0720 // Checksum Value (3472688928)
01 // HDR:MSGSTART
00000001 // Protocol Version (1)
02 // HDR:BODYSTART