Implement new patty client code, replacing src/call.c with src/client.c
providing clients with an interface dealing with file descriptors valid
in their process space; this also obviates the need to open a Unix
domain socket to a patty server explicitly, and helps keep track of
sockets opened on the server, locally
Changes:
* Implement patty_client_new() to handle opening the server Unix
domain socket, and to allocate a dict for mapping server-side
sockets with current process file descriptors
* Reimplement all server calls in src/call.c around the new
patty_client type; calls which result in the creation of a
Unix98 PTY by the patty server now handle opening the local PTY
and setting the file descriptor to raw mode. Furthermore, these
calls deal exclusively in terms of current process file
descriptors
* Refactor src/server.c to use the new patty_client type and calls
* Refactor examples/client.c, examples/server.c, examples/ax25dump.c
to use the new patty_client type and calls
* Fix a bug in src/server.c, respond_accept() wherein a 0, rather
than the file descriptor of the socket, is sent to the client as a
return value
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()
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_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
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
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