Commit Graph

443 Commits

Author SHA1 Message Date
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
Coren[m]
e89dda5cea DHT.c:
- client_in_list: split loop in two to avoid inserting a client_id duplicate
- final pieces for IPv6 expansion: (handle_)sendnodes_ex(), called from hande_getnodes() resp. handler callback
2013-09-10 21:36:58 +02:00
Coren[m]
3ae7460853 util.*:
- added logging functions, default off

tox.h:
- added includes for sockaddr_in/6

network.c:
- added logging functions, default off (#define in util.h)
- IPv6: activating site-local all-nodes multicast address (i.e. IPv6 equivalent of broadcast)
2013-09-10 20:55:05 +02:00
Coren[m]
f267266bf6 fix: bad memset length in ip_init() 2013-09-10 17:38:53 +02: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]
bcf251ac31 group_chats.c:
- *->net->sock to *->net (like everywhere else :))
2013-09-09 21:37:07 +02:00
Coren[m]
b91b87f285 Merge branch 'master' into Integration 2013-09-09 21:31:11 +02:00
Coren[m]
05d7b157c6 tox.*, Messenger.*:
- initialisation: argument added to enable/disable ipv6 as socket

Messenger_test.c:
- initialisation: ipv4 hardcoded for now
- delegating IP resolution to DHT_bootstrap_ex()
2013-09-09 21:03:31 +02:00
irungentoo
1f5bfab327 Start of group chats integration into the core. 2013-09-09 14:44:43 -04:00
irungentoo
c137ec9d4d move group chats to /toxcore 2013-09-09 14:16:53 -04:00
Coren[m]
a77253c79b tox.*, DHT.*;
- second set of *_bootstrap_ex() functions to allow addresses instead of IPs

network.h:
- new message ID for sending/receiving IPv6 nodes

DHT.*:
- get_close_nodes():
  - additional parameter to select which kind of nodes: IPv4 or IPv6

- sendnodes()/handle_sendnodes():
  - the IPv4 message must remain intact even when the Node_format structure (which embeds IP_Port) is expanded
  - added Node4_format to keep the structure "alive"
  - copying in/out of wider to smaller format required in sendnodes()/handle_sendnodes()
  - switch of Node_format from Node4_format to Node46_format by define
2013-09-09 19:17:21 +02:00
Coren[m]
9a8dc575b7 - added missing include (autobuild warning) 2013-09-09 16:35:39 +02:00
Coren[m]
9439d296f1 caught by autobuild, missing net->sock to net change 2013-09-09 16:27:24 +02:00
Coren[m]
dbd75e903e network.*:
- IPAny_Port: analogous to IP_Port
- ipport_equal: moved from DHT.c and adapted

DHTc.:
- ipport_equal renamed to ip4port_equal
2013-09-09 16:12:50 +02:00
Coren[m]
180322293c network.h:
- added ipany_ntoa()

network.c:
- added ipany_ntoa()
- fixed formatting
2013-09-09 15:32:05 +02:00
Coren[m]
55214aa041 network.*:
- IP4: changed in_addr_t to struct in_addr for compatibility reasons
- IP6: added
- IPAny: added
- addr_resolve_or_parse_ip(): converts a string into an IPAny
2013-09-09 14:53:27 +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
Coren[m]
a128e3ff8f network.h:
- global: added sock_t
- Networking_Core: added family (currently always AF_INET) and port
- sendpacket(): changed signature to require (Networking_Core *) instead of sock_t

*.c:
- sendpacket()-calls: replaced *->net->sock with *->net
2013-09-09 13:56:03 +02:00
Jfreegman
7e84ba4606 wrong type 2013-09-09 07:14:47 -04:00
Jfreegman
5a1897162b a better way 2013-09-09 07:11:30 -04:00
Jfreegman
3853a30acf initialize name_length 2013-09-09 06:41:33 -04:00
Maxim Biro
f5bf852400 Removed friendstatus from client API 2013-09-07 16:05:16 -04:00
irungentoo
220fb72121 Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core 2013-09-07 13:28:33 -04:00
irungentoo
bdf31fc6b5 Added TODO list and made m_copy*_statusmessage functions return length of copied buffer on success. 2013-09-07 13:27:44 -04: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
irungentoo
64570a1b12 Fixed autotest, increased MAX_STATUSMESSAGE_LENGTH. 2013-09-06 09:56:56 -04:00
irungentoo
7ecd809a59 Added name lengths to friend names. 2013-09-06 09:45:39 -04:00
irungentoo
bb35305d94 Merge branch 'group-chats' 2013-09-05 17:02:23 -04:00
irungentoo
c78b2352ab Merge pull request #559 from jin-eld/friendlist
Function for retreiving a list of friend numbers
2013-09-04 15:37:13 -07:00
Jin^eLD
b9455efd84 Function for retreiving a list of friend numbers
This should allow clients to sync the Tox friend list with their UI/etc.
lists.
2013-09-05 01:30:28 +03:00
irungentoo
efea6b9e82 Possibly fixed LAN discovery on some configurations. 2013-09-04 15:14:11 -04:00
irungentoo
31f43799e1 Fixed small problem. 2013-09-04 07:26:30 -04:00
irungentoo
36ac8e461e Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core 2013-09-03 14:30:49 -04:00
irungentoo
01365342fc Possible bugs fixed, all received strings now force NULL terminate. 2013-09-03 14:28:14 -04:00
Jin^eLD
c7c1b92724 Remove error printouts
A library should never print anything, so removing the perror()
printouts.
2013-09-03 20:25:18 +03:00
irungentoo
c59975dd7e Work in progress group chats.
Not done yet.
2013-09-03 08:53:07 -04:00
irungentoo
b73ba8244a Removed useless code, possibly fixed something. 2013-09-02 16:52:09 -04:00
irungentoo
7e8a34bee9 Fixed possible segfaults from bad input. 2013-09-02 16:35:23 -04:00
irungentoo
a4bf25801d Merge branch 'master' of https://github.com/JamoBox/ProjectTox-Core into JamoBox-master 2013-09-02 15:59:28 -04:00
JamoBox
61880ab938 last of the comment refactoring from toxcore 2013-09-02 17:25:28 +01:00
JamoBox
7b944e9c65 comment updates 2013-09-02 17:12:02 +01:00
irungentoo
25480852ac Merge pull request #554 from nurupo/master
Fixed missing field initializer warnings
2013-09-02 08:59:46 -07:00
Maxim Biro
7c11070b32 Fixed missing field initializers warnings 2013-09-02 11:41:10 -04:00
irungentoo
3857720658 Fixed some warnings. 2013-09-02 11:41:06 -04:00
irungentoo
5233656561 Properly fixed signed/unsigned comparisons. 2013-09-02 09:55:37 -04:00
JamoBox
433cc9c8b2 Even more comment updates. 2013-09-02 13:41:43 +01:00
JamoBox
925f63f493 More comment refactoring. 2013-09-02 13:31:00 +01:00
JamoBox
55621e9cea More comment refactoring - DHT.c 2013-09-02 13:27:00 +01:00
Tyler Bunnell
36a3b02f63 Merge branch 'master' of github.com:tylerb/ProjectTox-Core 2013-09-01 20:43:03 -06:00
Tyler Bunnell
d1c52788c5 Fix signed/unsigned comparison warnings 2013-09-01 20:42:59 -06:00
irungentoo
a1099d7f95 Fixed possible bug. 2013-09-01 22:29:51 -04: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
9ef4bab51d Fixed bug. 2013-08-31 12:23:20 -04:00
irungentoo
a93980e144 Cleaned up pull request. 2013-08-30 21:13:40 -04:00
redwire
ecddafd383 Made clang happy by taking definitions for the macro out of functions and adding declarations 2013-08-30 22:08:15 -02:30
redwire
4247eec969 Wrote a quicksort macro and modified sort_list to use it 2013-08-30 18:10:00 -02:30
irungentoo
dcabd6421c Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core 2013-08-30 14:22:12 -04:00
irungentoo
52c47a0820 Fixed possible crash. 2013-08-30 14:11:12 -04:00
irungentoo
0bd4edc0db Compiler fix. 2013-08-30 12:59:17 -04:00
irungentoo
bbc6b09579 put free_connections() back 2013-08-30 12:54:35 -04:00
irungentoo
41d4e02ca4 Fixed possible compiling problems on some compilers. 2013-08-30 12:34:57 -04:00
stal
0834e4ba31 Fix build error on non-linux machines. 2013-08-30 09:25:22 -07:00
irungentoo
f124cfaf46 Return values checking for tox_array_push_ptr in Lossless UDP. 2013-08-30 09:12:22 -04:00
irungentoo
ba5bd35a12 Fixed possible bugs in tox_array. 2013-08-30 08:52:53 -04: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
Kostya
790867d984 Changed naming for IP union. 2013-08-30 03:02:11 -04:00
Kostya
8d71f67a72 Changed handshake code to use union IP_Port. 2013-08-30 02:58:30 -04:00
Kostya
d2d1af2ce9 Made IP_Port a union. 2013-08-30 02:51:15 -04:00
jin-eld
93e2e1eaa0 Sync makefile with source list
packets.h is now gone
2013-08-30 02:19:00 +03:00
irungentoo
0ed6ce80a0 Removed now useless file. 2013-08-29 19:09:30 -04:00
irungentoo
df4b1c6ee5 Removed packet structs.
They were causing problems on certain compiler configurations.
2013-08-29 19:06:09 -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
irungentoo
85940f94b2 Fixed bug. 2013-08-29 08:03:03 -04:00
irungentoo
1033c2d80e Fixed possible bug. 2013-08-28 20:51:01 -04:00
irungentoo
00507fadfd Removed some no longer needed ifdefs. 2013-08-28 18:23:37 -04:00
Anony Moose
31354d80d4 Fixed another thing in loop; added initialization for tox_array in lossless UDP. 2013-08-28 22:04:34 +00:00
Anony Moose
82a3eb9763
Fixed for loop counter errors. 2013-08-26 22:27:48 +00:00
Anony Moose
abaaef051c
Fixed several embarrassing errors and potential problems in tox_array. 2013-08-26 22:04:41 +00:00
Anony Moose
4e9d09f217 Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core into udp_connections 2013-08-26 21:02:34 +00:00
Anony Moose
fefa2bdea0 connection_id can be negative, so it shouldn't be uint32_t. 2013-08-26 20:36:32 +00:00
Anony Moose
79f759049b
Trying to fix memory leak. 2013-08-26 20:16:09 +00:00
jin-eld
ed1c130ebc Move extra libtool options into configure
This should allow to keep the libtool options all in one place and at
the same time define different options depending on the host.

Made sure that -no-undefined is set only on Win32. Although no side
effects on Linux and OSX have been observed so far, it's probably better
to play it safe; it does not seem to be needed/does not seem to matter on *nix,
only required for Win32.
2013-08-26 22:08:43 +03:00
jin-eld
634a67f627 Also generate a .dll in MinGW builds
Previously only static a static library was produced on MinGW builds,
this PR makes sure that we also build a proper .dll
2013-08-26 02:18:09 +03:00
Anony Moose
60bf9991b4 Made array stuff more readable. 2013-08-25 22:43:30 +00:00
Anony Moose
c23fbfa9f8
Removed commented code and fixed broken functions for Lossless_UDP tox_array. 2013-08-25 22:06:54 +00:00
Anony Moose
76761a605b Modified Lossless_UDP connections to work with tox_array. 2013-08-25 17:55:54 +00: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