Commit graph

40 commits

Author SHA1 Message Date
XANTRONIX Development
b5ed9e9b61 Fix patty_kiss_tnc_recv() reads less than bufsz
Fix issues with patty_kiss_tnc_recv() when read() calls return less than
the allocated buffer size
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
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
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
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
b44a6789a8 Keep escape sequences as static variables 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
ff76e77336 Stub out patty_ax25_next_event() 2024-03-01 00:20:46 -05:00
XANTRONIX Development
86b099bd58 Hmm! Getting somewhere maybe 2015-07-20 23:21:45 -05:00
XANTRONIX Development
22874e6e06 Since we broke off, I'm using lipstick again 2015-07-17 00:45:14 +00:00
XANTRONIX Development
775c2c5283 s/errors/dropped/g 2015-07-15 21:59:56 -05:00
XANTRONIX Development
9af63066b6 Go to hell and back to get valid frames off the wire, and keep track of error counts 2015-07-15 21:59:08 -05:00
XANTRONIX Development
6a427c4097 Make tnc_buffer() only return bytes actually read 2015-07-15 21:45:46 -05:00
XANTRONIX Development
e7b1c2cf54 Riveting commentary 2015-07-15 21:19:34 -05:00
XANTRONIX Development
1cccfca835 KEEN REFACTORING YES VERY MUCH THANK YOU MA'AM 2015-07-15 21:16:39 -05:00
XANTRONIX Development
fde6e56d50 Separate buffering method <3 2015-07-15 20:32:24 -05:00
XANTRONIX Development
250d19c599 Eh, alignment 2015-07-15 20:29:50 -05:00
XANTRONIX Development
4c27c45615 Yes, really 2015-07-16 00:31:40 +00:00
XANTRONIX Development
9278eca7c3 IT'S ALIVE\! 2015-07-16 00:31:27 +00:00
XANTRONIX Development
1ef84ca2b4 Hi, yes, I'm aware none of this compiles nor makes sense at this time 2015-07-14 22:27:42 -05:00
XANTRONIX Development
7709abbc1c Damn Xan, you code like a BEAST O:) 2015-07-14 16:45:03 +00:00
XANTRONIX Development
4f4a898819 This SEEMS valid, but we'll compile later 2015-07-12 23:48:12 -05:00
XANTRONIX Development
facedcebb6 I think I just implemented patty_kiss_write(); tons o' system calls, but fuggit man! 2015-07-12 15:34:40 -05:00
XANTRONIX Development
b5ef56c4a0 That'll work, I suppose 2015-07-12 12:00:35 -05:00
XANTRONIX Development
17dd963f97 Man, this stuff is kinda hard when the standards are ill-specified 2015-07-12 02:28:31 -05:00
XANTRONIX Development
fac432cdb4 At least detect unexpected escape transposition characters 2015-07-12 02:18:08 -05:00
XANTRONIX Development
45df26382f Well, it's not exactly safe, but I bet it'll do for now 2015-07-12 02:16:26 -05:00