Commit Graph

15 Commits

Author SHA1 Message Date
Lioncash
30e7ab94fa Common/TraversalProto: Move interface into Common namespace
Gets the types out of the global namespace.
2023-04-24 08:53:14 -04:00
Pierre Bourdon
f4e34703c0
licensing: convert "public domain" to CC0 1.0
Public domain does not have an internationally agreed upon definition,
As such it's generally preferred to use an extremely liberal license,
which can explicitly list the rights granted by the copyright holder.
The CC0 license is the usual choice here.

This "relicensing" is done without hunting down copyright holders, since
it is presumed that their release of this work into the public domain
authorizes us to redistribute this code under any other license of our
choosing.
2021-07-05 04:43:55 +02:00
Lioncash
d2ea94195c TraversalProto: Convert TraversalPacketType into an enum class
Makes for strong typing and prevents namespace pollution.
2021-01-20 12:24:05 -05:00
Lioncash
2f0fb2056e TraversalProto: Convert TraversalConnectFailedReason into an enum class 2021-01-20 12:24:05 -05:00
Michael M
916a97b869 TraversalServer: use C++ <chrono> instead of gettimeofday 2019-05-10 21:33:26 +02:00
Techjar
ff972e3673 Reformat repo to clang-format 7.0 rules 2019-05-06 18:48:04 +00:00
Lioncash
189d277cfc Common/Random: Add convenience template for simple arithmetic values
In cases where we just want a random value for a primitive arithmetic
type, we can wrap this in a template to allow convenient direct
assignment instead of keeping declaration and initialization separate
(making it more difficult to use values uninitialized). This also allows
the use of Common::Random with functions such as std::generate, making
it more flexible in how random values can be generated.
2018-06-14 10:31:13 -04:00
Léo Lam
fff1db9730 Common: Add Random utilities
This makes it easier to generate random numbers or fill a buffer with
random data in a cryptographically secure way.

This also replaces existing usages of RNG functions in the codebase:

* <random> is pretty hard to use correctly, and std::random_device does
  not give enough guarantees about its results (it's
  implementation-defined, non cryptographically secure and could be
  deterministic on some platforms).
  Doing things correctly is error prone and verbose.

* rand() is terrible and should not be used especially in crypto code.
2018-05-31 17:54:43 +02:00
Pierre Bourdon
9e0739f5e5 traversal: add systemd watchdog support 2018-03-08 06:10:17 +00:00
Chris Burgener
4669b50e0b Turn Off Debug Mode for Traversal Server 2017-02-25 23:41:12 -05:00
Pierre Bourdon
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
mathieui
4b06e92731 A few more asterisks, mostly casts 2016-01-21 22:20:22 +01:00
comex
5fff97f3f4 Fix printf width in TraversalServer. 2015-04-13 02:26:52 -04:00
Rohit Nirmal
48ec42d4a0 Core: Change NULLs to nullptrs. 2015-03-14 20:20:41 -05:00
Ziek
779f275486 Added TraversalServer.cpp to Core/Common 2015-02-25 18:28:27 -08:00