Commit graph

13 commits

Author SHA1 Message Date
XANTRONIX Development
420b406411 Use fflush() for each frame in examples/ax25dump.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
1fbf09c9ba Refactor parameter decoding/display
Changes:

    * Implement patty_ax25_params struct to contain all parameters
      supported by patty, at the interface and socket level alike

    * Move parameter enumerate types into include/patty/ax25.h, from
      include/patty/ax25/frame.h; make corrections as necessary

    * Reimplement patty_ax25_frame_decode_xid() to parse known XID
      information parameters into a patty_ax25_params object

    * Implement patty_print_params() in src/print.c

    * Refactor patty_print_frame() as patty_print_frame_header(),
      without a call to patty_print_hexdump(); this allows
      patty_print_params() to be called prior to patty_print_hexdump(),
      for better readability

    * Use patty_print_params() in examples/ax25dump.c, decode.c

    * Refactor usage of patty_ax25_frame_decode_xid() in src/server.c to
      parse XID frames into a patty_ax25_params object
2024-03-01 00:20:46 -05:00
XANTRONIX Development
d4e7933e6b Make examples take callsign as local/remote address 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
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
XANTRONIX Development
9f13c67518 Provide shorter names for programs in examples/ 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
1abf0890d9 Show function errors in testclient-promisc.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
08389b8781 Show function names in errors in examples/decode.c 2024-03-01 00:20:46 -05:00
XANTRONIX Development
b9a6ef9ff3 Move test files to examples/; build libpatty 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
7eb8babd21 Initial commit of examples/patty.conf 2024-03-01 00:20:46 -05:00
XANTRONIX Development
bbf3db7466 Add examples/ax25config.txt 2024-03-01 00:20:45 -05:00