Changes:
* Combine patty_ax25_sock_ack_timer_restart() and _set() into one
method, patty_ax25_sock_ack_timer_start(), which accepts a new
struct timeval argument to potentially add the Timer T1 value to
* Reorder some functions in src/sock.c, include/patty/ax25/sock.h
Changes:
* Implement patty_ax25_sock_timeR_ack_restart() to initialize the
XID/SABM/SABME ack Timer T1
* Implement patty_ax25_sock_timer_ack_cancel() to clear Timer T1
* Implement patty_ax25_sock_timer_ack_sub() to subtract the value of
a struct timeval from Timer T1
* Implement patty_ax25_sock_timer_ack_expired() to indicate if the
ack Timer T1 has expired
Other changes:
* Rearrange patty_ax25_sock a bit
Changes:
* Use cfmakeraw() to set raw TTY attributes in KISS TNC constructor
patty_kiss_tnc_new_fd()
* Restore previous TTY attributes in patty_kiss_tnc_destroy()
Begin to reimplement patty_ax25_sock_reset() to follow the AX.25 v2.2
Specification, Section 6.5 "Resetting Procedure" indications to set V(S)
and V(R) to 0
Rename patty_ax25_sock_reset() to patty_ax25_sock_init(), so as to allow
for the implementation of a future _reset() method which shall be used
to implement AX.25 v2.2 Section 6.5 "Resetting Procedure"
Changes:
* Make patty_ax25_sock_send_rr() accept a P/F flag value
* Make patty_ax25_sock_send_rnr() accept a P/F flag value
* Make patty_ax25_sock_send_rej() accept a P/F flag value
After performing XID parameter negotiation, do not simply use the
negotiated TX buffer size when allocating the RX buffer; this resolves
an issue wherein read()s into the RX buffer (allocated with a size equal
to the TX buffer, which may be smaller) would cause memory errors
Changes:
* Allow REJ handling to occur when the V(S) send state counter wraps
to a value lower than indicated in the frame N(R) field
* Fix tx_slot() in src/sock.c to not buffer overflow when the TX
window is less than the maximum for the SABM/SABME mode
Changes:
* Add an enum patty_ax25_version argument to the function
patty_ax25_sock_upgrade() to allow upgrading a socket to a certain
set of AX.25 defaults
Changes:
* Implement and use respond_accept() and respond_connect()
convenience methods instead of stack allocating response objects,
populating them, and using write() to send them to the client
* When receiving XID frames in response to either an accept() or
connect() call, respond to the client if any of the parameters
sent from the peer are not compatible with a socket or interface,
with the appropriate errno value
Changes:
* Improve patty_ax25_sock_params_set() validation by setting ENOTSUP
when setting options on a socket that don't make sense, such as no
Asynchronous Balanced Mode
Changes:
* Make patty_ax25_sock_send() set ENETDOWN when no network interface
is associated with a sock
* Make patty_ax25_sock_send() set EBADF when no remote address is
associated with a sock
Keep distinct default Classes of Procedures parameter flag values for
sockets and interfaces, as the Asynchronous Balanced Mode parameter does
not apply to the interface itself, and the Half/Full Duplex parameters
do not apply to the sock
Changes:
* Make bind() validate that no other socket has the same
callsign/SSID bound to a listening socket, emitting EADDRINUSE if
one already exists
* Make bind() validate that no address is already bound to the
socket, emitting EINVAL otherwise
Changes:
* Add a "pending disconnect" state to enum patty_ax25_sock_state
(PATTY_AX25_SOCK_PENDING_DISCONNECT), used when an originating
system sends a DISC frame, pending a UA response
* When handling a UA frame, rather than terminating a socket in the
established state implicitly, check for a "pending disconnect"
state explicitly
Other changes:
* When a remote socket has already been obtained in handle_frame()
in src/server.c, pass that socket to any other method that would
otherwise be looking up the same socket
Changes:
* Don't use a separate dict for keeping track of sockets pending
accept and sockets pending connect; rely more on the semantic
meaning of the enum patty_ax25_sock_status values
* Ensure DISC frames are acknowledged by UA frames
* Ensure a receiving system only shuts down a connection after
receiving a UA frame in response to a sent DISC frame
* Ensure a sending system only shuts down a connection just prior to
sending a UA frame in response to a received DISC frame
* Don't use the P/F flag for the connection management U frames;
implicitly assume the P/F flag is set to 1, and always send frames
with a true P/F flag
Changes:
* Replace patty_ax25_sock member 'buf' with 'tx_buf' and 'rx_buf'
for transmitting or receiving single, non-sequential packets
* Make patty_ax25_sock_upgrade() reallocate all I/O buffers based on
window size and MTU/MRU, useful when entering SABME mode
Changes:
* Modify patty_ax25_sock_send_xid() to require the 'cr' argument,
which specifies whether the frame address field is to be encoded
with the 'command' or 'response' bits set as appropriate
Fix subtle sequence issues in src/sock.c wherein non-I frames which are
sent may overwrite a previously sent I frame with the same sequence
number, which would cause issues with the remote end expecting an I
frame and possibly getting a non-I frame
Changes:
* Add 'format' member to patty_ax25_frame
* Drop 'format' argument in patty_ax25_encode_reply_to()
* Drop 'format' argument in patty_ax25_encode()
* Consolidate private functions for encoding frame addresses to one
much simpler function to perform encoding; simplify encoding of
addresses in frames sent in reply to other frames
Implement the AX.25 v2.2 XID parameter exchange as a preamble for
initiating connections with peers, with the following workflow:
* Upon a connect() call, send an XID frame to the peer
* When a DM is received, assume the peer is unable to accept a
connection
* When a FRMR is received, assume the peer does not adhere to the
AX.25 v2.2 standard, and attempt to initiate a connection with a
SABM frame instead
* When an XID is received, adapt local parameters to meet the
needs of the peer, and respond with an SABM or an SABME frame,
depending on which mode is indicated
Use patty_ax25_sock_bind_if() in server_connect() to ensure any other
functions which must take place are attended to when assigning an
interface to a socket
Fix byte order of extended format control encoding and decoding in the
following src/frame.c functions:
* patty_ax25_frame_decode_control()
* patty_ax25_frame_encode_reply_to()
Changes:
* Modify examples/ax25dump.c and decode.c to not die upon failure to
decode a specific frame or field; instead, indicate the error,
print a hex dump of the frame, and move on to the next frame
Changes:
* Implement patty_ax25_sock_upgrade() to upgrade a socket from the
default AX.25 2.0 parameters to AX.25 2.2 parameters, meant to be
used upon receipt of an XID frame
* Implement patty_ax25_sock_params_set() to set lowest common
denominator parameters to a socket, downgrading or adapting to the
parameters advertised by a peer XID frame as necessary