Commit graph

12 commits

Author SHA1 Message Date
XANTRONIX Development
25da758257 Implement patty_strlcpy()
Implement patty_strlcpy() for portability and correctness, to provide
BSD strlcpy() functionality for glibc systems while ensuring a nul
terminated string is written to a destination, truncating the source
string by one byte if need be to make room for the nul terminator
2024-03-01 00:20:47 -05:00
XANTRONIX Development
021eca720d Search for patty.sock in ax25dump(8), tncd(8)
Changes:

    * Modify patty_client_new() to accept NULL as a Unix domain socket
      path; when NULL is provided, search for the pattyd(8) socket in
      pattyd.sock, followed by the default full socket path,
      /var/run/patty/patty.sock

    * Modify bin/ax25dump.c, bin/tncd.c to use default socket paths when
      calling patty_client_new() by defaulting to NULL when no -s flag
      is provided
2024-03-01 00:20:47 -05:00
XANTRONIX Development
00879d33c5 Fix strncpy() compilation warnings
Fix strncpy() compilation warnings wherein the target string length did
not account for a nul terminator
2024-03-01 00:20:47 -05:00
XANTRONIX Development
ab3679b788 Die when too many arguments are given to ax25dump 2024-03-01 00:20:47 -05:00
XANTRONIX Development
6942af9832 Slight tweaks to argument parsing 2024-03-01 00:20:47 -05:00
XANTRONIX Development
535e71c472 Use getopt_long() in bin/ax25dump.c
Use getopt_long() in bin/ax25dump.c to accept Unix domain socket and
interface name arguments for dumping packets from a connected pattyd(8)
process
2024-03-01 00:20:47 -05:00
XANTRONIX Development
a672b4e44a Use heap-allocated buffer in ax25dump(8) 2024-03-01 00:20:47 -05:00
XANTRONIX Development
cb33d799ff Implement patty_ax25_if_driver
Changes:

    * Implement patty_ax25_if_driver type, providing a vtable with
      pointers to methods implementing an AX.25 interface PHY

    * Implement patty_ax25_if_name() to return a pointer to the name
      string of an AX.25 interface

    * Decouple patty_kiss_tnc from src/if.c using patty_ax25_if_driver

    * Remove port input/output arguments from patty_kiss_tnc_send()
      and patty_kiss_tnc_recv(), respectively; use 0 as the default,
      but keep the port argument in patty_kiss_frame_send()

    * Implement patty_ax25_if_fd() to return file descriptor backing a
      PHY; use this rather than patty_kiss_tnc_fd() in src/server.c to
      further decouple interfaces from their implementation

    * Remove 'enum patty_ax25_if_type' type; refactor constructor
      patty_ax25_if_new() to no longer take this as an argument, but
      rather a patty_ax25_if_driver to use to instantiate the PHY
      with the information pointer passed

    * Break out patty_kiss_tnc code from src/kiss.c into src/tnc.c,
      leaving only patty_kiss_frame_send() in the original; this is
      needed to prevent a cyclic dependency within patty_ax25_sock and
      other areas

    * Rename patty_bin_if_config() to patty_bin_if_create(); a separate
      patty_bin_if_config() will likely be created later as necessary
      to change an existing interface

    * Split PHY-specific interface configuration code into separate
      delegates in bin/if.c

    * Implement usage of patty_error to better capture internal error
      states not currently representable with semantic error numbers
      while configuring and instantiating PHYs

    * Pass patty_error object to patty_bin_kiss_config() to receive
      detailed error information
2024-03-01 00:20:47 -05:00
XANTRONIX Development
0886730131 Add bin/ax25dump.8
Initial implementation of bin/ax25dump.8 man page

Other changes:

    * Make consistent mention of [tioarg ...], rather than tioflags
      or tioargs

    * Small bin/Makefile improvements to assist in installing man
      pages for different manual sections
2024-03-01 00:20:47 -05:00
XANTRONIX Development
cc530fcccc Use getopt_long() to reject flags w/usage output 2024-03-01 00:20:47 -05:00
XANTRONIX Development
188d43f98d Improve error reporting, CLI code reuse
Changes:

    * Move network interface configuration logic from bin/pattyd.c to
      bin/if.c; implement a more robust state machine

    * Move KISS TNC configuration code from bin/pattyd.c to bin/kiss.c

    * Ensure configuration file name, line number, and erroneous part
      of an expression are clearly indicated upon failure

Other changes:

    * Improve bin/Makefile to rebuild objects when accompanying header
      files change

    * Refer to HEADERS_SUBDIR, not HEADER_SUBDIR, in Makefiles
2024-03-01 00:20:47 -05:00
XANTRONIX Development
4c2f92af22 Move examples/ax25dump.c to bin/
Changes:

    * Move examples/ax25dump.c to bin/ax25dump.c; deprecate the other
      similar program, examples/decode.c

    * Implement support for reading KISS frames from a file, much in
      the manner of examples/decode.c
2024-03-01 00:20:47 -05:00
Renamed from examples/ax25dump.c (Browse further)