]>
git.seodisparate.com - UDPConnection/log
Stephen Seo [Tue, 10 Jan 2023 03:14:57 +0000 (12:14 +0900)]
Impl handling Ctrl-C for Windows in NetworkTest
Stephen Seo [Tue, 10 Jan 2023 02:51:54 +0000 (11:51 +0900)]
Better handling of receiving packets in recv loop
On error processing a received packet, continue to receive packets in
the loop. If no packet was received, the loop ends.
Stephen Seo [Thu, 8 Dec 2022 07:54:02 +0000 (16:54 +0900)]
Update documentation about UDPC_update(ctx)
Stephen Seo [Sun, 4 Dec 2022 10:57:37 +0000 (19:57 +0900)]
Receive packets in loop til none left in interval
Also some formatting fixes (max 80 chars in edited code).
Stephen Seo [Wed, 23 Nov 2022 05:14:05 +0000 (14:14 +0900)]
Update LICENSE
Stephen Seo [Wed, 23 Nov 2022 05:13:44 +0000 (14:13 +0900)]
Handle SIGINT (Ctrl-C) in NetworkTest
Stephen Seo [Thu, 9 Sep 2021 09:13:38 +0000 (18:13 +0900)]
Update README.md
Stephen Seo [Thu, 9 Sep 2021 09:10:07 +0000 (18:10 +0900)]
Add gh-pages workflow for Doxygen documentation
Stephen Seo [Mon, 30 Aug 2021 03:07:27 +0000 (12:07 +0900)]
Update .gitignore
Stephen Seo [Wed, 25 Aug 2021 10:45:01 +0000 (19:45 +0900)]
Fix README.md
Stephen Seo [Sun, 14 Feb 2021 04:56:26 +0000 (13:56 +0900)]
Update README.md
Stephen Seo [Sun, 10 Jan 2021 05:40:38 +0000 (14:40 +0900)]
Update year in LICENSE
Stephen Seo [Sun, 10 Jan 2021 05:40:17 +0000 (14:40 +0900)]
Add |id| to PacketInfo
Stephen Seo [Tue, 23 Jun 2020 04:01:27 +0000 (13:01 +0900)]
Use dll_export (for builds for Windows)
Stephen Seo [Tue, 28 Apr 2020 11:55:16 +0000 (20:55 +0900)]
Attempt to make NetworkTest work on Windows
Stephen Seo [Tue, 28 Apr 2020 10:38:07 +0000 (19:38 +0900)]
Add/fix more documentation
Stephen Seo [Mon, 27 Apr 2020 10:34:04 +0000 (19:34 +0900)]
Minor fixes
Stephen Seo [Mon, 27 Apr 2020 02:47:50 +0000 (11:47 +0900)]
Fix check addr endianness in a4toa6 function
Stephen Seo [Sun, 26 Apr 2020 09:36:49 +0000 (18:36 +0900)]
Impl create id with hostname
Previously, ids could only be created with an ip address. Now they can
be made with a hostname, which will be looked up by UDPC.
Also fix client still requesting connections even if
accept-new-connections flag is false.
Stephen Seo [Sat, 18 Apr 2020 07:19:59 +0000 (16:19 +0900)]
Minor fix to documentation
Stephen Seo [Sat, 18 Apr 2020 07:09:00 +0000 (16:09 +0900)]
Use memcpy instead of pointer casted assignment
std::memcpy is used over int pointer casted assignment due to possible
alignment issues that may cause the casted pointer to be invalid.
Stephen Seo [Wed, 15 Apr 2020 10:49:17 +0000 (19:49 +0900)]
Change how UDPC_PacketInfo handles it's data
The "data" member variable in UDPC_PacketInfo is now handled as a
pointer to dynamic data, instead of an array with a fixed size. Every
time a UDPC_PacketInfo is received from the context,
UDPC_free_PacketInfo() must be called on it to avoid a memory leak.
Stephen Seo [Fri, 6 Mar 2020 04:03:47 +0000 (13:03 +0900)]
Fix compilation fail on no libsodium
Stephen Seo [Fri, 6 Mar 2020 03:05:33 +0000 (12:05 +0900)]
Fix use of C++14/C++17, only C++11 is supported
Stephen Seo [Thu, 16 Jan 2020 11:28:42 +0000 (20:28 +0900)]
Add helpers converting network-order (big-endian)
Stephen Seo [Thu, 16 Jan 2020 11:28:01 +0000 (20:28 +0900)]
Fix UDPC::isBigEndian returning always true
Stephen Seo [Thu, 16 Jan 2020 02:30:22 +0000 (11:30 +0900)]
Distinguish manual variables and pkgconf variables
Variables checked to manually set libsodium paths have been changed to
prevent conflict with variables set by searching for libsodium via
pkgconfig.
Stephen Seo [Thu, 16 Jan 2020 02:27:19 +0000 (11:27 +0900)]
Allow manually setting dependency libsodium paths
Stephen Seo [Wed, 15 Jan 2020 07:31:38 +0000 (16:31 +0900)]
Fix verification message when using libsodium
Previous implementation had the client send only epoch-time-in-seconds
to be signed by the server. Now the client sends random data and
epoch-time to be signed by the server.
Stephen Seo [Mon, 13 Jan 2020 10:26:05 +0000 (19:26 +0900)]
Update README.md
Stephen Seo [Mon, 13 Jan 2020 10:22:08 +0000 (19:22 +0900)]
Fix doxygen documentation
Stephen Seo [Mon, 13 Jan 2020 10:14:34 +0000 (19:14 +0900)]
Update README.md
Stephen Seo [Mon, 13 Jan 2020 09:50:00 +0000 (18:50 +0900)]
Update README.md
Stephen Seo [Mon, 13 Jan 2020 09:47:22 +0000 (18:47 +0900)]
Update README.md
Stephen Seo [Mon, 13 Jan 2020 09:40:14 +0000 (18:40 +0900)]
Add LICENSE and README.md
Stephen Seo [Fri, 10 Jan 2020 11:28:08 +0000 (20:28 +0900)]
Set pointers to const where possible in API
Stephen Seo [Thu, 9 Jan 2020 07:57:01 +0000 (16:57 +0900)]
Truncate "UDPConnection" to "UDPC"
Stephen Seo [Thu, 9 Jan 2020 07:45:57 +0000 (16:45 +0900)]
Fix potential non-null-terminated string bug
Stephen Seo [Wed, 8 Jan 2020 11:50:56 +0000 (20:50 +0900)]
Add more documentation, some fixes
Stephen Seo [Wed, 8 Jan 2020 10:55:12 +0000 (19:55 +0900)]
Replace TSLQueue with std::deque where possible
Also added std::mutex for each new std::deque. cSendPkts is left as a
TSLQueue because it needs to support fast removal from the middle of the
data structure (mainly because the queued packets per ConnectionData has
an imposed limit of packets to hold).
Stephen Seo [Sun, 5 Jan 2020 07:05:17 +0000 (16:05 +0900)]
Minor fix to keysSet atomic_bool
Stephen Seo [Sun, 5 Jan 2020 06:39:25 +0000 (15:39 +0900)]
Minor fixes
Stephen Seo [Sun, 5 Jan 2020 06:31:37 +0000 (15:31 +0900)]
Fix usage of atomic_bool "keysSet"
Stephen Seo [Sun, 5 Jan 2020 06:12:13 +0000 (15:12 +0900)]
Minor refactoring/fix of use of atomic_bool
Stephen Seo [Sun, 5 Jan 2020 06:05:23 +0000 (15:05 +0900)]
Refactor locking mutex during update
Stephen Seo [Sun, 5 Jan 2020 05:49:37 +0000 (14:49 +0900)]
Client on connect fail now returns FAIL_CONNECT
Previously, returned event was DISCONNECT. FAIL_CONNECT is a new event
enum value.
Stephen Seo [Sun, 5 Jan 2020 05:42:57 +0000 (14:42 +0900)]
Client now regenerates verif-time on con attempt
Stephen Seo [Thu, 2 Jan 2020 11:54:32 +0000 (20:54 +0900)]
Implement publickey whitelist (using libsodium)
Renamed "mutex" to "conMapMutex" since it is mainly used to lock access
to the connection map.
Removed UDPC_client_initiate_connection_pk() as publickey whitelisting
replaces its functionality.
Stephen Seo [Thu, 2 Jan 2020 07:33:17 +0000 (16:33 +0900)]
Add verification of verification time server-side
Verification string is no longer a string but seconds since epoch.
Stephen Seo [Thu, 2 Jan 2020 04:12:40 +0000 (13:12 +0900)]
Change: libsodium verification now on full packet
Stephen Seo [Mon, 30 Dec 2019 05:13:38 +0000 (14:13 +0900)]
Fix copying over data of received packet
Stephen Seo [Fri, 27 Dec 2019 04:35:28 +0000 (13:35 +0900)]
Fix received packet storing unnecessary header
Added rtt (uint16_t) to UDPC_PacketInfo.
Stephen Seo [Sun, 22 Dec 2019 13:50:50 +0000 (22:50 +0900)]
Minor additions/fixes to doxygen-style docs
Stephen Seo [Thu, 19 Dec 2019 02:39:34 +0000 (11:39 +0900)]
Minor refactorings
UDPC_update now locks the mutex to keep it thread-safe.
Stephen Seo [Wed, 18 Dec 2019 05:34:53 +0000 (14:34 +0900)]
Minor fixes
Stephen Seo [Wed, 18 Dec 2019 05:20:29 +0000 (14:20 +0900)]
Minor fixes, improvements
When UDPC_ConnectionId is initialized, all of its bytes are now zeroed
out.
Stephen Seo [Wed, 18 Dec 2019 04:47:46 +0000 (13:47 +0900)]
Add way to get connection queued size
Requires locking the mutex for access to conMap.
Stephen Seo [Tue, 17 Dec 2019 11:58:44 +0000 (20:58 +0900)]
Bug fixes
Fixed not setting output int to 0 to specify zero connections when
returning connection IDs.
Stephen Seo [Tue, 17 Dec 2019 11:04:31 +0000 (20:04 +0900)]
Impl disc. request (untested), del make_unique
Stephen Seo [Tue, 17 Dec 2019 10:12:54 +0000 (19:12 +0900)]
Replace "poor man's optional" with std::unique_ptr
Stephen Seo [Tue, 17 Dec 2019 03:52:10 +0000 (12:52 +0900)]
Fix create_id_easy not parsing ipv4 addr correctly
Stephen Seo [Wed, 11 Dec 2019 12:24:28 +0000 (21:24 +0900)]
Fix UnitTests using C++17 (now uses C++11)
Stephen Seo [Wed, 11 Dec 2019 11:00:48 +0000 (20:00 +0900)]
Drop support from C++17 to C++11
std::optional replaced with Entry in TSLQueue (which is basically a poor
man's optional).
Stephen Seo [Mon, 9 Dec 2019 12:27:58 +0000 (21:27 +0900)]
Impl auth-policy for handling with(out) auth
Stephen Seo [Fri, 6 Dec 2019 11:49:30 +0000 (20:49 +0900)]
More documentation, fix constants to be #define'd
Stephen Seo [Wed, 4 Dec 2019 06:08:25 +0000 (15:08 +0900)]
Update .gitignore
Stephen Seo [Wed, 4 Dec 2019 04:08:30 +0000 (13:08 +0900)]
More work on Doxygen style documentation
Stephen Seo [Wed, 27 Nov 2019 11:26:40 +0000 (20:26 +0900)]
Begin doxygen-style documentation WIP
Stephen Seo [Wed, 27 Nov 2019 11:12:57 +0000 (20:12 +0900)]
Minor fixes/refactorings
Stephen Seo [Wed, 27 Nov 2019 10:47:51 +0000 (19:47 +0900)]
Add is_valid_context(), fixes/refactorings
Stephen Seo [Wed, 27 Nov 2019 10:41:38 +0000 (19:41 +0900)]
Add set_libsodium_key_easy(), fixes/refactorings
Stephen Seo [Thu, 21 Nov 2019 06:15:05 +0000 (15:15 +0900)]
Fixes for setting pub/sec keys
Added more to NetworkTest to test new changes.
Stephen Seo [Thu, 21 Nov 2019 03:23:40 +0000 (12:23 +0900)]
Add unset_libsodium_keys()
Still untested
Stephen Seo [Tue, 19 Nov 2019 11:55:20 +0000 (20:55 +0900)]
Add set peer_pk, sk/pk, start/stop threaded update
Note, this code is UNTESTED.
Stephen Seo [Mon, 18 Nov 2019 08:37:03 +0000 (17:37 +0900)]
libsodium support is now optional
Packet struture has been changed to support UDPC without libsodium
sending packets to UDPC with libsodium.
Stephen Seo [Wed, 13 Nov 2019 05:06:48 +0000 (14:06 +0900)]
Add way to specify sleep time for threaded update
Stephen Seo [Wed, 13 Nov 2019 03:15:12 +0000 (12:15 +0900)]
Add UDPC_create_id_easy
UDPC_create_id_easy will detect if the input addr string is link local
or not, and will create the ipv6 address based on it.
Stephen Seo [Wed, 13 Nov 2019 02:47:53 +0000 (11:47 +0900)]
Convert NetworkTest to C from C++
Stephen Seo [Mon, 11 Nov 2019 07:08:51 +0000 (16:08 +0900)]
Add events, refactorings
Added event system to lessen the use of the main mutex and instead use
thread safe data structures (TSLQueue). Also can enable and check events
during execution (connect, disconnect, good mode, bad mode).
Fixes and refactorings.
Stephen Seo [Mon, 11 Nov 2019 04:37:51 +0000 (13:37 +0900)]
Fix use of addr/socket types
Stephen Seo [Mon, 11 Nov 2019 04:08:36 +0000 (13:08 +0900)]
Replace c_impl, remove rust_binding, with cpp_impl
Stephen Seo [Wed, 6 Nov 2019 05:42:35 +0000 (14:42 +0900)]
Remove unused TSQueue and RingBuffer
Stephen Seo [Wed, 6 Nov 2019 05:35:16 +0000 (14:35 +0900)]
Fixes and improvements (add use of TSLQueue)
Replace "unsigned long long" in TSLQueue with "unsigned long" to keep
compatibility with C.
Add top_and_pop_and_rsize() to TSLQueue.
Fix log levels in UDPC.
Replace TSQueue with TSLQueue in UDPC_Context.
Also fix NetworkTest with TSLQueue related changes.
Stephen Seo [Wed, 6 Nov 2019 04:34:37 +0000 (13:34 +0900)]
Minor fix to size pointer in TSLQueue iterator
Prevent pointer change errors by making the pointer itself const.
Stephen Seo [Wed, 6 Nov 2019 04:32:39 +0000 (13:32 +0900)]
Fix size count in TSLQueue when using iterator
Stephen Seo [Wed, 6 Nov 2019 03:54:03 +0000 (12:54 +0900)]
Add more tests to UnitTest for TSLQueue
Stephen Seo [Sun, 3 Nov 2019 09:46:25 +0000 (18:46 +0900)]
Add iterator to TSLQueue
Removed shared_ptr "locks", replaced by iterator owning a lock_guard.
Stephen Seo [Tue, 29 Oct 2019 11:33:16 +0000 (20:33 +0900)]
Replace std::list with own doubly-linked-list
TODO iterator
Stephen Seo [Mon, 28 Oct 2019 02:09:48 +0000 (11:09 +0900)]
Add remove() to TSLQueue's iterator wrapper
Minor additions to UnitTest.
Stephen Seo [Thu, 24 Oct 2019 11:25:41 +0000 (20:25 +0900)]
Add WIP UnitTests for TSLQueue
Stephen Seo [Thu, 24 Oct 2019 08:58:13 +0000 (17:58 +0900)]
Add prefix inc/dec to TSLQIterWrapper
Stephen Seo [Thu, 24 Oct 2019 08:51:40 +0000 (17:51 +0900)]
Add missing impl fn to TSLQueue
Stephen Seo [Thu, 24 Oct 2019 08:49:28 +0000 (17:49 +0900)]
Add impl of TSLQueue (TODO UnitTests)
Stephen Seo [Tue, 22 Oct 2019 11:24:23 +0000 (20:24 +0900)]
Begin work on TSLQueue
Stephen Seo [Tue, 22 Oct 2019 10:27:55 +0000 (19:27 +0900)]
Refactor logging
Removed redundant checking of logging type in log_impl* .
Stephen Seo [Fri, 27 Sep 2019 11:19:48 +0000 (20:19 +0900)]
Rework sendPkts (sending queue)
Changed sendPkts in ConnectionData to std::deque, added a TSQueue
cSendPkts to Context. Queued packets will be moved to corresponding
ConnectionData instances during update, dropping with a warning those
where a connection does not exist.
Minor other fixes.
Some additions to TSQueue.
Stephen Seo [Mon, 23 Sep 2019 11:11:12 +0000 (20:11 +0900)]
Implement header verification via libsodium
The original 20 byte header is now verified with public-key-crypto using
libsodium.
Also some fixes where ntohs/htons was not used where it should be.
Stephen Seo [Sat, 21 Sep 2019 03:15:49 +0000 (12:15 +0900)]
Add support for MINGW compiler
Stephen Seo [Fri, 20 Sep 2019 07:59:16 +0000 (16:59 +0900)]
Fixes and improvements
Fix use of accept-connections flag.
Fix use of TSQueue (add top_and_pop_and_rsize fn).
Reduce sleep time of threadedUpdate to 8 ms.
Stephen Seo [Fri, 20 Sep 2019 05:26:59 +0000 (14:26 +0900)]
Use macro to conditionally log
This should skip evaluating log parameters if the log level is not met.