Commit Graph

460 Commits

Author SHA1 Message Date
iphydf
dd8a568141
Make self_connection_status callback stateless.
**What are we doing?**

We are moving towards stateless callbacks. This means that when registering a
callback, you no longer pass a user data pointer. Instead, you pass a user data
pointer to tox_iterate. This pointer is threaded through the code, passed to
each callback. The callback can modify the data pointed at. An extra indirection
will be needed if the pointer itself can change.

**Why?**

Currently, callbacks are registered with a user data pointer. This means the
library has N pointers for N different callbacks. These pointers need to be
managed by the client code. Managing the lifetime of the pointee can be
difficult. In C++, it takes special effort to ensure that the lifetime of user
data extends at least beyond the lifetime of the Tox instance. For other
languages, the situation is much worse. Java and other garbage collected
languages may move objects in memory, so the pointers are not stable. Tox4j goes
through a lot of effort to make the Java/Scala user experience a pleasant one by
keeping a global array of Tox+userdata on the C++ side, and communicating via
protobufs. A Haskell FFI would have to do similarly complex tricks.

Stateless callbacks ensure that a user data pointer only needs to live during a
single function call. This means that the user code (or language runtime) can
move the data around at will, as long as it sets the new location in the
callback.

**How?**

We are doing this change one callback at a time. After each callback, we ensure
that everything still works as expected. This means the toxcore change will
require 15 Pull Requests.
2016-08-17 14:57:20 +01:00
iphydf
cebf64a588
Split toxcore into layers.
This allows us to more clearly define interfaces between modules, and have the
linker help us ensure that module boundaries are respected.

The onion/tcp/net_crypto layer is a bit too large. This is due to a cyclic
dependency (onion -> net_crypto -> TCP -> onion). We may or may not want to
break that cycle in the future to allow the onion library to exist on its own
without net_crypto.
2016-08-16 17:36:18 +01:00
iphydf
35932b5381
Add "make install" step to Travis build. 2016-08-12 20:49:50 +02:00
iphydf
f7324f997b
Only report coverage on clang, not on the GCC build. 2016-08-12 01:54:42 +01:00
iphydf
b5cfd33340
Add and use CMake build script
Also, fix the hstox build that was taking half an hour. It now takes 5 minutes.
Also, perform distcheck on travis to ensure that make dist works. It's not
actually failing the build at the moment due to broken tests.
2016-08-12 01:13:11 +01:00
iphydf
459f8f2013
Check code formatting on Travis.
We run astyle on Travis and check if there is a diff. The build terminates if
git finds a difference.
2016-08-12 01:00:00 +01:00
iphydf
8339e3449f
Run hstox test suite against toxcore on Travis. 2016-08-12 00:22:09 +01:00
iphydf
50921070ce
Move toxcore travis build scripts out of .travis.yml.
This is in preparation for having multiple types of build. One of the future
builds will be a hstox build, another may be frama-c or some other static
analyser. It makes sense to split these up into multiple builds, because each of
them can take a while, and running them in parallel will speed things up. Also,
the hstox test coverage should be reported separately from the toxcore auto_test
coverage.
2016-08-12 00:07:05 +01:00
Gregory Mullen (grayhatter)
6f3e689eeb
Fix a few issues with running Toxcore tests on Travis-CI
> increased the timeout for TCP tests because per @irungentoo the network on Travis-CI can be slow sometimes

> allowed groupchats test to restart on error until timeout This had to be done because current groupchats are fundamentally broken and 3/5 times they'll 'net-split' on connect

>> Drop group chat tests, add comment to the reason

> added some debugging information to TCP tests, and a #define to force IPV6 (Travis-CI only uses IPv4 on their containers) and decreased the itr interval

> Went crazy with timeouts for Tox network stuff on Travis. Tests on TCP will still randomly fail due to timeouts. I can't reproduce on any local system. So again per @irungentoo, Travis is slow, let's offer it a short bus.
2016-08-11 14:41:57 -07:00
LittleVulpix
88f29aaa9f Documentation: SysVInit workaround for <1024 ports
Update the manual to provide a command necessary to open <1024 ports for users on SysVinit
2016-07-11 11:34:32 +02:00
LittleVulpix
98446e0818 Documentation: SysVInit workaround for <1024 ports
Update the manual to provide a command necessary to open <1024 ports for users on SysVinit
2016-07-10 22:56:00 +02:00
iphydf
532435120a
Remove trailing whitespace from toxav.in.h. 2016-07-07 12:44:16 +02:00
iphydf
adc39b9ebd
Merge branch 'avswitch' of https://github.com/derivefh/toxcore 2016-07-07 12:42:58 +02:00
irungentoo
aafeb7ddd8
Merge branch 'make-dist' of https://github.com/roman-yepishev/toxcore 2016-03-13 22:07:50 -04:00
nobody
285dabdbc1 Updated to match current toxav.h 2016-03-09 01:22:15 +13:00
romik-g
c2b2142f33 Changes from @nurupo for build and runtime dependencies that reduce image size
Also removal of example bootstrap nodes from the config file in one line
2016-03-03 13:30:11 -05:00
romik-g
739975dc3d Re-format to reduce image file by 50% 2016-03-03 13:29:24 -05:00
Roman Yepishev
b0e720846f
Add missing files so that archive for make dist is complete 2016-02-26 22:58:13 -05:00
Ferdinand Thiessen
a8873ed4fd Fix #1520: Program returns random data in a function
Added default return to non void functions level_syslog and level_stdout.
2016-02-05 22:31:34 +01:00
Maxim Biro
c597f0786d Add missing newline 2016-01-24 01:33:53 -05:00
irungentoo
405854e1e7
Cleanups. 2016-01-04 22:48:58 -05:00
Maxim Biro
9d1efd5949 Change init.d to SysVinit 2016-01-02 18:55:53 -05:00
Maxim Biro
516d5ac09d Add information on how to update the bootstrap daemon 2016-01-02 18:46:52 -05:00
Maxim Biro
6c104b5fe3 Keep it in alphabetical order 2016-01-01 21:10:20 -05:00
Maxim Biro
f74d7c5ae6 Version bump 2016-01-01 20:29:24 -05:00
Maxim Biro
1b721ea1ec Add Dockerfile for the daemon 2016-01-01 20:29:24 -05:00
Maxim Biro
c22c06adbe Flush stdout output
Apparently when no tty is attached, which is the case for Docker, the
buffer size for stdout increases to the point that only half of the
entire log might be written.
2016-01-01 20:29:24 -05:00
Maxim Biro
5d9e40bbd3 Unify function comment style
Use doxygen java-style function comments already used in log.[c|h].
2016-01-01 20:29:24 -05:00
Maxim Biro
232488816e Fix license headers and file descriptions 2016-01-01 20:29:18 -05:00
Maxim Biro
d89fdb230b Fix include paths
They are relative to the Makefile instead of the source file itself,
which is unintuitive and is messing with my IDE.
2016-01-01 20:28:48 -05:00
Maxim Biro
da76da6c95 Remove dependency on files from testing directory
Also remove unneeded includes and refactor sleep define.
2016-01-01 00:55:09 -05:00
Maxim Biro
7d86caf51f Put command-line arguments related functions in a separate file 2016-01-01 00:36:57 -05:00
Maxim Biro
6b40a581b1 Put config-related functions in a separate file
bootstrap_node_packets.c was giving an error as it was being included
twice and there were no include guards, so part of it was split into
bootstrap_node_packets.h.
2016-01-01 00:19:35 -05:00
Maxim Biro
e1fc8c1d3c Add ability to run the daemon in foreground
Useful for things like a Docker container or just running it in the
terminal.

Complements the stdout logging option. This is actually why the stdout
logging was added in the first place -- to be used in the foreground
mode, though nothing stops one from using stdout in the background
mode, which one could redirect to a file.
2015-12-31 23:18:39 -05:00
Maxim Biro
2ef1ce9421 Fix wrong filename mentioned above license 2015-12-31 20:06:37 -05:00
Maxim Biro
ffa927fa36 Rename LOGGER_BACKEND to LOG_BACKEND 2015-12-31 20:01:24 -05:00
Maxim Biro
a40fd1bb6c Add ability to specify multiple command line arguments
Needed in order to specify which log backend to use.

Init scripts need to be updated to contain --config before the path to
the config file.
2015-12-31 19:58:34 -05:00
Maxim Biro
8c812f5341 Make daemon use the new log code
"log" is a reserved name (log from math.h), so it got changed into
write_log.
2015-12-31 02:44:44 -05:00
Maxim Biro
c50781a2b7 Make logger a global object instead of an instance
Passing Logger object into every function isn't fun. See for yourself:
something as simple as a public key printing function turns from
>void print_public_key(const uint8_t *public_key)
to
>void print_public_key(Logger *logger, const uint8_t *public_key)
2015-12-31 01:24:31 -05:00
Maxim Biro
bfc3c4eaac Add logger object to be able to support multiple logging backends 2015-12-30 23:43:04 -05:00
Maxim Biro
78d6e2d58b Change log levels
Some of them were set incorrectly, e.g. something that caused the
daemon to exit was marked as just a warning, instead of an error.

Removed debug level as it was hard to decide whether something should
go into info or debug. This is mostly because the use of the debug level
wasn't well defined. Debug should be used for information that could
help a user to debug an issue, but messages marked as debug were by the
most part the "success" log messages, which could go into info level
instead.
2015-12-30 21:49:00 -05:00
Eniz Vukovic
87828a1b42 Add synchronization protection for send_frame API functions 2015-10-24 01:56:49 +02:00
Eniz Vukovic
363771ea3c Fix typo and change logger config option 2015-10-13 00:35:46 +02:00
Eniz Vukovic
8f130b6f25 Remove old comment 2015-10-11 00:41:34 +02:00
Eniz Vukovic
d6fdf16520 New Adaptive BR algorithm, cleanups and fixes 2015-10-10 23:54:23 +02:00
mannol
c641b0fceb Updated with upstream 2015-08-09 12:39:21 +02:00
mannol
657a57b406 Fixed memory leak during session cleanup and fixed naming. 2015-08-07 02:04:04 +02:00
mannol
7d5de68364 Fixed CALL_STATE naming 2015-07-10 16:54:53 +02:00
mannol
dd0880af38 Fixed documentation. 2015-07-09 03:40:47 +02:00
irungentoo
970c2cccf3
Merge branch 'master' of https://github.com/JFreegman/toxcore 2015-07-08 21:15:22 -04:00
irungentoo
749a9330c4
Link changes. 2015-07-07 22:57:11 -04:00
Jfreegman
f3b65bc3dc
Fix a couple API doc mistakes 2015-07-07 02:05:45 -04:00
mannol
6c126e34e6 Implement handling capability change on rtp level 2015-06-30 01:41:38 +02:00
irungentoo
50e0802a62
Removed useless parameter from new_TCP_server() 2015-06-28 22:14:54 -04:00
mannol
2ecb71bb1e Renamed TOXAV_CALL_STATE to TOXAV_FRIEND_CALL_STATE 2015-06-27 17:28:07 +02:00
mannol
1ba55d0ca7 Added explanation about how audio callback works 2015-06-27 16:12:33 +02:00
mannol
08bc4eb0e0 Added payload turning off by setting bit rate to 0 2015-06-27 01:55:28 +02:00
mannol
f9f17fdf10 Merge remote-tracking branch 'upstream/master' into new_api 2015-06-25 00:58:23 +02:00
irungentoo
12663475bc
Merge branch 'typo' of https://github.com/zetok/ProjectTox-Core 2015-06-20 21:35:51 -04:00
irungentoo
022a3ec0d8
Merge branch 'doc' of https://github.com/zetok/ProjectTox-Core 2015-06-20 21:35:20 -04:00
Zetok Zalbavar
0536bf8fc4
Fix typo in readme: "enrironment" → "environment" 2015-06-20 18:54:37 +01:00
Zetok Zalbavar
68dc14f80c
Add real instruction on how to use APIDSL and astyle
also add to "tox{,.in}.h" note that "tox.h" shouldn't be edited directly,
pointing to "tox.in.h"
2015-06-20 01:22:46 +01:00
Zetok Zalbavar
4ffd5584f9
Improve documentation about tcp_port
Apparently it's not entirely clear that it's not needed in clients.

v2, as provided by @nurupo
2015-06-20 01:08:43 +01:00
mannol
979d7730aa Forgot about this 2015-06-05 22:18:21 +02:00
mannol
d694839d60 Rebased on master and removed alpha channel (again) 2015-06-05 22:14:37 +02:00
irungentoo
6d883f488f
Return error if file_id parameter is NULL. 2015-06-03 19:56:12 -04:00
irungentoo
5ea703c844
Comment fix. 2015-05-29 19:01:14 -04:00
irungentoo
29c37bf2f4
Fixed comment. 2015-05-28 11:37:24 -04:00
irungentoo
441e007362
tox_new returns NULL on failure. 2015-05-25 15:20:38 -04:00
irungentoo
8a32b3a12f
Merge branch 'bootstrapd-update2' of https://github.com/nurupo/InsertProjectNameHere 2015-05-24 21:00:45 -04:00
irungentoo
8e80ced6ce
Move savedata to options struct.
Add a way to select the type of savedata (normal savedata, load a
secret key, potentially others?) to load.
2015-05-22 18:23:56 -04:00
mannol
3100042a2b Updated with master 2015-05-22 23:22:31 +02:00
irungentoo
7315ad08dd
Merge branch 'tcp_server' 2015-05-20 15:52:03 -04:00
mannol
62c40af1a0 Added apidsl input file 2015-05-16 18:51:11 +02:00
irungentoo
06188e9818
Fixed segfault in tox-bootstrapd. 2015-05-13 10:45:16 -04:00
Maxim Biro
86cd3141d0 Updated daemon's systemd file, fixed typos in README
@arthurtiteica has pointed out that systemd has more suitable facilities for
creating a temporary directory for a PID file rather than calling  ExecStartPre,
which requires an absolute path to coreutils executables we used for creating a
directory and changing its owner, paths of which are are not universal across
distributions. Systemd can take care of it for us without need to provide
absolute paths, which is what we use here.
2015-05-10 03:04:42 -04:00
irungentoo
3a28a8c5fb
Added basic TCP server hosting to tox.h api.
TODO: tell friends we are hosting a relay and prioritize using relays
hosted by friends over bootstrap ones.
2015-05-08 22:03:24 -04:00
flan
045b510a14 fix useless use of cat 2015-04-26 09:57:50 +02:00
irungentoo
422e74424a
Switched tox.h to the dsl generated one.
Added input file to generate it.

Moved the astyle stuff to the astyle directory in other/.
2015-04-25 20:39:13 -04:00
Maxim Biro
14d942c1e1 Fixed incompatible pointer type warning 2015-02-07 20:35:51 -05:00
irungentoo
93b1c346fe
Merge branch 'master' of https://github.com/ray65536/toxcore 2015-02-06 20:49:11 -05:00
Eugene Lopatin
159df4b23c Documentation and service description for using tox-bootstrapd with
systemd
2015-02-05 12:43:24 +06:00
Urras
47cac28df4
Move OS X install script 2015-02-03 12:48:15 -05:00
Alexandre Erwin Ittner
ef0922cf9f Add script to generate save files with custom keys
Allow users to play with keys generated outside Tox core without
depending on features from any specific client. Just generate a
stub save file that every client will understand.
2015-02-01 12:23:14 -02:00
Maxim Biro
51b8ac8460 Replace hardcoded nodes with examples
Reverts Proplex'es change.
2015-01-25 18:31:44 -05:00
irungentoo
ee0f06937f
Check if key file was opened correctly in DHT_bootstrap.c
Warn the user if it wasn't.
2014-11-29 23:45:32 -05:00
irungentoo
6114bd7f3e
Merge branch 'tox-bootstrapd-network-error-handling' of https://github.com/nurupo/InsertProjectNameHere 2014-10-15 20:01:43 -04:00
Maxim Biro
e8d7763e92 Don't fail when the binary is not found
Per Debian Policy Manual, paragraph 9.3.2: Writing the scripts.
2014-10-14 14:14:06 -04:00
Maxim Biro
fd255ee6c5 Fixed a typo 2014-10-13 01:10:36 -04:00
Maxim Biro
2bdbc2bf1b Added some const-correctnessness 2014-10-13 00:59:00 -04:00
Maxim Biro
e677bbc89e Fixed a typo 2014-10-12 23:31:20 -04:00
Maxim Biro
1200e69a3f Added IPv4 fallback, made IPv6 and IPv4 fallback enabled by default 2014-10-12 23:22:25 -04:00
Maxim Biro
09302e8909 Free ports when there are no valid ones 2014-10-12 19:21:22 -04:00
irungentoo
0444ca18df
Merge branch 'master' of https://github.com/stqism/ToxCore 2014-10-11 18:59:09 -04:00
Sean Qureshi
2df986f6b9 Does a realloc with a size of 0 if every port is invalid 2014-10-10 18:23:23 -07:00
Sean Qureshi
532ace635a Enable IPv6, fix systemd PID bug 2014-10-10 18:09:52 -07:00
David Lohle
cc5453edbd Add working tox nodes
since the daemon is in the process of being packaged for easy deployment, it's probably best we have a working default config that extends existing nodes.
2014-10-06 03:16:55 -04:00
cgar
2bb2bc4163 spelling corrections 2014-09-09 20:31:37 -04:00
Maxim Biro
02f90fc604 Added .sh ending to bootstrapd's init script
Fixes some build issues.
2014-08-18 22:24:42 -04:00
Maxim Biro
d00c3c32d2 Fixed some warnings 2014-08-17 15:59:37 -04:00
Maxim Biro
504160ee57 Fixed daemon taking long time to stop 2014-08-17 02:17:03 -04:00
Maxim Biro
69e619bfa0 Renamed files for less confusion 2014-08-17 01:58:24 -04:00
Maxim Biro
ba7058c891 Made possible to run the daemon under its own user 2014-08-17 01:53:54 -04:00
Maxim Biro
e474a32e71 Made init.d script work with systemd 2014-08-17 00:12:35 -04:00
Maxim Biro
2040fc41d2 Renamed tox_bootstrap_daemon into tox-bootstrapd 2014-08-16 23:19:23 -04:00
irungentoo
e334188353
Merge branch 'fun-bootstrap-node-info' of https://github.com/nurupo/InsertProjectNameHere 2014-07-09 21:01:53 -04:00
Maxim Biro
5e1ae35034 Added a script to query DHT bootstrap node info 2014-07-09 14:00:16 -04:00
Maxim Biro
2037d27210 Fixed a case when public key contained null bytes 2014-06-20 23:10:12 -04:00
Maxim Biro
b85f192b79 Fixed sodium include 2014-06-20 22:28:33 -04:00
Maxim Biro
b9010540b6 Added strkey 2014-06-20 22:28:22 -04:00
irungentoo
5c87c7bf4a
Merge branch 'leak-rebase' of https://github.com/tux3/toxcore 2014-06-20 10:06:14 -04:00
Tux3 / Mlkj / !Lev.uXFMLA
727659673c Fix exceptional file leak in other/fun/sign.c 2014-06-20 12:42:03 +02:00
irungentoo
9b2d3e50b2
Merge branch 'bootstrap_daemon-leaks-1' of https://github.com/tux3/toxcore into tux3-bootstrap_daemon-leaks-1 2014-06-19 16:23:00 -04:00
Tux3 / Mlkj / !Lev.uXFMLA
4c12ee3e30 Fix scope, ressource leaks in boostrap daemon
Reduce scope of config_setting_t *elem

Fix various leaks of files keys_file and pid_file
2014-06-18 23:38:38 +02:00
irungentoo
881b2d900d
Fixed some warnings. 2014-06-15 20:49:39 -04:00
stal
83d4d8ea5d Install tox_bootstrap_daemon
I call on the venerable @jin_eld once again to verify that this change is correct.
2014-05-20 18:57:20 -07:00
Maxim Biro
286d8d9661 Made config file more consistent with default values 2014-05-18 21:04:42 -04:00
Maxim Biro
fe1694fa69 Added default ports to the .c file, included 33445 port 2014-05-18 19:59:01 -04:00
Maxim Biro
261a70353f Fixed a bug 2014-05-18 19:59:01 -04:00
Maxim Biro
8b5e3d5208 Allow multiple instances of the daemon 2014-05-18 19:58:57 -04:00
irungentoo
906969d376
Fixed out of bounds write. 2014-05-18 14:43:32 -04:00
Maxim Biro
7dd811214a Added MOTD functionality 2014-05-18 00:38:20 -04:00
Maxim Biro
e75930e72e Some small fixes 2014-05-17 21:49:57 -04:00
Maxim Biro
8be6b0986d Extracted min and max allowed port values into named constants 2014-05-17 21:49:51 -04:00
Maxim Biro
ceaeae8cff Added TCP server functionality 2014-05-17 20:36:16 -04:00
irungentoo
a26ced5fcb
Merge branch 'master' into TCP 2014-05-08 18:26:01 -04:00
irungentoo
2aa3cdfc69
Fixed the DHT bootstrap daemon. 2014-04-23 12:47:57 -04:00
irungentoo
0559904ea2
Updated some files so that they could build with latest core.
Fixed some issues.
2014-04-23 12:29:24 -04:00
Carlos E. Garcia
cf33c2f9ad multiple spelling fixes 2014-04-16 12:14:44 -04:00
irungentoo
6578d930f8
DHT_bootstrap.c now has TCP server functionality enabled.
Fixed a regression (same type as last commit).
2014-04-16 07:19:40 -04:00
irungentoo
b16af69d92
TCP_client pretty much done?
Now next step is integrating it in tox.

Added TCP server functionality to bootstrap server (define TCP_RELAY_ENABLED to enable it.)
2014-04-13 20:40:48 -04:00
Jin^eLD
70475d281d Fix NaCl builds for *BSD
From what I see there is a difference between *BSD and Linux when
linking vs. toxcore which has been bulit vs. the NaCl library:

on Linux it only links if NaCl's object files (i.e. randombytes.o) is
present in the linker options, however on *BSD systems this will cause a
linking error, see:
https://github.com/Tox/toxic/issues/31#issuecomment-38224441

This commit makes sure that we do not add the NaCl object files to our
pkg-config settings on *BSD, but do add them on Linux.
2014-03-23 02:05:57 +01:00
Maxim Biro
5a142bb697 Renamed dht server to dht node 2014-02-22 17:07:15 -05:00
irungentoo
d6e2f903a7 Added entry to TODO and a public key cracker (vanity key finder) to other/fun. 2014-02-10 19:53:44 -05:00
irungentoo
7a2ed25d36 Astyled and removed some useless files. 2014-02-09 09:43:16 -05:00
Maxim Biro
ecbceac341 Fixed memory leaks and removed repeated code 2014-02-09 02:01:04 -05:00
irungentoo
ad5d58b4a2 Added DHT bootstrap server info packets.
define DHT_SERVER_EXTRA_PACKETS to enable.
2014-02-01 18:45:37 -05:00
tawm
04580cf122 Fixed PID forgetfulness. 2014-01-30 15:56:45 -05:00
Maxim Biro
553472442f Shortened daemon's name 2014-01-25 21:00:31 -05:00
Maxim Biro
4782a8475a Made bootstrapping optional 2014-01-25 20:37:01 -05:00
Maxim Biro
b9ef9b91af Added more error checking 2014-01-25 20:00:34 -05:00
Sean
5eecd92f8e Update DHTservers 2014-01-21 22:53:59 -08:00
irungentoo
98043f4512 Updated DHT server list. 2014-01-21 10:20:02 -05:00
irungentoo
8421e44ffb Added updated bootstrap server. 2014-01-20 16:56:48 -05:00
irungentoo
15d01ca746 Updated DHT server list with onion supporting DHT servers.
Onionised DHT_test.
2014-01-20 15:20:17 -05:00
Maxim Biro
96767c170a Moved things around 2014-01-20 14:19:11 -05:00
Maxim Biro
b67d6bd024 Fixed missing cleanup 2014-01-20 14:09:20 -05:00
irungentoo
522f90fee1 Enabled onion in bootstrap_serverdaemon. 2014-01-20 13:05:34 -05:00
irungentoo
aff6b112c0 Merge branch 'onion' 2014-01-20 12:48:26 -05:00
Ben Iofel
174cec7f15 proper windows preprocessor detection 2014-01-19 19:30:14 -05:00
Maxim Biro
c3763cb708 Added .sh to the script 2014-01-19 17:21:24 -05:00
Maxim Biro
d8f2072ab5 Fixed function conflict 2014-01-19 15:27:29 -05:00
Maxim Biro
718b4415fc Fixed spelling 2014-01-19 15:09:57 -05:00
Maxim Biro
bffc3d96e5 Spellchecked everything 2014-01-19 14:14:25 -05:00
Maxim Biro
885e5898c5 Astyled the code 2014-01-19 13:53:18 -05:00
Maxim Biro
5a4756a6c0 Fixed build 2014-01-19 05:03:19 -05:00
Maxim Biro
8a80b5e0ac Fixed comments and variables' names 2014-01-19 04:57:46 -05:00
Maxim Biro
50ad4e84c5 Renamed to fix build process 2014-01-19 04:37:21 -05:00
Maxim Biro
f254f3aa1b Fixed some formatting 2014-01-19 04:37:20 -05:00
Maxim Biro
733916ea05 Tell github that README is a markdown file 2014-01-19 04:37:19 -05:00
Maxim Biro
28edc23329 Improved DHT bootstrap daemon
Supports "unlimited" number of bootstrap nodes in the config file, instead of
just 32.
PID and keys file paths are not limited by 512 chars anymore.
Doesn't read the whole list of bootstrap servers into a global datastructure
that just sits there after being processed once -- reads bootstrap servers
one by one, processing them between reads.
Supports IPv6.
Has an option for IPv6.
Supports LAN discovery.
Has an option for LAN discovery.
Writes to syslog.
Uses new functions introduced in the core.
`status` in the bash script now works.
Has a simple README, with instructions for Debian-based distros.
2014-01-19 04:34:58 -05:00
irungentoo
608330efef Onion servers are now DHT ready. 2014-01-17 14:00:00 -05:00
Jin^eLD
92e9ec6674 Always build DHT_bootstrap
DHT_bootstrap is not the same as DHT_bootstrap_serverdaemon, the latter
depends on libconfig and can be enabled/disable via a configure
parameter.

DHT_bootstrap has no dependencies and can always be built.
2013-12-20 18:42:54 +01:00
Coren[m]
0a4c3d7e2e Move unix_time(), id_cpy()/id_eq(), is_timeout() to util.*
unix_time():
- returns local value for current epoch
- value is updated explicitly with unix_time_update() called at new_DHT()/doMessenger()/do_DHT()

is_timeout():
- uses the local value for current epoch

id_cpy()/id_eq() => id_copy()/id_equal():
- centralized duplicate definitions
- replaced (most) memcpy()/memcmp() of (*, *, CLIENT_ID_SIZE) with id_copy()/id_equal()
2013-10-24 22:32:28 +02:00
Coren[m]
a0f08839bd Main: Eliminate TOX_ENABLE_IPV6 (then always on), CLIENT_ONETOONE_IP (then always off).
Additionally (besides cleanups):

network.h/tox.h:
- WIN32: fix a strange sa_family_t definition
- WIN32: define EWOULDBLOCK to WSAEWOULDBLOCK
- WIN32: kill macro for an existing function (IN6_ADDR_EQUAL)

network.c:
- use EWOULDBLOCK instead of EAGAIN (same value, but EWOULDBLOCK is more "popular")
- new_networking(): only try to enable IPv4-in-IPv6 if it's not already enabled per default
- inet_ntop()/inet_pton(): WIN32: remove partial initializers in favor of a simple memset()
- ip_equal(): WIN32: use an existing function
- logging: networking_wait_execute(): only dump result if not timeout
- logging: loglogdata(): kill an unused variable

LAN_discovery.c:
- send_broadcasts(): re-enabled, can only support IPv4 by principle, split into fetch_broadcast_info() (to fetch the addresses once) and send_broadcasts() (actual sending)

DHT.c:
- DHT_load_state_callback(): enclosed a fprintf(stderr, ...) into #ifdef DEBUG

Lossless_UDP.c:
- change_handshake(): harden against strange sa_family_t definitions

Messenger.c:
- logging: fix ID to string conversion

util.c:
- logging: eliminate a signed-warning
2013-10-20 16:56:12 +02:00
fr0sty
b0d2328968 Update DHT_bootstrap.c
Removed deprecated compilation instructions
2013-10-10 16:29:40 -04:00
BtbN
8d40ddf417 Some configuration/build fixes, so building basicaly everything else than the library can be disabled 2013-10-07 02:01:16 +02:00
irungentoo
12d1c5199b astyled everything. 2013-09-14 12:42:17 -04:00
Coren[m]
e67a11dd04 Merge remote-tracking branch 'upstream/master' into Integration 2013-09-13 09:06:52 +02:00
Coren[m]
b5db32585a Patch to allow DHT_bootstrap to also do LAN discovery.
This patch inserts LAN discovery in DHT_bootstrap, allowing it to find clients even if it's run parameterless (and clients don't connect to it directly, e.g. because the port is already bound to a different client).

- moves the #define of LAN_DISCOVERY_INTERVAL from Messenger.c to LAN_discovery.h
- includes LAN_discovery.h into DHT_bootstrap.c
- DHT_bootstrap.c sends and accepts LAN_discovery packets
2013-09-12 19:09:25 +02:00
Coren[m]
513e37815d tox.h, DHT.h:
- tox_bootstrap_ex(), DHT_bootstrap_ex() renamed to tox_bootstrap_from_address(), DHT_bootstrap_from_address()
- (handle_)sendnodes_ex() renamed to (handle_)sendnodes_ipv6()
- only sending sendnodes_ipv6() if we're actually IPv6 enabled
- changed comments to conform better

nTox.c, Messenger_text.c, DHT_test.c, DHT_bootstrap.c:
- fallout from *_ex() to *_from_address()

DHT_bootstrap.c:
- corrected a potentially wrong info message

util.c:
- fixed logfile name: now (funcptr) => now() (number)

network.c:
- addead comment about the necessity of bind() to succeed

auto_test/messenger_test.c:
- defaulting ipv6enabled to TOX_ENABLE_IPV6_DEFAULT

LAN_discovery.c:
- slight cleanup and comments for clarity
2013-09-11 20:50:15 +02:00
Coren[m]
d35fee43ba toxcore/util.h:
- moved cmdline_parsefor_ipv46() to testing/misc_tools.c
2013-09-11 15:19:39 +02:00
Coren[m]
85912418db cmdline parsing:
- add missing includes (autobuild warnings)
2013-09-11 10:54:47 +02:00
Coren[m]
5869057aba network.c:
- reset errno from failed bind() calls if the last one succeeds

DHT_bootstrap.c:
- move the perror() output next to where it belongs to
2013-09-11 00:44:05 +02:00
Coren[m]
0139f2838f Merge remote-tracking branch 'upstream/master' into Integration 2013-09-11 00:16:15 +02:00
Coren[m]
4cf0d857bc cmdline parsing of --ipv4/6 plucked into util 2013-09-11 00:14:20 +02:00
irungentoo
55499933be Fixed building with NaCl. 2013-09-10 17:15:26 -04:00
Coren[m]
8ba6a5ff5b Merge remote-tracking branch 'upstream/master' into Integration 2013-09-10 23:02:21 +02:00
Coren[m]
64ca4b5db2 tox.*, DHT.*:
- return to the caller if the string could be resolved into an IP

other/DHT_bootstrap.c, testing/*_test.c, testing/nTox.c:
- parse cmdline for --ipv4/--ipv6 switch to allow user a choice

util.h:
- proper old-style C-comment
2013-09-10 22:59:33 +02:00
irungentoo
23d8d26d50 Commented out useless function. 2013-09-10 16:22:47 -04:00
Coren[m]
bcb283cf45 big push, putting all the infrastructure in place behind TOX_ENABLE_IPV6 2013-09-10 16:36:20 +02:00
Coren[m]
291fa8d5c5 fix autobuild (not built locally) 2013-09-09 16:11:33 +02:00
Coren[m]
29d777ef67 network.h:
- IP: add in_addr_t as part of the union
- IP: rename IP to IP4
2013-09-09 14:16:40 +02:00
Jin^eLD
e092eee869 Allow to build vs nacl instead of libsodium
By default libsodium is used. Only if --enable-nacl is specified, then
nacl will be used instead of libsodium.

Pass locations of nacl headers and libraries by using the following
options:

--with-nacl-headers=/home/me/somewhere/nacl-20110221/build/469/include/amd64/
--with-nacl-libs=/home/me/somewhere/nacl-20110221/build/469/lib/amd64/
2013-09-06 22:54:45 +03:00
jin-eld
7d29bd23b9 Forward compatibility with automake 1.14
This update makes sure that the build still works with automake prior to
1.12 and at the same time does not give any warnings or errors with
automake 1.14
2013-09-01 20:39:02 +03:00
irungentoo
8f0bef5f20 Fixed warnings and moved hex_string_to_bin to testing/ 2013-08-30 08:16:34 -04:00
irungentoo
7441a234b7 Merge branch 'udp_connections' of https://github.com/vx-k/ProjectTox-Core into vx-k-udp_connections 2013-08-30 07:53:51 -04:00
Kostya
25563ac070 Fixed build errors. 2013-08-30 03:28:50 -04:00
Anony Moose
eb33796e58 Moved misc_tools from testing to toxcore. 2013-08-29 22:54:54 +00:00
irungentoo
ea994606fe Merge branch 'master' of https://github.com/JamoBox/ProjectTox-Core into JamoBox-master
Conflicts:
	toxcore/LAN_discovery.h
2013-08-29 17:55:58 -04:00
pete
82b8927af7 Correct a lot of the grammar and spelling. Also spent a few hours fixing the comments so they follow a standard. 2013-08-29 22:17:51 +01:00
Francis Devine
77e4d8509d Updated bootstrap node key for my server 2013-08-29 14:33:49 +12:00
jin-eld
1ec70337cf Remove cmake build system 2013-08-24 03:36:43 +03:00
jin-eld
50c8a820e5 Implemented autotools based build scripts
supported options:

--with-dependency-search=DIR    will tell configure to look for various
dependencies in DIR/include and DIR/lib

Alternatively you can also specify libsodium header and libs location
with --with-libsodium-headers and --with-libsodium-libs if it is
installed elsewhere.

Ncurses and libconfig are handled via the default pkg-config way, see
./configure --help=short for detailed information.

The tox library is compiled as libtoxcore in shared and static variants,
public headers are installed to ${prefix}/include/tox

A pkg-config libtoxcore.pc configuration file is provided.

Use ./configure --help for a full list of configure options or
./configure --help=short for the options that I added.

To generate the configure script after pulling from git use:
autoreconf -i

To generate a release tarball use:
make dist

Unit tests are handled by the libcheck library integration that is provided
by autotools, use:
make check

to compile and run the tests.

Unit tests are currently optional, i.e. - if the check library is not
found on the system, then tests will be disabled. Same goes for nTox and
DHT bootstrap daemon - they will be enabled or disabled depending on the
availability of ncurses (for nTox) or libconfig (for DHT bootstrap
daemon).

The above can be also tuned by:
--enable-tests / --disable-tests
--enable-ntox / --disable-ntox
--enable-dht-bootstrap-daemon / --disable-dht-bootstrap-daemon
2013-08-24 03:25:07 +03:00
jin-eld
e658892793 Rename core directory because of autoconf name clash
While doing the checks configure might generate "core" files and will
then try to remove them. Having a "core" directory generates an error
while runing the configure script.

There's no workaround but to rename the core directory.
2013-08-24 03:25:07 +03:00
irungentoo
9d3a8d94f2 New API done and tested.
Some stuff needs to be cleaned a bit though.
2013-08-23 10:26:52 -04:00
irungentoo
7719a9ed58 init_cryptopacket is now called by new_DHT. 2013-08-22 13:19:38 -04:00
irungentoo
c9a88607c2 Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core 2013-08-21 09:03:44 -04:00
irungentoo
da6416a584 Added signer/checker using ed25519 and libsodium I wrote for fun. 2013-08-21 09:02:49 -04:00
Maxim Biro
6a2569c432 Fixed DHTservers' path for Windows 2013-08-20 22:54:14 -04:00
irungentoo
128223d9d1 astyle --options=tools/astylerc -r ./*.{c,h} 2013-08-20 19:37:05 -04:00
irungentoo
86b11394b1 Fixed DHT_serverdaemon. 2013-08-20 17:25:17 -04:00
irungentoo
1fde3ce6aa DHT_bootstrap fixed. 2013-08-20 16:37:34 -04:00
irungentoo
ac621d96d3 Refactor of core done. 2013-08-20 14:47:32 -04:00
loadletter
e8b8dfebb3 Modified cmakefile to move the serverlist to the proper directory.
Tested on GNU/Linux.
2013-08-18 23:20:34 +02:00
Ayberk Yilmaz
5df77bdb14 Fixed broken build paths 2013-08-18 18:54:44 +03:00
d34th
89a644089c Added username replacer for appdata on c drive 2013-08-18 07:10:22 -04:00
Sean Qureshi
bdfd890aa8 Added mac support to the standardized data file, cleaned up a bit 2013-08-18 03:41:30 -07:00
Sean Qureshi
ab830825bd Added windows support to the standarized location 2013-08-18 03:12:55 -07:00
Sean Qureshi
31e29c46c5 Added more selectable dht servers 2013-08-18 03:06:25 -07:00
Sean Qureshi
86596a6d7f Makes cmake install DHTservers to its new place 2013-08-18 03:03:46 -07:00
irungentoo
88ff81d9de Passed everything through astyle. 2013-08-16 13:11:09 -04:00
Javier Maldonado
8a56f9cb37 Added new server 2013-08-15 05:31:08 +00:00
irungentoo
566295037f Added logo in readme to repo. 2013-08-14 12:35:55 -04:00
irungentoo
c0d5fe9b5b Merge pull request #423 from JFreegman/master
Auto-connect toxic to DHT on startup
2013-08-11 07:40:07 -07:00
irungentoo
8e05bcb5f9 Merge pull request #422 from slvr/crypto-speed-boost
Cryptography speed boost
2013-08-10 16:20:54 -07:00
Jfreegman
2694fc8d13 auto-connect to DHT on startup 2013-08-10 15:46:29 -04:00
slvr
021852d494 Implemented encrypt_data_fast, decrypt_data_fast and crypto tests 2013-08-10 17:41:32 +01:00
slvr
448d0124cd networking_poll: DHT_bootstrap_daemon 2013-08-10 00:49:20 +01:00
slvr
6052b1f119 network_registerhandler 2013-08-10 00:43:50 +01:00
plutooo
3d916b35f2 core: getaddrinfo() lookup error handling 2013-08-01 11:54:06 -07:00
irungentoo
7252456c87 Merge pull request #171 from AMDmi3/freebsd-fixes
FreeBSD fixes
2013-07-31 04:46:12 -07:00
Joseph Quadrino
9f6be0ce4b stat file before attempting to open 2013-07-31 03:07:51 -04:00
Dmitry Marakasov
89dd7ed011 Add detection of required libraries 2013-07-31 06:15:26 +04:00
teknocrat
b1ec17a357 Merge branch 'patch-1' of https://github.com/Teknocrat/ProjectTox-Core into patch-1 2013-07-30 19:29:33 -05:00
Teknocrat
7803acc375 Create FindLibConfig.cmake
Warning, this is a google snippet, but works fine, shouldn't be an issue
2013-07-30 19:12:29 -05:00
Teknocrat
4faa145789 Update CMakeLists.txt
This thing requires libconfig but doesn't test for it...
2013-07-30 19:09:36 -05:00
NemDiggers
69980e3c0c Remind users that directory isn't actually legit 2013-07-30 19:09:29 -04:00
irungentoo
b1726f55ed Merge branch 'master' of https://github.com/nurupo/InsertProjectNameHere into nurupo-master
Conflicts:
	testing/CMakeLists.txt
2013-07-30 07:31:51 -04:00
Maxim Biro
1d8f6e94e7 Fixed formatting of some cmake files 2013-07-29 20:45:53 -04:00
Astonex
5ad33e7398 Essentially nTox without the ncurses for Windows. Slightly modified main() 2013-07-29 23:00:56 +01:00
Konstantin Kowalski
b3fa1fc8f4 [fixed]created new files misc_tools.(c|h) and moved hex_string_to_bin() there. 2013-07-27 12:10:41 -04:00
Konstantin Kowalski
a1b93c397c took out several strlen() calls out of the loop; replaced int's with size_t where needed 2013-07-26 16:16:58 -04:00
SilentSand
f377eb9ca2 Licensing
Added the GPLv3 license to some files in addition to fixing some
comments at the beginning of the files.
2013-07-25 21:45:56 -04:00
irungentoo
3b53bc3218 Merge pull request #96 from tawm/master
Make the bootstrap daemon configurable
2013-07-23 17:31:08 -07:00
Maxim Biro
ea550d4c86 Some cleanup 2013-07-23 12:23:17 -04:00
Tom Bartelt
87aad78c87 removed silly test 2013-07-23 06:58:28 -04:00
Tom Bartelt
6f6db8abc0 removed useless header 2013-07-23 06:43:41 -04:00
Tom Bartelt
06eb768a57 Updated server.cfg 2013-07-23 06:39:49 -04:00
Tom Bartelt
ea49be0e95 Fixed a tiny bug 2013-07-23 06:38:35 -04:00
Tom Bartelt
f1ea6024cf renamed init script 2013-07-23 06:32:42 -04:00
Tom Bartelt
9f6f3117bb Update daemon to use config files 2013-07-23 06:28:47 -04:00
Tom Bartelt
413c5810e1 Add libconfig to the build process 2013-07-23 06:25:47 -04:00
Tom Bartelt
a11fa54fa2 Added config file 2013-07-23 06:02:08 -04:00
irungentoo
53b58a4c82 Print the defined port. 2013-07-22 16:06:36 -04:00
irungentoo
cca045b4a2 Merge pull request #90 from NemDiggers/master
Print port just because
2013-07-22 13:05:57 -07:00
NemDiggers
fec1fe8577 Print port just because 2013-07-22 16:02:57 -04:00
irungentoo
4504011117 Fixed build. 2013-07-22 15:49:15 -04:00
irungentoo
485d5eee67 Merge pull request #89 from nurupo/master
Some DHT bootstrap improvements
2013-07-22 12:38:11 -07:00
irungentoo
8e43282fa9 Bootstrap servers now route friend requests. 2013-07-22 15:36:13 -04:00