Rename patty_ax25_if_ready() to if_pending() in src/if.c, as well as in
each driver implementing this method and any direct invocations of said
driver methods
Re-establish broken APRS-IS connections in src/aprs_is.c; when read() or
write() sets errno to EIO, attempt at most 3 times to re-establish the
APRS-IS connection per read()/write() failure; if the maximum number of
attempts is met, the I/O operation is considered a total failure
Changes:
* Remove interface name argument from patty_ax25_if_new()
* Add interface name argument to patty_ax25_server_if_add()
* Add interface name argument to patty_daemon_if_add()
* In src/server.c, implement 'struct if_entry' to hold the interface
name, file descriptor, and pointer to a patty_ax25_if object, to
recouple names to their respective interfaces
* Add a return argument to patty_bin_if_create() to store a pointer
to a new interface name created from a declaration
Attempt to set raw attributes on new socket PTYs to fix an issue on
Linux wherein any data written to a socket before the PTY subordinate
has been opened would be looped back in canonical mode, causing
frame errors; if tcsetattr() fails (usually on a non-Linux platform),
set errno to 0
Fix invalid return in patty_ax25_aprs_is_send() wherein the number of
bytes written to APRS-IS was returned, rather than the number of AX.25
packet bytes; the number of bytes read is the more important value as it
is used later for repeating the frame to promiscuous mode SOCK_RAW
sockets
Changes:
* Ensure TNC PTYs are closed on error
* Instead of waiting indefinitely, use patty_client_ping() to poll
the status of the patty daemon to exit in a timely manner
Refactor handle_sock_raw() in src/server.c to remove usage of
patty_kiss_tnc_recv() in favor of its component methods:
* patty_kiss_tnc_fill()
* patty_kiss_tnc_drain()
* patty_kiss_tnc_ready()
* patty_kiss_tnc_flush()
Fix issue handling SOCK_RAW frames wherein patty_ax25_sock_send() is
used instead of patty_ax25_if_send() to send frames through the
interface bound to the socket
Implement patty_ax25_aprs_is_send() to be able to encode any outbound UI
frames in TNC2 format, and to send them to a remote APRS-IS server
Other changes:
* Remove unimplemented patty_ax25_aprs_is_printf() declaration
* Remove unimplemented patty_ax25_aprs_is_readline() declaration
Implement an APRS-IS interface type which is capable of receiving all
APRS-IS traffic which can be represented in AX.25 frames; currently,
there are no provisions for handling extended features such as
non-numeric SSIDs, nor a client nor server which facilitate direct
APRS-IS communication. Presently, APRS-IS traffic cannot be sent from
this interface.
Changes:
* Add patty_ax25_aprs_is driver type in src/aprs_is.c
* Implement 'aprs-is' interface configuration type in bin/if.c; make
separate, smaller state machines for handling base interface
config, KISS, and APRS-IS interface config
Split patty_ax25_if_recv() into the following parts:
* patty_ax25_if_fill(), to fill the internal PHY buffer
* patty_ax25_if_drain(), to drain the internal PHY buffer and decode
any data present in the buffer
* patty_ax25_if_ready(), to test if a complete frame has been
decoded
* patty_ax25_if_flush(), to return the final number of bytes decoded
in the PHY buffer and reset the decoding state
Other changes:
* Implement a finite state machine for decoding KISS traffic in
src/tnc.c, patty_ax25_kiss_drain()
* Refactor src/server.c, handle_iface() to use the aforementioned
frame receive/decode methods