Skip to content

Instantly share code, notes, and snippets.

@sjlongland
Created October 19, 2023 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjlongland/a84ed4be8b833f1c992bd42f51afc129 to your computer and use it in GitHub Desktop.
Save sjlongland/a84ed4be8b833f1c992bd42f51afc129 to your computer and use it in GitHub Desktop.
AX.25 connected-mode traffic between two Linux hosts
2023-10-19 10:29:38,098 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX25SetAsyncBalancedModeFrame]
header.destination = VK4MSL-4*
header.source = VK4MSL-5
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 63 (0x3f)
body.pf = True (0x1)
body.modifier = 47 (0x2f)
2023-10-19 10:29:38,098 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX25UnnumberedAcknowledgeFrame]
header.destination = VK4MSL-5
header.source = VK4MSL-4*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 115 (0x73)
body.pf = True (0x1)
body.modifier = 99 (0x63)
2023-10-19 10:29:38,099 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 0 (0x0)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 0 (0x0)
body.ns = 0 (0x0)
body.payload = b'nobody@ax25test1:/$ '
2023-10-19 10:29:38,099 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 33 (0x21)
body.pf = False (0x0)
body.nr = 1 (0x1)
body.code = 0 (0x0)
2023-10-19 10:29:38,099 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-4*
header.source = VK4MSL-5
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 32 (0x20)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 0 (0x0)
body.payload = b'date\r'
2023-10-19 10:29:38,099 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 34 (0x22)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 1 (0x1)
body.payload = b'date\r\n'
2023-10-19 10:29:38,100 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 52 (0x34)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 2 (0x2)
body.payload = b'Thu'
2023-10-19 10:29:38,100 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 113 (0x71)
body.pf = True (0x1)
body.nr = 3 (0x3)
body.code = 0 (0x0)
2023-10-19 10:29:38,100 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 38 (0x26)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 3 (0x3)
body.payload = b' '
2023-10-19 10:29:38,100 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 56 (0x38)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 4 (0x4)
body.payload = b'Oct'
2023-10-19 10:29:38,101 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 177 (0xb1)
body.pf = True (0x1)
body.nr = 5 (0x5)
body.code = 0 (0x0)
2023-10-19 10:29:38,101 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 42 (0x2a)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 5 (0x5)
body.payload = b' '
2023-10-19 10:29:38,101 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 60 (0x3c)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 6 (0x6)
body.payload = b'19'
2023-10-19 10:29:38,101 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 241 (0xf1)
body.pf = True (0x1)
body.nr = 7 (0x7)
body.code = 0 (0x0)
2023-10-19 10:29:38,101 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 46 (0x2e)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 7 (0x7)
body.payload = b' '
2023-10-19 10:29:38,102 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 48 (0x30)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 0 (0x0)
body.payload = b'0'
2023-10-19 10:29:38,102 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 49 (0x31)
body.pf = True (0x1)
body.nr = 1 (0x1)
body.code = 0 (0x0)
2023-10-19 10:29:38,102 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 34 (0x22)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 1 (0x1)
body.payload = b'9'
2023-10-19 10:29:38,102 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 52 (0x34)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 2 (0x2)
body.payload = b':'
2023-10-19 10:29:38,103 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 113 (0x71)
body.pf = True (0x1)
body.nr = 3 (0x3)
body.code = 0 (0x0)
2023-10-19 10:29:38,103 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 38 (0x26)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 3 (0x3)
body.payload = b'42'
2023-10-19 10:29:38,103 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 56 (0x38)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 4 (0x4)
body.payload = b':'
2023-10-19 10:29:38,103 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 177 (0xb1)
body.pf = True (0x1)
body.nr = 5 (0x5)
body.code = 0 (0x0)
2023-10-19 10:29:38,103 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 42 (0x2a)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 5 (0x5)
body.payload = b'26'
2023-10-19 10:29:38,104 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 60 (0x3c)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 6 (0x6)
body.payload = b' '
2023-10-19 10:29:38,104 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 241 (0xf1)
body.pf = True (0x1)
body.nr = 7 (0x7)
body.code = 0 (0x0)
2023-10-19 10:29:38,104 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 46 (0x2e)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 7 (0x7)
body.payload = b'AEST'
2023-10-19 10:29:38,104 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 48 (0x30)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 0 (0x0)
body.payload = b' '
2023-10-19 10:29:38,104 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 49 (0x31)
body.pf = True (0x1)
body.nr = 1 (0x1)
body.code = 0 (0x0)
2023-10-19 10:29:38,105 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 34 (0x22)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 1 (0x1)
body.payload = b'2023'
2023-10-19 10:29:38,105 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 52 (0x34)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 2 (0x2)
body.payload = b'\r\n'
2023-10-19 10:29:38,105 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 113 (0x71)
body.pf = True (0x1)
body.nr = 3 (0x3)
body.code = 0 (0x0)
2023-10-19 10:29:38,105 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 38 (0x26)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 1 (0x1)
body.ns = 3 (0x3)
body.payload = b'nobody@ax25test1:/$ '
2023-10-19 10:29:38,105 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 129 (0x81)
body.pf = False (0x0)
body.nr = 4 (0x4)
body.code = 0 (0x0)
2023-10-19 10:29:38,105 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-4*
header.source = VK4MSL-5
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 130 (0x82)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 4 (0x4)
body.ns = 1 (0x1)
body.payload = b'uname -a\r'
2023-10-19 10:29:38,106 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 72 (0x48)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 4 (0x4)
body.payload = b'uname -a\r\n'
2023-10-19 10:29:38,106 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 90 (0x5a)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 5 (0x5)
body.payload = b'Linux'
2023-10-19 10:29:38,106 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 209 (0xd1)
body.pf = True (0x1)
body.nr = 6 (0x6)
body.code = 0 (0x0)
2023-10-19 10:29:38,106 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 76 (0x4c)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 6 (0x6)
body.payload = b' '
2023-10-19 10:29:38,106 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 94 (0x5e)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 7 (0x7)
body.payload = b'ax25test1'
2023-10-19 10:29:38,107 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 17 (0x11)
body.pf = True (0x1)
body.nr = 0 (0x0)
body.code = 0 (0x0)
2023-10-19 10:29:38,107 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 64 (0x40)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 0 (0x0)
body.payload = b' '
2023-10-19 10:29:38,107 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 82 (0x52)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 1 (0x1)
body.payload = b'6.1.0-13-amd64'
2023-10-19 10:29:38,107 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 81 (0x51)
body.pf = True (0x1)
body.nr = 2 (0x2)
body.code = 0 (0x0)
2023-10-19 10:29:38,107 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 68 (0x44)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 2 (0x2)
body.payload = b' '
2023-10-19 10:29:38,108 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 86 (0x56)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 3 (0x3)
body.payload = b'#1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29)'
2023-10-19 10:29:38,108 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 145 (0x91)
body.pf = True (0x1)
body.nr = 4 (0x4)
body.code = 0 (0x0)
2023-10-19 10:29:38,108 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 72 (0x48)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 4 (0x4)
body.payload = b' '
2023-10-19 10:29:38,108 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 90 (0x5a)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 5 (0x5)
body.payload = b'x86_64'
2023-10-19 10:29:38,108 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 209 (0xd1)
body.pf = True (0x1)
body.nr = 6 (0x6)
body.code = 0 (0x0)
2023-10-19 10:29:38,109 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 76 (0x4c)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 6 (0x6)
body.payload = b' '
2023-10-19 10:29:38,109 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 94 (0x5e)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 7 (0x7)
body.payload = b'GNU/Linux'
2023-10-19 10:29:38,109 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 17 (0x11)
body.pf = True (0x1)
body.nr = 0 (0x0)
body.code = 0 (0x0)
2023-10-19 10:29:38,109 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 64 (0x40)
body.pf = False (0x0)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 0 (0x0)
body.payload = b'\r\n'
2023-10-19 10:29:38,109 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitInformationFrame]
header.destination = VK4MSL-5*
header.source = VK4MSL-4
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 82 (0x52)
body.pf = True (0x1)
body.pid = 240 (0xf0)
body.nr = 2 (0x2)
body.ns = 1 (0x1)
body.payload = b'nobody@ax25test1:/$ '
2023-10-19 10:29:38,109 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX258BitReceiveReadyFrame]
header.destination = VK4MSL-4
header.source = VK4MSL-5*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 81 (0x51)
body.pf = True (0x1)
body.nr = 2 (0x2)
body.code = 0 (0x0)
2023-10-19 10:29:38,110 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX25DisconnectFrame]
header.destination = VK4MSL-4*
header.source = VK4MSL-5
header.repeaters =
header.cr = True
header.src_cr = False
body.control = 83 (0x53)
body.pf = True (0x1)
body.modifier = 67 (0x43)
2023-10-19 10:29:38,110 socatscraper.port14[socat-scrape.py: 50] INFO Decoded frame:
[AX25UnnumberedAcknowledgeFrame]
header.destination = VK4MSL-5
header.source = VK4MSL-4*
header.repeaters =
header.cr = False
header.src_cr = True
body.control = 115 (0x73)
body.pf = True (0x1)
body.modifier = 99 (0x63)
#!/usr/bin/env python3
import argparse
import logging
from asyncio import run
from binascii import a2b_hex
from aioax25.kiss import BaseKISSDevice
from aioax25.frame import AX25Frame
class DummyKISSDevice(BaseKISSDevice):
def receive(self, data):
self._receive(data)
def _open(self):
self._init_kiss()
def _send_raw_data(self, data):
pass
def parse_frame(log, frame):
try:
log.debug("Received frame: %s", frame.hex())
decoded = AX25Frame.decode(frame, modulo128=False)
detail = ""
for prop in ("destination", "source", "repeaters", "cr", "src_cr"):
try:
detail += " header.%-12s = %s\n" % (
prop, getattr(decoded.header, prop)
)
except AttributeError:
pass
for prop in ("control", "pf", "modifier", "pid", "nr", "ns",
"payload", "code", "w", "x", "y", "z", "vs", "vr",
"frmr_cr", "frmr_control"):
try:
value = getattr(decoded, prop)
if isinstance(value, int):
value = "%s (0x%x)" % (value, value)
detail += " body.%-12s = %s\n" % (prop, value)
except AttributeError:
pass
log.info("Decoded frame:\n[%s]\n%s", decoded.__class__.__name__, detail)
except:
log.exception("Failed to decode frame: %s", frame.hex())
async def asyncmain():
ap = argparse.ArgumentParser()
ap.add_argument("--level", default="INFO")
ap.add_argument("inputs", nargs="+")
args = ap.parse_args()
logging.basicConfig(
level=args.level.upper(),
format='%(asctime)s %(name)s[%(filename)s:%(lineno)4d] %(levelname)s %(message)s'
)
log = logging.getLogger("socatscraper")
kissdev = DummyKISSDevice(kiss_commands=[], reset_on_close=False,
log=log.getChild("kiss"))
for p in range(15):
kissdev[p].received.connect(
lambda frame, **k : parse_frame(
log=log.getChild("port%d" % p),
frame=frame
)
)
for src in args.inputs:
flog = log.getChild(src)
with open(src, "r") as f:
for line in f:
if line.startswith(" "):
try:
frame = a2b_hex(line.replace(" ","").strip())
kissdev.receive(frame)
except:
flog.exception("Failed to parse %r", line)
run(asyncmain())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment