]> git.seodisparate.com - UDPConnection/log
UDPConnection
5 years agoFix usage of atomic_bool "keysSet"
Stephen Seo [Sun, 5 Jan 2020 06:31:37 +0000 (15:31 +0900)]
Fix usage of atomic_bool "keysSet"

5 years agoMinor refactoring/fix of use of atomic_bool
Stephen Seo [Sun, 5 Jan 2020 06:12:13 +0000 (15:12 +0900)]
Minor refactoring/fix of use of atomic_bool

5 years agoRefactor locking mutex during update
Stephen Seo [Sun, 5 Jan 2020 06:05:23 +0000 (15:05 +0900)]
Refactor locking mutex during update

5 years agoClient on connect fail now returns FAIL_CONNECT
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.

5 years agoClient now regenerates verif-time on con attempt
Stephen Seo [Sun, 5 Jan 2020 05:42:57 +0000 (14:42 +0900)]
Client now regenerates verif-time on con attempt

5 years agoImplement publickey whitelist (using libsodium)
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.

5 years agoAdd verification of verification time server-side
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.

5 years agoChange: libsodium verification now on full packet
Stephen Seo [Thu, 2 Jan 2020 04:12:40 +0000 (13:12 +0900)]
Change: libsodium verification now on full packet

5 years agoFix copying over data of received packet
Stephen Seo [Mon, 30 Dec 2019 05:13:38 +0000 (14:13 +0900)]
Fix copying over data of received packet

5 years agoFix received packet storing unnecessary header
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.

5 years agoMinor additions/fixes to doxygen-style docs
Stephen Seo [Sun, 22 Dec 2019 13:50:50 +0000 (22:50 +0900)]
Minor additions/fixes to doxygen-style docs

5 years agoMinor refactorings
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.

5 years agoMinor fixes
Stephen Seo [Wed, 18 Dec 2019 05:34:53 +0000 (14:34 +0900)]
Minor fixes

5 years agoMinor fixes, improvements
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.

5 years agoAdd way to get connection queued size
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.

5 years agoBug fixes
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.

5 years agoImpl disc. request (untested), del make_unique
Stephen Seo [Tue, 17 Dec 2019 11:04:31 +0000 (20:04 +0900)]
Impl disc. request (untested), del make_unique

5 years agoReplace "poor man's optional" with std::unique_ptr
Stephen Seo [Tue, 17 Dec 2019 10:12:54 +0000 (19:12 +0900)]
Replace "poor man's optional" with std::unique_ptr

5 years agoFix create_id_easy not parsing ipv4 addr correctly
Stephen Seo [Tue, 17 Dec 2019 03:52:10 +0000 (12:52 +0900)]
Fix create_id_easy not parsing ipv4 addr correctly

5 years agoFix UnitTests using C++17 (now uses C++11)
Stephen Seo [Wed, 11 Dec 2019 12:24:28 +0000 (21:24 +0900)]
Fix UnitTests using C++17 (now uses C++11)

5 years agoDrop support from C++17 to 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).

5 years agoImpl auth-policy for handling with(out) auth
Stephen Seo [Mon, 9 Dec 2019 12:27:58 +0000 (21:27 +0900)]
Impl auth-policy for handling with(out) auth

5 years agoMore documentation, fix constants to be #define'd
Stephen Seo [Fri, 6 Dec 2019 11:49:30 +0000 (20:49 +0900)]
More documentation, fix constants to be #define'd

5 years agoUpdate .gitignore
Stephen Seo [Wed, 4 Dec 2019 06:08:25 +0000 (15:08 +0900)]
Update .gitignore

5 years agoMore work on Doxygen style documentation
Stephen Seo [Wed, 4 Dec 2019 04:08:30 +0000 (13:08 +0900)]
More work on Doxygen style documentation

5 years agoBegin doxygen-style documentation WIP
Stephen Seo [Wed, 27 Nov 2019 11:26:40 +0000 (20:26 +0900)]
Begin doxygen-style documentation WIP

5 years agoMinor fixes/refactorings
Stephen Seo [Wed, 27 Nov 2019 11:12:57 +0000 (20:12 +0900)]
Minor fixes/refactorings

5 years agoAdd is_valid_context(), fixes/refactorings
Stephen Seo [Wed, 27 Nov 2019 10:47:51 +0000 (19:47 +0900)]
Add is_valid_context(), fixes/refactorings

5 years agoAdd set_libsodium_key_easy(), fixes/refactorings
Stephen Seo [Wed, 27 Nov 2019 10:41:38 +0000 (19:41 +0900)]
Add set_libsodium_key_easy(), fixes/refactorings

5 years agoFixes for setting pub/sec keys
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.

5 years agoAdd unset_libsodium_keys()
Stephen Seo [Thu, 21 Nov 2019 03:23:40 +0000 (12:23 +0900)]
Add unset_libsodium_keys()

Still untested

5 years agoAdd set peer_pk, sk/pk, start/stop threaded update
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.

5 years agolibsodium support is now optional
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.

5 years agoAdd way to specify sleep time for threaded update
Stephen Seo [Wed, 13 Nov 2019 05:06:48 +0000 (14:06 +0900)]
Add way to specify sleep time for threaded update

5 years agoAdd UDPC_create_id_easy
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.

5 years agoConvert NetworkTest to C from C++
Stephen Seo [Wed, 13 Nov 2019 02:47:53 +0000 (11:47 +0900)]
Convert NetworkTest to C from C++

5 years agoAdd events, refactorings
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.

5 years agoFix use of addr/socket types
Stephen Seo [Mon, 11 Nov 2019 04:37:51 +0000 (13:37 +0900)]
Fix use of addr/socket types

5 years agoReplace c_impl, remove rust_binding, with cpp_impl
Stephen Seo [Mon, 11 Nov 2019 04:08:36 +0000 (13:08 +0900)]
Replace c_impl, remove rust_binding, with cpp_impl

5 years agoRemove unused TSQueue and RingBuffer
Stephen Seo [Wed, 6 Nov 2019 05:42:35 +0000 (14:42 +0900)]
Remove unused TSQueue and RingBuffer

5 years agoFixes and improvements (add use of TSLQueue)
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.

5 years agoMinor fix to size pointer in TSLQueue iterator
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.

5 years agoFix size count in TSLQueue when using iterator
Stephen Seo [Wed, 6 Nov 2019 04:32:39 +0000 (13:32 +0900)]
Fix size count in TSLQueue when using iterator

5 years agoAdd more tests to UnitTest for TSLQueue
Stephen Seo [Wed, 6 Nov 2019 03:54:03 +0000 (12:54 +0900)]
Add more tests to UnitTest for TSLQueue

5 years agoAdd iterator to 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.

5 years agoReplace std::list with own doubly-linked-list
Stephen Seo [Tue, 29 Oct 2019 11:33:16 +0000 (20:33 +0900)]
Replace std::list with own doubly-linked-list

TODO iterator

5 years agoAdd remove() to TSLQueue's iterator wrapper
Stephen Seo [Mon, 28 Oct 2019 02:09:48 +0000 (11:09 +0900)]
Add remove() to TSLQueue's iterator wrapper

Minor additions to UnitTest.

5 years agoAdd WIP UnitTests for TSLQueue
Stephen Seo [Thu, 24 Oct 2019 11:25:41 +0000 (20:25 +0900)]
Add WIP UnitTests for TSLQueue

5 years agoAdd prefix inc/dec to TSLQIterWrapper
Stephen Seo [Thu, 24 Oct 2019 08:58:13 +0000 (17:58 +0900)]
Add prefix inc/dec to TSLQIterWrapper

5 years agoAdd missing impl fn to TSLQueue
Stephen Seo [Thu, 24 Oct 2019 08:51:40 +0000 (17:51 +0900)]
Add missing impl fn to TSLQueue

5 years agoAdd impl of TSLQueue (TODO UnitTests)
Stephen Seo [Thu, 24 Oct 2019 08:49:28 +0000 (17:49 +0900)]
Add impl of TSLQueue (TODO UnitTests)

5 years agoBegin work on TSLQueue
Stephen Seo [Tue, 22 Oct 2019 11:24:23 +0000 (20:24 +0900)]
Begin work on TSLQueue

5 years agoRefactor logging
Stephen Seo [Tue, 22 Oct 2019 10:27:55 +0000 (19:27 +0900)]
Refactor logging

Removed redundant checking of logging type in log_impl* .

5 years agoRework sendPkts (sending queue)
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.

5 years agoImplement header verification via libsodium
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.

5 years agoAdd support for MINGW compiler
Stephen Seo [Sat, 21 Sep 2019 03:15:49 +0000 (12:15 +0900)]
Add support for MINGW compiler

5 years agoFixes and improvements
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.

5 years agoUse macro to conditionally log
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.

5 years agoMany fixes, including sending packets with payload
Stephen Seo [Fri, 20 Sep 2019 05:01:26 +0000 (14:01 +0900)]
Many fixes, including sending packets with payload

Implemented UDPC_get_received
Added UDPC_get_list_connected and UDPC_free_list_connected.

5 years agoFix parsing of ipv6 link-local address
Stephen Seo [Thu, 19 Sep 2019 05:30:10 +0000 (14:30 +0900)]
Fix parsing of ipv6 link-local address

Add support for numeric id in suffix of ipv6 link-local address.

5 years agoFix Windows support
Stephen Seo [Thu, 19 Sep 2019 03:23:15 +0000 (12:23 +0900)]
Fix Windows support

5 years agoRename enum types to avoid name conflict
Stephen Seo [Thu, 19 Sep 2019 01:58:19 +0000 (10:58 +0900)]
Rename enum types to avoid name conflict

5 years agoAttempt to make code platform agnostic
Stephen Seo [Thu, 19 Sep 2019 01:35:22 +0000 (10:35 +0900)]
Attempt to make code platform agnostic

Getting scope_id from device name from ipv6 link-local address was
previously using only a unix supported api. Added (untested) code to do
the same for windows machines.

5 years agoFix atostr
Stephen Seo [Wed, 18 Sep 2019 09:39:35 +0000 (18:39 +0900)]
Fix atostr

5 years agoAdd support for link-local ipv6 addr
Stephen Seo [Wed, 18 Sep 2019 08:35:14 +0000 (17:35 +0900)]
Add support for link-local ipv6 addr

5 years agoFix NetworkTest
Stephen Seo [Wed, 18 Sep 2019 04:56:04 +0000 (13:56 +0900)]
Fix NetworkTest

Allow setting listen addr to "any".

5 years agoFix setting trigger-send flag
Stephen Seo [Wed, 18 Sep 2019 02:42:16 +0000 (11:42 +0900)]
Fix setting trigger-send flag

Fix trigger-send flag related bug where send time of packets were
inconsistent.
Also fix UDPC_client_initiate_connection not immediately sending connection
packet.

5 years agoImpl NetworkTest, fixes and refactoring
Stephen Seo [Tue, 17 Sep 2019 11:33:47 +0000 (20:33 +0900)]
Impl NetworkTest, fixes and refactoring

Basic connections can now be tested with NetworkTest.
Also includes fixes to UDPC that now create a working connection.

TODO Fix client sending at good rate even in bad rate mode.

5 years agoAdd support for UDPC_strtoa to accept ipv4 input
Stephen Seo [Tue, 17 Sep 2019 08:17:16 +0000 (17:17 +0900)]
Add support for UDPC_strtoa to accept ipv4 input

UDPC_strtoa can now return an ipv4-mapped ipv6 address given an ipv4
string. Also, added validation of input strings via regex.

5 years agoUse mutex for thread safety
Stephen Seo [Mon, 16 Sep 2019 03:00:25 +0000 (12:00 +0900)]
Use mutex for thread safety

5 years agoAdd command parsing for NetworkTest
Stephen Seo [Mon, 16 Sep 2019 02:52:03 +0000 (11:52 +0900)]
Add command parsing for NetworkTest

5 years agoImpl threaded init/update
Stephen Seo [Mon, 16 Sep 2019 02:40:43 +0000 (11:40 +0900)]
Impl threaded init/update

5 years agoReplace ipv4 with ipv6
Stephen Seo [Sat, 7 Sep 2019 07:36:11 +0000 (16:36 +0900)]
Replace ipv4 with ipv6

ipv6 also supports sending to ipv4.

5 years agoMake atostr more thread safe
Stephen Seo [Tue, 3 Sep 2019 07:19:47 +0000 (16:19 +0900)]
Make atostr more thread safe

atostr now can hold 64 different results, and can be called from
multiple threads. Thus, a returned string buffer is valid until atostr
is called 64 more times.

5 years agoPrevent exceptions being thrown in TSQueue
Stephen Seo [Tue, 3 Sep 2019 06:15:09 +0000 (15:15 +0900)]
Prevent exceptions being thrown in TSQueue

TSQueue's top() and top_and_pop() now return std::optional<T> instead of
just T.

5 years agoExpose ConnectionId to C interface, fixes
Stephen Seo [Tue, 3 Sep 2019 03:06:46 +0000 (12:06 +0900)]
Expose ConnectionId to C interface, fixes

Removed UDPC:ConnectionIdentifier from UDPC_Defines.hpp and added
ConnectionId to UDPConnection.h, and replaced/fixed instances of the
older type.

5 years agoAdd top_and_pop fn to TSQueue
Stephen Seo [Fri, 30 Aug 2019 06:55:43 +0000 (15:55 +0900)]
Add top_and_pop fn to TSQueue

5 years agoMinor fixes
Stephen Seo [Fri, 30 Aug 2019 05:57:24 +0000 (14:57 +0900)]
Minor fixes

5 years agoSimpifly opaque struct handle to context
Stephen Seo [Fri, 30 Aug 2019 03:11:07 +0000 (12:11 +0900)]
Simpifly opaque struct handle to context

5 years agoRemove already resolved TODO comment
Stephen Seo [Fri, 30 Aug 2019 03:04:39 +0000 (12:04 +0900)]
Remove already resolved TODO comment

5 years agoUse opaque struct as handle in C interface, fix
Stephen Seo [Fri, 30 Aug 2019 03:03:26 +0000 (12:03 +0900)]
Use opaque struct as handle in C interface, fix

Fixed log_impl_next.

5 years agoImpl logging, minor fixes/refactorings
Stephen Seo [Thu, 29 Aug 2019 03:56:09 +0000 (12:56 +0900)]
Impl logging, minor fixes/refactorings

5 years agoMinor formatting fix
Stephen Seo [Thu, 29 Aug 2019 02:20:36 +0000 (11:20 +0900)]
Minor formatting fix

5 years agoAdd client_initiate_connection fn, some fixes
Stephen Seo [Thu, 29 Aug 2019 02:07:24 +0000 (11:07 +0900)]
Add client_initiate_connection fn, some fixes

5 years agoImpl drop all connections with specific addr
Stephen Seo [Wed, 28 Aug 2019 07:38:14 +0000 (16:38 +0900)]
Impl drop all connections with specific addr

Fix UDPC_drop_connection that didn't fully cleanup connection data.

Added UDPC_drop_connection_addr fn that drops all connections with a
specific addr.

5 years agoSome fixes
Stephen Seo [Wed, 28 Aug 2019 06:54:18 +0000 (15:54 +0900)]
Some fixes

Fix id of sent packet stored in network byte order instead of native
order.

Fix failing to send packet not stopping storing sent packet data.

5 years agoAdd some Unit Tests for UDPC
Stephen Seo [Tue, 27 Aug 2019 09:03:30 +0000 (18:03 +0900)]
Add some Unit Tests for UDPC

5 years agoMinor fix
Stephen Seo [Tue, 27 Aug 2019 08:53:18 +0000 (17:53 +0900)]
Minor fix

5 years agoStore connections based on both addr and port
Stephen Seo [Tue, 27 Aug 2019 08:00:29 +0000 (17:00 +0900)]
Store connections based on both addr and port

Previous implementation only stored based on addr only, preventing
connections from/to the same address but different ports.

5 years agoReplace all uses of float with chrono::duration
Stephen Seo [Tue, 27 Aug 2019 07:31:24 +0000 (16:31 +0900)]
Replace all uses of float with chrono::duration

5 years agoFix warnings, some impl, still WIP
Stephen Seo [Tue, 27 Aug 2019 05:06:27 +0000 (14:06 +0900)]
Fix warnings, some impl, still WIP

5 years agoSet max size for received pkts queue
Stephen Seo [Tue, 27 Aug 2019 04:06:15 +0000 (13:06 +0900)]
Set max size for received pkts queue

5 years agoImpl storing received packet
Stephen Seo [Tue, 27 Aug 2019 04:03:38 +0000 (13:03 +0900)]
Impl storing received packet

5 years agoImpl check timed-out packets
Stephen Seo [Tue, 27 Aug 2019 03:42:43 +0000 (12:42 +0900)]
Impl check timed-out packets

Still WIP

5 years agoMore impl: rtt and timepoint per sent pkt
Stephen Seo [Thu, 22 Aug 2019 11:16:07 +0000 (20:16 +0900)]
More impl: rtt and timepoint per sent pkt

5 years agoMore impl, fix move for TSQueue
Stephen Seo [Thu, 22 Aug 2019 07:08:05 +0000 (16:08 +0900)]
More impl, fix move for TSQueue

5 years agoSome WIP impl of receiving packet handling
Stephen Seo [Sun, 18 Aug 2019 10:14:14 +0000 (19:14 +0900)]
Some WIP impl of receiving packet handling

5 years agoImpl sending queued packet
Stephen Seo [Sun, 18 Aug 2019 09:34:45 +0000 (18:34 +0900)]
Impl sending queued packet

TODO receiving packet

5 years agoReplace spinlock with mutex/lock_guard in TSQueue
Stephen Seo [Sun, 18 Aug 2019 09:10:11 +0000 (18:10 +0900)]
Replace spinlock with mutex/lock_guard in TSQueue

5 years agoSome more work on cpp_impl (still WIP)
Stephen Seo [Thu, 25 Jul 2019 11:51:08 +0000 (20:51 +0900)]
Some more work on cpp_impl (still WIP)