Commit graph

134 commits

Author SHA1 Message Date
XANTRONIX Development
cbae61db27 Use PATTY_AX25_CALLSIGN_LEN in patty_ax25_addr 2024-03-01 00:20:46 -05:00
XANTRONIX Development
905d5b117c Better handle read()s of multiple frames from TNC
Implement better handling of situations when read() captures multiple
TNC frames; ensure each frame is handled in src/server.c, function
handle_iface(), to ensure packets aren't ignored before the next
select() call
2024-03-01 00:20:46 -05:00
XANTRONIX Development
5be0f40405 Allow all printable 7-bit ASCII chars in addresses 2024-03-01 00:20:46 -05:00
XANTRONIX Development
a4518a839a Implement better modulo-128 I and S frame support
Changes:

    * Split patty_ax25_frame_decode() into the following:

      - patty_ax25_frame_decode_address()
      - patty_ax25_frame_decode_control()

      This allows for look up an established socket for a given address
      pair, to determine if an SABME session is in progress,
      necessitating modulo-128 control decoding

    * Decode I and S N(R), N(S) sequence numbers, poll/final
      bits properly in both modulo-8 and modulo-128 mode

    * Perform better frame control validation

    * Implement the following functions in src/sock.c:

      - patty_ax25_sock_send_rr()
      - patty_ax25_sock_send_rnr()
      - patty_ax25_sock_send_rej()
      - patty_ax25_sock_send_srej()

      Corresponding functions have been removed from src/server.c

    * Implement better functions in src/sock.c for encoding frame
      control, with send/receive sequences associated with the socket,
      with modulo-128 encoding for SABME sessions

Other changes:

    * Move or delete macros from include/patty/ax25/macros.h into
      include/patty/ax25.h and include/patty/ax25/frame.h

    * Move definitions from include/patty/ax25/proto.h to header file
      include/patty/ax25.h

    * Perform better bounds checking while decoding frames

    * Improve frame control printing in src/print.c; display frame
      type names, N(R), (NS) sequence numbers, and poll/final bits
2024-03-01 00:20:46 -05:00
XANTRONIX Development
b281925eba Significantly simplify dictionaries
Significantly simplify dictionaries so that dictionary keys are always
uint32_t; this number can be an arbitrary integer, be it a file
descriptor, for instance, or a hashed value
2024-03-01 00:20:46 -05:00
XANTRONIX Development
0bfd5795ad Do a slightly better job handling sock control fields 2024-03-01 00:20:46 -05:00
XANTRONIX Development
aa5fda4424 Simplify U frame test macros 2024-03-01 00:20:46 -05:00
XANTRONIX Development
4d397f76f1 Fix PATTY_AX25_CONTROL_UNNUMBERED_INFO() macro 2024-03-01 00:20:46 -05:00
XANTRONIX Development
84ae427037 Move raw frame capture to patty_ax25_if
Move raw frame interface capture to patty_ax25_if, patty_ax25_sock; this
resolves the issue wherein only bytes received, not sent, would be
captured by a raw socket bound to a specific interface with setsockopt()
2024-03-01 00:20:46 -05:00
XANTRONIX Development
8d24566e83 Implement generalized enumerate types; REJ reply 2024-03-01 00:20:46 -05:00
XANTRONIX Development
ab2c283542 Refactor socket(), openif() as setsockopt()
Other changes:

    * Fix blocking on disconnects when a raw socket is bound to an
      interface
2024-03-01 00:20:46 -05:00
XANTRONIX Development
cbea4ad7a8 Implement src/print.c
Implement src/print.c to provide facilities for pretty printing packets
to any FILE handle
2024-03-01 00:20:46 -05:00
XANTRONIX Development
73ae096b2d Implement openif(), raw packet interface access 2024-03-01 00:20:46 -05:00
XANTRONIX Development
65bfa95820 s/socket/fd/ for all such named members, variables 2024-03-01 00:20:46 -05:00
XANTRONIX Development
5a3660450f Get rid of patty_list_iterator (too expensive) 2024-03-01 00:20:46 -05:00
XANTRONIX Development
c6aac035e1 Add proto arg to patty_ax25_sock_new()
Other changes:

    * Remove proto arg from patty_ax25_sock_send() and
      patty_ax25_sock_write(); instead, use the proto member of
      patty_ax25_sock
2024-03-01 00:20:46 -05:00
XANTRONIX Development
ffcc171c48 Remove PATTY_AX25_SOCK_NONBLOCK option 2024-03-01 00:20:46 -05:00
XANTRONIX Development
2b1bc4c30e Well, I have WORKING FREAKING SESSIONS BAYBEE 2024-03-01 00:20:46 -05:00
XANTRONIX Development
22bf692a61 SO BLOODY CLOSE 2024-03-01 00:20:46 -05:00
XANTRONIX Development
7fd05f607a Huh, I managed to make something nice 2024-03-01 00:20:46 -05:00
XANTRONIX Development
d5ee0c7a9e No need to make a big fuss 2024-03-01 00:20:46 -05:00
XANTRONIX Development
4ff1f1a714 Nomenclature is important 2024-03-01 00:20:46 -05:00
XANTRONIX Development
b9c3568c43 This is a slog with no real end 2024-03-01 00:20:46 -05:00
XANTRONIX Development
89195bde69 Holy crap, getting deeper and deeper 2024-03-01 00:20:46 -05:00
XANTRONIX Development
b242cf9285 Hmmst, coalescing upon something 2024-03-01 00:20:46 -05:00
XANTRONIX Development
4478241319 I'm in a world of hurt 2024-03-01 00:20:46 -05:00
XANTRONIX Development
cec916a44a Fix SABM control field test macro 2024-03-01 00:20:46 -05:00
XANTRONIX Development
bdb73c8805 Making significant headway towards a working server 2024-03-01 00:20:46 -05:00
XANTRONIX Development
22366f2d0c Need some shit for managing routing tables 2024-03-01 00:20:46 -05:00
XANTRONIX Development
94b9a9d481 Start working on routing table 2024-03-01 00:20:46 -05:00
XANTRONIX Development
4aced9e9c1 ...I've been busy. 2024-03-01 00:20:46 -05:00
XANTRONIX Development
d265ce8756 More stuff 2024-03-01 00:20:46 -05:00
XANTRONIX Development
2491f85c62 Rearrange patty/ax25/sock.h for more logical layout 2024-03-01 00:20:46 -05:00
XANTRONIX Development
df466dc02b Slightly rethinking something 2024-03-01 00:20:46 -05:00
XANTRONIX Development
eb45bd192d Just need to make a damn client/server test already 2024-03-01 00:20:46 -05:00
XANTRONIX Development
c4fa41dab4 I am getting AWFULLY close to being able to run this code 2024-03-01 00:20:46 -05:00
XANTRONIX Development
5607dbede6 Split patty_ax25_sock into patty/ax25/sock.h 2024-03-01 00:20:46 -05:00
XANTRONIX Development
ac55d13057 Writing a network stack from scratch is extremely tiring 2024-03-01 00:20:46 -05:00
XANTRONIX Development
d25b799e4e Moving right along! 2024-03-01 00:20:46 -05:00
XANTRONIX Development
d2e278f715 Massive refactoring afoot 2024-03-01 00:20:46 -05:00
XANTRONIX Development
fa3f4a2e0e Start of massive refactor 2024-03-01 00:20:46 -05:00
XANTRONIX Development
0f37a37775 Better prototypes; better config 2024-03-01 00:20:46 -05:00
XANTRONIX Development
3927f1b343 Initial implementation of new headers 2024-03-01 00:20:46 -05:00
XANTRONIX Development
2162512896 Whitespace 2024-03-01 00:20:46 -05:00
XANTRONIX Development
f3d42c61f9 Implement stub patty_ax25_accept() 2024-03-01 00:20:46 -05:00
XANTRONIX Development
12972f452a Minor stuff 2024-03-01 00:20:46 -05:00
XANTRONIX Development
aa8cd2f350 Trifling in things that matter not 2024-03-01 00:20:46 -05:00
XANTRONIX Development
548c7149fb Rework socket calls to use patty_ax25_addr 2024-03-01 00:20:46 -05:00
XANTRONIX Development
c31061c7c2 Rename unnumbered information send/receive calls 2024-03-01 00:20:46 -05:00
XANTRONIX Development
f473050461 Implement PATTY_AX25_FRAME_SIZE() macro 2024-03-01 00:20:46 -05:00