Commit graph

265 commits

Author SHA1 Message Date
XANTRONIX Development
c3667b08a1 Fix minor AX.25 version detection issue 2024-03-01 00:20:46 -05:00
XANTRONIX Development
307a668d6d That hurt 2024-03-01 00:20:46 -05:00
XANTRONIX Development
d266058ad4 Fix patty_kiss_tnc_recv() issues
Fix patty_kiss_tnc_recv() issues with small buffers (~330 bytes) by
more properly detecting EOF being the condition at which the current
decoder offset in the buffer is equal to the last buffer read size; the
offset can never be the number of bytes read, and the initial read
length is -1, so early EOF conditions are avoided
2024-03-01 00:20:46 -05:00
XANTRONIX Development
2e0adee54e Remove _unix suffix from patty_kiss_tnc_fd_unix() 2024-03-01 00:20:46 -05:00
XANTRONIX Development
750ab452d2 Refactor patty_kiss_tnc_recv()
Refactor patty_kiss_tnc_recv() to always read a fixed number of bytes
into a circular buffer

Other changes:

    * Avoid needing memmove() per packet processed

    * Allow processing packets larger than the internal read buffer
2024-03-01 00:20:46 -05:00
XANTRONIX Development
153dc17c7b Start to whittle down src/ax25.c, include/ax25.h 2024-03-01 00:20:46 -05:00
XANTRONIX Development
66e5de9d6c Make patty_kiss_tnc_open() use default buffer size
Make patty_kiss_tnc_open() use default buffer size

Other changes:

    * Make src/decode.c no longer require a filename to use as a TNC
2024-03-01 00:20:46 -05:00
XANTRONIX Development
2eacce6f09 Remove src/buffer.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
d44889121e Do not decode KISS frames into internal buffer
Changes:

    * Modify patty_kiss_tnc_recv() to accept a pointer to a read buffer,
      and a maximum length argument, to receive one packet

    * Modify src/decode.c to use the new patty_kiss_tnc_recv() calling
      form
2024-03-01 00:20:46 -05:00
XANTRONIX Development
e74941f714 Fix patty_kiss_tnc_send()
Fix patty_kiss_tnc_send() to ensure frames survive unmodified through
round trips of patty_kiss_tnc_send() and patty_kiss_tnc_recv() calls
2024-03-01 00:20:46 -05:00
XANTRONIX Development
54a521e8a8 Use only one write(2) call per frame start
Use only one write(2) call per frame start in src/kiss.c
2024-03-01 00:20:46 -05:00
XANTRONIX Development
d7ab08338c Implement patty_kiss_tnc_open_fd()
Implement patty_kiss_tnc_open_fd() to create a TNC object for an
existing Unix file descriptor
2024-03-01 00:20:46 -05:00
XANTRONIX Development
ede262397b Refactor patty_kiss_tnc_recv()
Refactor patty_kiss_tnc_recv() to be much more compact and correct;
ensure the KISS command byte is absolutely required, and that
consecutive frame end markers are handled without error
2024-03-01 00:20:46 -05:00
XANTRONIX Development
06fe62ed7b Go through more effort to show packet types 2024-03-01 00:20:46 -05:00
XANTRONIX Development
361059c549 Use PATTY_KISS_BUFSZ macro in src/decode.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
663965db71 Getting there 2024-03-01 00:20:46 -05:00
XANTRONIX Development
9217b0366f Sprucing things up a bit 2024-03-01 00:20:46 -05:00
XANTRONIX Development
f1e7fc356f Use enum kiss_flags type, not int 2024-03-01 00:20:46 -05:00
XANTRONIX Development
df23b0b8e3 Remove irrelevant comment 2024-03-01 00:20:46 -05:00
XANTRONIX Development
de0c0ef844 Use uint8_t instead of unsigned char in src/kiss.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
4d9c45ad94 Minor changes 2024-03-01 00:20:46 -05:00
XANTRONIX Development
67afb68917 Ensure header changes trigger rebuilds 2024-03-01 00:20:46 -05:00
XANTRONIX Development
968c0bfd8c Implement patty_ax25_frame_payload() 2024-03-01 00:20:46 -05:00
XANTRONIX Development
e8e1c163a4 Remove naming redundancy in src/frame.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
241f647b03 Initial commit of src/ptmx.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
5754c383a6 Fix dict traversal 2024-03-01 00:20:46 -05:00
XANTRONIX Development
dc55a7fc6c Prettification, set errno on errors 2024-03-01 00:20:46 -05:00
XANTRONIX Development
3074af45c1 Print decoded frames to stdout, not stderr 2024-03-01 00:20:46 -05:00
XANTRONIX Development
a423467037 Slight refactor of src/decode.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
627bc70e0f Show printable frame bytes in src/decode.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
fba41f93df Remove all usages of patty_ax25_frame_format 2024-03-01 00:20:46 -05:00
XANTRONIX Development
478d22936b Perform hex dump of packet contents in src/decode.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
cc57d49c0e Print repeaters more sensibly in src/decode.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
b44a6789a8 Keep escape sequences as static variables 2024-03-01 00:20:46 -05:00
XANTRONIX Development
83f07d9465 Buffer reduction poop 2024-03-01 00:20:46 -05:00
XANTRONIX Development
bd67f73a1a It's nice to be able to better inspect the contents of le buffers 2024-03-01 00:20:46 -05:00
XANTRONIX Development
82d94fb5ad Implement src/buffer.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
1666666e9d This is all very necessary if I am to wrest tight control over frame decoding into my own hands 2024-03-01 00:20:46 -05:00
XANTRONIX Development
63f031b461 It occurs to me I'll need patty_kiss_tnc_decode() to be exported 2024-03-01 00:20:46 -05:00
XANTRONIX Development
2c0974658a I'm running out of shitty commit messages 2024-03-01 00:20:46 -05:00
XANTRONIX Development
893d76eef8 That works better 2024-03-01 00:20:46 -05:00
XANTRONIX Development
af485f68c2 I am not terrible 2024-03-01 00:20:46 -05:00
XANTRONIX Development
4973957530 Why not, man 2024-03-01 00:20:46 -05:00
XANTRONIX Development
f03d99c2a7 Fix up example programs somewhat 2024-03-01 00:20:46 -05:00
XANTRONIX Development
4e5634cbc7 My final commit 2024-03-01 00:20:46 -05:00
XANTRONIX Development
a2b21eb848 Prevent redundant test of I/O event readiness for any given file descriptor in patty_ax25_next_event() 2024-03-01 00:20:46 -05:00
XANTRONIX Development
53791bf21d Ahh, that's better 2024-03-01 00:20:46 -05:00
XANTRONIX Development
35f42464c3 I am a derpetologist 2024-03-01 00:20:46 -05:00
XANTRONIX Development
a744fa640c Implement patty_ax25_next_event() like I'm not a dumbass or some shit 2024-03-01 00:20:46 -05:00
XANTRONIX Development
5fb55973ad Manage the bits that'll go into select(2) or whatevs 2024-03-01 00:20:46 -05:00