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
Changes:
* Implement src/conf.c, patty_conf_read(), to read a configuration
file to support a OpenBSD-style configuration file format
* Implement bin/pattyd.c to use patty_conf_read() to read a
configuration file and apply its settings to a patty_daemon
object as it is read; also implement a --standalone|-s flag to
allow the user to start a patty server without having to write
a configuration file
* Refactor patty_daemon_if_add() to accept a patty_ax25_if object;
this is necessary as bin/pattyd.c needs to be able to validate
the addresses given in a configuration file 'if' statement
* Refactor patty_ax25_server_new() to no longer accept a client
socket path; instead, patty_ax25_server_start() now accepts the
client socket path
* Remove the client socket 'path' member from patty_ax25_server in
src/server.c
* Refactor patty_kiss_tnc_new() to accept only one argument, a
patty_kiss_tnc_info object containing flags and settings needed
to open a device, use an existing file descriptor, or change
termios settings as appropriate
* Remove patty_kiss_tnc_new_fd(), as its functionality now exists
in patty_kiss_tnc_new() itself
* Add a 'flags' field to patty_kiss_tnc_info; use this bit field
to determine whether a path or file descriptor is provided by
the caller
* Make patty_ax25_if_new() accept an interface name argument, as
names are explicitly required when declaring new interfaces in
configuration files
* Make patty_kiss_tnc_new() able to accept /dev/ptmx as a device
name, regardless of whether this character device exists on a
given platform; when provided, a pseudo TTY pair is allocated
with openpty()
* Refactor examples/ax25dump.c to use the new patty_kiss_tnc_new()
calling convention
* Refactor examples/decode.c to use the new patty_kiss_tnc_new()
calling convention
* Remove examples/daemon.c in favor of bin/pattyd.c
* Rename examples/patty.conf to examples/pattyd.conf; modify to
provide values which would actually function
Improved portability in ./configure to add detection for various smaller
items, such as headers necessary for openpty(3), et cetera; improve
overall script structure
Use openpty(3) to open PTYs, to achieve compatibility with OpenBSD as
posix_openpty() returns a file descriptor which does not block on
read() nor select()
Changes:
* Add argument to patty_kiss_tnc_new(), patty_kiss_tnc_new_fd(),
a pointer to patty_kiss_tnc_info, to allow specifying baud and
flow control
* Rework patty_ax25_if_kiss_tnc_info to hold patty_kiss_tnc_info as
a hack to allow instantiating a KISS TNC-based network interface
with desired baud and flow control
Implement src/daemon.c to provide a high level method to instantiate a
patty server
Changes:
* Refactor src/server.c, src/route.c, src/if.c methods which accept
callsign arguments to use a patty_ax25_addr pointer instead; this
has significantly reduced the number of redundant calls to
patty_ax25_pton()
* Decouple patty_ax25_addr from patty_ax25_if_info types when
creating new interfaces with patty_ax25_if_new(); instead, take a
separate patty_ax25_addr argument
* Split patty_ax25_server_run() into the following methods:
- patty_ax25_server_start()
- patty_ax25_server_stop()
- patty_ax25_server_event_handle()
This is intended to allow possible integration into other event
loops.
* Implement src/daemon.c to allow quick instantiation of a server,
interfaces, and routes, and to encapsulate the setting of
configuration variables; callsigns and interface names are handled
as character strings
* Rename examples/server.c to examples/daemon.c; reimplement in
terms of the patty_daemon code
*
Changes:
* When associating a promiscuous socket with an interface, rather
than creating a patty_kiss_tnc object, simply store the socket
file descriptor and use patty_kiss_frame_send() to send incoming
or outgoing frames for that interface to the promiscuous socket
* Add special initialization code in src/sock.c for SOCK_RAW; don't
allocate any buffers, but instead set a few flags and otherwise
use 0-initialized defaults
* Implement handle_sock_raw() in src/server.c to check to see if any
raw frames are pending, and if so, send them to the associated
interface if provided by setsockopt()
* Make patty_ax25_sock_bind_if() only call the function
patty_ax25_if_add_promisc() only if the socket status is PROMISC;
this allows support for non-promiscuous sockets used for outbound
purposes
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