Commit graph

35 commits

Author SHA1 Message Date
1f4ffc98ac Implement new patty client code
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
2024-03-01 00:20:46 -05:00
e10ce6b8e1 Implement generic timer functions in src/timer.c
Changes:

    * Implement patty_timer_expired() to determine if a timer has
      expired or has gone negative

    * Implement patty_timer_cancel() to set a timer to zero

    * Implement patty_timer_start() to initialize a timer, add a
      specified number of milliseconds, and ensure a target timer (such
      as the server timer) is set for at least that value as well

    * Implement patty_timer_tick() to subtract an elapsed time value
      from a timer

    * Remove functions specific to each timer in src/sock.c, as those
      can now be handled generically by src/timer.c

    * Replace calls to patty_ax25_sock_timer_t1_*() with patty_timer_*()
      calls instead; reference the struct timeval objects directly
      within the sock (for the time being, pending opaque structures)
2024-03-01 00:20:46 -05:00
a4518a839a Implement better modulo-128 I and S frame support
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
2024-03-01 00:20:46 -05:00
b9a6ef9ff3 Move test files to examples/; build libpatty 2024-03-01 00:20:46 -05:00
bd68e33973 Implement src/testclient-promisc.c
Implement src/testclient-promisc.c to demonstrate raw packet access
("promiscuous mode") to interfaces
2024-03-01 00:20:46 -05:00
cbea4ad7a8 Implement src/print.c
Implement src/print.c to provide facilities for pretty printing packets
to any FILE handle
2024-03-01 00:20:46 -05:00
36bd5c9a44 Delete unnecessary example src/ptmx.c 2024-03-01 00:20:46 -05:00
22bf692a61 SO BLOODY CLOSE 2024-03-01 00:20:46 -05:00
4aced9e9c1 ...I've been busy. 2024-03-01 00:20:46 -05:00
d265ce8756 More stuff 2024-03-01 00:20:46 -05:00
5607dbede6 Split patty_ax25_sock into patty/ax25/sock.h 2024-03-01 00:20:46 -05:00
d2e278f715 Massive refactoring afoot 2024-03-01 00:20:46 -05:00
fa3f4a2e0e Start of massive refactor 2024-03-01 00:20:46 -05:00
a8db220bbd Major refactor WIP 2024-03-01 00:20:46 -05:00
2eacce6f09 Remove src/buffer.c 2024-03-01 00:20:46 -05:00
67afb68917 Ensure header changes trigger rebuilds 2024-03-01 00:20:46 -05:00
241f647b03 Initial commit of src/ptmx.c 2024-03-01 00:20:46 -05:00
82d94fb5ad Implement src/buffer.c 2024-03-01 00:20:46 -05:00
af485f68c2 I am not terrible 2024-03-01 00:20:46 -05:00
4973957530 Why not, man 2024-03-01 00:20:46 -05:00
f03d99c2a7 Fix up example programs somewhat 2024-03-01 00:20:46 -05:00
d7e40110a5 Finally getting around to implementing more of the spec, I tell ya 2024-03-01 00:20:46 -05:00
275dec9760 Implement src/address.c 2024-03-01 00:20:46 -05:00
0f639cc350 Refactor around the simplified concept of patty_ax25_sock 2024-03-01 00:20:46 -05:00
b923ad3566 Implement src/port.c 2024-03-01 00:20:46 -05:00
b0c014f6c1 It helps if things compile 2024-03-01 00:20:46 -05:00
e18027e9ea Remove that from Makefile for now 2024-03-01 00:20:46 -05:00
05c55837fb meh 2024-03-01 00:20:46 -05:00
bca3daeeb4 Start stubbing out patty/ax25.h 2015-07-20 22:33:59 -05:00
754f6a039f Yay? 2015-07-19 22:40:51 -05:00
e5ee036423 This works out better 2015-07-18 12:15:59 -05:00
447a266432 A spoonful of unions make the weird specs go down 2015-07-18 02:17:35 -05:00
22874e6e06 Since we broke off, I'm using lipstick again 2015-07-17 00:45:14 +00:00
9278eca7c3 IT'S ALIVE\! 2015-07-16 00:31:27 +00:00
7709abbc1c Damn Xan, you code like a BEAST O:) 2015-07-14 16:45:03 +00:00