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
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
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
Implement ring buffer for frames sent in a SABM or SABME session,
facilitating the ability to retransmit select frames upon request,
retaining a copy of the full frame and its transmitted size
Implement better handling of command/response bits whilst decoding and
encoding addresses
Changes:
* Add an enum patty_ax25_frame_cr argument to functions in
src/sock.c which send specific types of frames
* Detect AX.25 version >2.0 based on the command/response SSID bits
* Simplify address copying/encoding by usage of the new function
patty_ax25_addr_copy()
* Implement showing AX.25 version, command/response indicator for
frames in src/print.c
Implement better handling of situations when read() captures multiple
TNC frames; ensure each frame is handled in src/server.c, function
handle_iface(), to ensure packets aren't ignored before the next
select() call
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
Significantly simplify dictionaries so that dictionary keys are always
uint32_t; this number can be an arbitrary integer, be it a file
descriptor, for instance, or a hashed value
Move raw frame interface capture to patty_ax25_if, patty_ax25_sock; this
resolves the issue wherein only bytes received, not sent, would be
captured by a raw socket bound to a specific interface with setsockopt()