Commit graph

10 commits

Author SHA1 Message Date
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
ebbfb50b1c Use KISS framing for raw sockets
Use KISS framing for raw sockets to avoid multiple write() calls from
being buffered, which caused read() on the other end of a file
descriptor to read more than frame at once
2024-03-01 00:20:46 -05:00
9f13c67518 Provide shorter names for programs in examples/ 2024-03-01 00:20:46 -05:00
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
1abf0890d9 Show function errors in testclient-promisc.c 2024-03-01 00:20:46 -05:00
08389b8781 Show function names in errors in examples/decode.c 2024-03-01 00:20:46 -05:00
b9a6ef9ff3 Move test files to examples/; build libpatty 2024-03-01 00:20:46 -05:00
0f37a37775 Better prototypes; better config 2024-03-01 00:20:46 -05:00
7eb8babd21 Initial commit of examples/patty.conf 2024-03-01 00:20:46 -05:00
bbf3db7466 Add examples/ax25config.txt 2024-03-01 00:20:45 -05:00