Commit Graph

763 Commits

Author SHA1 Message Date
irungentoo
3c64c87ea7
dns3_test now automatically does the DNS request.
tox_decrypt_dns3_TXT no longer needs id_record to be null terminated.
2014-06-19 10:50:46 -04:00
irungentoo
d6a9ce3175
Fixed some issues in toxdns and added a test.
Added request_id.

request_id must be obtained with tox_generate_dns3_string, stored,
then passed to tox_decrypt_dns3_TXT when we want to decrypt the
received response.
2014-06-14 11:31:56 -04:00
irungentoo
c49d74a125
Attempt fix of tox_sync not building on some systems. 2014-06-13 05:38:19 -04:00
irungentoo
07936960df
Astyle and fixes. 2014-06-10 18:35:55 -04:00
Marc Schütz
99d5940140 Const correctness in various interdependent files 2014-06-10 20:54:48 +02:00
irungentoo
7a11c10429
Fixed some nTox bugs. 2014-06-08 09:21:37 -04:00
liuguangzhao
9aa28c10b8 fix nTox cmdline input slow problem. 2014-06-08 14:08:52 +00:00
irungentoo
1bad0b5eea
Fixed TOX_MAX_MESSAGE_LENGTH define.
Removed some useless code from toxcore.

Astyled core code with new version of astyle.
2014-06-01 18:55:52 -04:00
Maxim Biro
24c6db5968 Fixed the undefined reference to pow error 2014-05-31 13:16:08 -04:00
irungentoo
89bf08287d
Renamed tox_do_run_interval to tox_do_interval.
tox_do_interval now returns a time in ms based on how much action
is going on in net_crypto.
2014-05-30 23:01:17 -04:00
irungentoo
0e814904e4
Replaced tox_wait* functions with tox_do_run_interval().
Build system fixes.
2014-05-30 13:20:36 -04:00
irungentoo
ec25f64407
Fixed Tox sync. 2014-05-28 18:27:35 -04:00
irungentoo
8e24771fc4
Remove Lossless UDP (This breaks Tox.) 2014-05-02 10:36:48 -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
irungentoo
9c6a8432ce Crypto related cleanups.
Moved Bunch of functions from net_crypto to crypto_core.

decrypt_data_fast and decrypt_data_symmetric were the same thing
therefore, removed decrypt_data_fast.

Replaced all the crypto_secretbox_* defines with the equivalent
crypto_box_* one.

New define: crypto_box_KEYBYTES that is equal to
crypto_box_BEFORENMBYTES.
2014-04-21 16:51:36 -04:00
irungentoo
4f1e02bafa
tox_group_get_names now returns a list of name lengths along with the list of names.
TCP test now also tests pings.
2014-03-31 20:37:03 -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
irungentoo
f7beb70fe9 nTox fixes.
Added TOX_MAX_MESSAGE_LENGTH to tox.h
2014-03-18 20:45:03 -04:00
irungentoo
5770a0e29a Merge branch 'api-fix'
Main changes:
1. Strings no longer need to be NULL terminated.
2. tox_get_friend_id is now named tox_get_friend_number.
3. The friend request callback function is now (Tox *tox, uint8_t *,
uint8_t *, uint16_t, void *), the Tox object pointer has been added to
it.
2014-03-18 20:02:50 -04:00
irungentoo
5babb281c0 Friend request callback now contains the Tox object. 2014-03-16 13:24:39 -04:00
Kelong Cong
a13de8b105 updated compilation and execution instructions for Lossless UDP tests, and fixed minor typos 2014-03-12 21:40:52 +00:00
seshagiriprabhu
9bb27fbea6 bound checking in messenger testing 2014-02-25 22:18:27 +05:30
seshagiriprabhu
bcb393d336 Added bound checking for friend ID input in DHT test 2014-02-25 21:21:21 +05:30
Maxim Biro
5a142bb697 Renamed dht server to dht node 2014-02-22 17:07:15 -05:00
irungentoo
554afe11d7 Some api changes. 2014-02-21 11:38:04 -05:00
irungentoo
7a2ed25d36 Astyled and removed some useless files. 2014-02-09 09:43:16 -05:00
Maxim Biro
3782213b6e Fixed build 2014-02-09 03:22:24 -05:00
Maxim Biro
ecbceac341 Fixed memory leaks and removed repeated code 2014-02-09 02:01:04 -05:00
Maxim Biro
5fad72b910 Modified hex_string_to_bin 2014-02-09 00:58:15 -05:00
irungentoo
15d01ca746 Updated DHT server list with onion supporting DHT servers.
Onionised DHT_test.
2014-01-20 15:20:17 -05:00
Ben Iofel
174cec7f15 proper windows preprocessor detection 2014-01-19 19:30:14 -05:00
irungentoo
a6d5a54c79 Fixed ntox building on windows. 2013-12-19 12:36:51 -05:00
irungentoo
15d17b0a3c Astyled the code. 2013-12-16 20:49:24 -05:00
irungentoo
7cd43ecc76 Merge branch 'master' into harden 2013-12-06 22:51:17 -05:00
AZ Huang
2cb7f24132 Fix typo. 2013-11-29 23:38:06 +08:00
AZ Huang
8419d3469a Fix API name consistency. 2013-11-29 23:12:07 +08:00
AZ Huang
eec31edb1c Fix return code inconsistency. 2013-11-29 18:26:09 +08:00
Coren[m]
26fef7cf9a
Various changes to nTox including a potential crash (also possible from remote!), and a tiny change to toxcore.
Crash stuff:

nTox.c:
- do_refresh(): avoid crashes (input a "%" and the client goes "boom!", send someone a string with embedded "%" and see him blow up...)

Other stuff:

toxcore: tox.h (doc.)/network.c (code):
- networking_wait_prepare(): return -1 if lenptr was NULL and therefore not settable

nTox.c:
- fraddr_to_str(): function to convert a TOX_FRIEND_ADDRESS into a segmented (and therefore line-breakable) string
- print_friendlist(): print index of friend on name line, print id on 2nd line
- command /f: skip spaces (and +) inside a friend id
- command /r (new): "/r #" to remove a friend
- main(): reduce cpu consumption if we're not currently sending files
2013-11-27 21:00:23 +01:00
Coren[m]
a204b95c51
Print a more detailed message on CHAT_CHANGE_PEER_DEL, so a user isn't confounded by the change of peer numbers.
On deleting the last peer, it's just a delete.
On deleting any other peer, the last peer is moved into that space, gaining a different number.
Print that detail where appropriate.
2013-11-26 18:55:11 +01:00
Coren[m]
e85e9dbb99
group_namelistchange(): for ui reasons, divulge the peernumber and the nature of the change (add, del, name change).
tox.*, Messenger.*, group_chats.*:
- expand interface of callback by peernumber/change

groupchats.c:
- call callback in addpeer/delpeer/setnick with peernumber and flag

nTox.c:
- print_groupchatpeers(): print as many names on a line as possible, not one peer per line
- print_groupnamelistchange(): only print the change, if possible (i.e. "new peer", "peer's new name")
- added command "/p" to print the list of peers
2013-11-24 21:12:26 +01:00
irungentoo
f21a9a7666 Added callback that tells you when the peer name list of a group chat changes. 2013-11-23 17:19:02 -05:00
irungentoo
d2b56faded Added function to get the number of peers and list of names for group chats. 2013-11-22 23:31:55 -05:00
Coren[m]
ca621bd440
Wrapping: Expanded space of output to be a bit larger than input. Basic wrap(): Embed continuation markers if there's enough space. 2013-11-14 02:45:37 +01:00
Coren[m]
bde536f6bc
Add a "conversation mode", where you set your conversation partner once and then all non-commands are sent as message to them.
/cf # rsp. /cg # sets, /cr resets target

Also reformatted display of sent group message slightly to look less beta-ish.
Then using "#<num>" for group number vs. "<num>" for friend/peer numbers.
Also changed to a slightly different message on people without name.
2013-11-13 22:34:02 +01:00
irungentoo
244c625e51 Merge branch 'group_peername' of https://github.com/FullName/ProjectTox-Core into FullName-group_peername 2013-11-12 19:41:52 -05:00
Coren[m]
6d31a9be7e
Group chat: Add a nickname message. Remove strange default nickname. (Seriously...)
group_chats.*:
- group_send_nick() to send own name
- setnick() to store a received name

Messenger.c:
- group_send_nick() before group_sendmessage() (in regular intervals, to inform new peers)

nTox.c:
- print_groupmessage(): on error or on a name of length zero the result of tox_group_peername() isn't null-terminated, catch that
2013-11-12 19:57:01 +01:00
Coren[m]
e457eb6635
Undo faulty newlines, undo extra newlines. 2013-11-12 14:17:48 +01:00
Coren[m]
553aba0498
nTox.c:
- multiple places: tox_getname() doesn't terminate the string, make sure nTox does
- format_message():
.  - renamed to print_formatted_message()
.  - changed semantics: does the new_line() itself, saves caller from freeing the buffer (which no caller did)
.  - changed signature: now also prints the friend's name when sending
.  - intern: date is only printed once, the message line gets only time
- print_message(): enforce null termination
- main():
.  - setlocale() to init locale (for date/time printing)
.  - own name: ensure null termination

Messenger.c:
- notify of friend name change *before* the old name is overwritten
2013-11-11 15:25:54 +01:00
irungentoo
4943054742 Fixed small issues.
DHT_test now only prints non zero entries.
2013-11-10 17:57:24 -05:00
irungentoo
ce29937b8d Added more printing to DHT_test, fixed typo. 2013-11-10 14:55:36 -05:00
Coren[m]
4993928888
Started as a simple bugfix for wrap(), expanded to more detailed help.
nTox.c:
- flag[]: additional flag for special wrapping
- help expanded and split (to keep below 256 chars)
- new_lines_mark(): stores flag for special wrapping
- print_friendlist():
.  - extracted pattern for output
.  - added length of id string allocation
.  - replaced '\t' with '+ ', wrappers don't account for '\t'
- line_eval():
.  - removed a few do_refresh() directly after a new_lines() (calls do_refresh() at its end)
.  - 'h' (help): parsing of an additional character for f(riend) or g(roup)
- wrap():
.  - the major bugfix:
.    - no more endless looping if the input had a substring with no spaces
.      for more than line_width (e.g. ID of 78 and window smaller than 78)
- wrap_bars(): wrap() for "rich" messages, honors embedded '\n', breaks preferable at '|'
- print_help(): listed all options and added explanations
- print_invite(): fixed minuscule typo
- main(): made print_help() reachable again

nTox.h:
- majorly cut down to what is really needed
2013-11-10 19:06:17 +01:00
irungentoo
8e0ab68d30 Removed define that could become confusing. 2013-10-24 13:34:04 -04:00
irungentoo
55dececf90 Code cleanups.
Fixed some tests.
2013-10-23 14:49:59 -04:00
irungentoo
9303c18b0c Merge branch 'Cleanup-defines' of https://github.com/FullName/ProjectTox-Core into FullName-Cleanup-defines 2013-10-20 15:12:46 -04: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
Antonio Montes
de696c1db6 Removed unnecessary #if 2013-10-19 11:34:41 -07:00
Antonio Montes
3df81b07f3 fixed build errors on windows 2013-10-19 11:14:03 -07:00
Jin^eLD
07d334bbe3 Do not build tox_sync on win32 2013-10-16 18:03:33 +02:00
mannol
5bc2560904 tox A/V: integration of A/V code into tox
Also-by: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
2013-10-13 16:40:15 +02:00
irungentoo
4aa507b664 Added function to get the piece size for sending files. 2013-10-08 18:55:35 -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
6ef2b5ead6 Code cleanups. 2013-10-06 17:40:23 -04:00
irungentoo
97f192969c Fixed warnings. 2013-10-05 11:24:30 -04:00
irungentoo
ac117322a9 Tox sync added.
Tox sync is a proof of concept bittorrent sync inspired application that
uses tox to sync the contents of two folders.

Currently only works on POSIX compilant operating systems.
2013-10-05 11:14:06 -04:00
irungentoo
fbd494a8b4 File sending added to public api. 2013-10-02 20:53:24 -04:00
irungentoo
6425cf3b53 File control packets can now be used by the person sending the file. 2013-10-02 20:08:14 -04:00
irungentoo
6182af8449 nTox updated with changes in core, some file sending things fixes. 2013-10-01 18:59:33 -04:00
irungentoo
3c7de51ba5 Basic ntox file sending. 2013-09-30 13:13:49 -04:00
irungentoo
0e318af9e2 Merge branch 'ClientData46' of https://github.com/FullName/ProjectTox-Core into FullName-ClientData46 2013-09-27 21:10:34 -04:00
Coren[m]
6fe25e4f6f Permit -Wshadow as useful warning. 2013-09-27 11:24:33 +02:00
Coren[m]
9de295374d expanded Client_data to hold two addresses (IPv4, IPv6) instead of one
Compilerflag: CLIENT_ONETOONE_IP (to define in DHT.h, default unset i.e. NEW case: two addresses)

Every function in DHT{_test}.c working on Client_data has been rewritten to store IPv4 addresses in assoc4, IPv6 addresses in assoc6.
Loading/Storing of states defined with other compiler switch is transparently adjusting to the differences.

DHT.h, DHT.c:
- introduction and handling of the structure changes

DHT_test.c, Messenger.c:
- logging adapted to new structures

util.h:
- LOGGING isn't undefined per default anymore
2013-09-27 03:27:52 +02:00
irungentoo
83c6e9dd35 Fixed the connection bug and cleaned up some stuff. 2013-09-22 11:08:23 -04:00
irungentoo
3e4599e33a Lossless UDP is now suitable for sending files.
Added some actual flow control and made send/recieve buffers grow when
necessary.
2013-09-21 09:03:54 -04:00
Coren[m]
330c1bee5c nTox: keep bootstrap()ping every 10 seconds, until we get a connection running (the initial one might get lost, it IS done via UDP after all)
nTox.c:
- main(): keep calling tox_bootstrap_from_address() every 10 seconds, until the connection is established
2013-09-21 02:02:27 +02:00
irungentoo
d2b9b059ba Forgot an else. 2013-09-18 11:19:32 -04:00
irungentoo
1a9ee5c95f Fixed bad code in nTox. 2013-09-18 11:11:10 -04:00
irungentoo
5a83c1296c astyled everything. 2013-09-17 16:28:39 -04:00
irungentoo
dd12d464de Functions to get name of peer in group chat added.
Group message callback modified.
2013-09-16 20:59:53 -04:00
Coren[m]
ab2805a23b Fix warnings of -Wall -Wextra 2013-09-16 10:37:22 +02:00
Coren[m]
6d3ac937af Merge remote-tracking branch 'upstream/master' into nTox 2013-09-15 19:07:54 +02:00
irungentoo
dde98eb345 DHT peer finding for new friends should now be slightly faster.
Also fixed the "[i] could not send message" bug in nTox.
2013-09-14 20:38:48 -04:00
irungentoo
20a8fb8a23 Fixed warnings. 2013-09-14 19:15:26 -04:00
irungentoo
12d1c5199b astyled everything. 2013-09-14 12:42:17 -04:00
Coren[m]
0db05eca49 Save datafile when adding a friend/accepting a friend request.
(Note to self: make clean is your friend. Those extra seconds are well spent.)
2013-09-14 18:39:59 +02:00
Coren[m]
f2ad7fd4ea Rename load_old_key_or_save_new_one() to load_data_or_init(). 2013-09-13 09:20:03 +02:00
Coren[m]
484615e67d Made (load_/save_)data() functions static. 2013-09-13 09:16:48 +02:00
Coren[m]
cbd575f7a0 Merge remote-tracking branch 'upstream/master' into nTox 2013-09-13 09:14:21 +02:00
Coren[m]
e67a11dd04 Merge remote-tracking branch 'upstream/master' into Integration 2013-09-13 09:06:52 +02:00
irungentoo
f8b979a92a Put group chat functions in the public API.
Group chats are not complete, they seem to work very well though.

This means that the functions will change.
2013-09-12 20:29:30 -04:00
irungentoo
91d7f4857f Very basic group chats, tested and working with nTox.
Please wait until the tox.h API is updated before integrating it into
your clients.

nTox:
/g
creates a new group chat

/i friendnum groupnum
invite friendnum to groupnum

/z groupnum message
send message to groupnum

NOTE: group chats currenly might not handle packet loss well if there are less than 6 participants.
2013-09-12 19:26:30 -04:00
Coren[m]
591d6c70c6 network.*:
- addr_resolv(_or_parse_ip)(): added an optional parameter to return both an IPv6 and an IPv4 address if requested address family was AF_UNSPEC
- logging of unhandled packets

DHT.c:
- bootstrap_from_address(): use the additional return from addr_resolv_or_parse_ip() to bootstrap in both network types at once

Lossless_UDP_testclient.c:
- main(): adapt to signature change of addr_resolve()

Messenger.c. LAN_discovery.h:
- lost a htons(), readded
- moved LAN_DISCOVERY_INTERVAL #define into LAN_discovery.h

LAN_discovery.c:
- added IPv4-in-IPv6 local address test
2013-09-12 18:39:21 +02:00
Coren[m]
a74cfaea81 tox.h:
- #define'd tox's network port (as range)
- finally killed tox_new_ex() in favor of changing tox_new()'s signature
- renamed tox_bootstrap() to tox_bootstrap_from_ip()

network.h:
- #define'd tox's network port (as range)
- renamed SEND_NODES_EX to SEND_NODES_IPV6
- bind() loop uses #define'd port range

DHT.c:
- renamed SEND_NODES_EX to SEND_NODES_IPV6
- sending ipv6 node addresses even if can't use them ourselves

nTox.c:
- adapted to changed tox_new()
2013-09-12 15:42:03 +02:00
Coren[m]
20f865521a nTox.c:
- correct a message who claims we're going to exit when we actually aren't
- don't treat a failed close on reading the data file as failure of the reading
2013-09-12 14:19:22 +02:00
Coren[m]
d017189bb6 nTox.c:
- don't claim "Added friend" per default, check for returned ID first
- on '/q' SAVE... else everything but the keys is lost on each restart
- for that, split load_key() into load_data() and save_data()
- announce own nickname on startup
2013-09-12 00:01:46 +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]
d0f5ad34ae cleanup TravisCI warnings (missing exports/extraneous args to printf) 2013-09-11 16:57:26 +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]
4cf0d857bc cmdline parsing of --ipv4/6 plucked into util 2013-09-11 00:14:20 +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
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]
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
c137ec9d4d move group chats to /toxcore 2013-09-09 14:16:53 -04:00
irungentoo
00c9c8ab57 More stuff done in group chats. 2013-09-09 13:52:03 -04: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
irungentoo
0d41d7f9c0 Messaging now works in group chats. 2013-09-08 20:48:52 -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
cc8a536cb0 Base of group chats seems to be working now. 2013-09-05 17:00:41 -04:00
irungentoo
c59975dd7e Work in progress group chats.
Not done yet.
2013-09-03 08:53:07 -04:00
jin-eld
4cb969344c Add forgoten source to the dist target 2013-09-01 21:44:26 +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
059d2cfdb8 Use defines instead of numbers in DHT_test 2013-08-28 20:53:35 -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
jin-eld
14a8ee4e0d Make nTox work on MinGW/Win32 2013-08-27 14:25:09 +03:00
Anony Moose
abaaef051c
Fixed several embarrassing errors and potential problems in tox_array. 2013-08-26 22:04:41 +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
Anony Moose
76761a605b Modified Lossless_UDP connections to work with tox_array. 2013-08-25 17:55:54 +00:00
Anony Moose
9a7f7b5ec4 Added array for loop. 2013-08-24 21:45:45 +00:00
Anony Moose
ae3ab2efa4
Some more style changes 2013-08-24 20:54:03 +00:00
Anony Moose
39101b00a2
Fixed style in several macros. 2013-08-24 20:52:20 +00:00
Anony Moose
4326c4c8b5
Fixed semantics of tox_array (should also be more memory efficient). 2013-08-24 20:34:38 +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
irungentoo
0f77a2d131 Added tox_ to 2 typedefs. 2013-08-23 10:34:10 -04: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
4d89d63c3f Removed useless and broken tests. 2013-08-23 06:40:30 -04:00
irungentoo
9eddeb0fd3 Merge pull request #517 from stqism/screw-nTox_win32
Removed nTox_win32
2013-08-23 03:35:06 -07:00
Sean Qureshi
97aef1442d Removed nTox_win32 2013-08-23 03:30:56 -07:00
jin-eld
c759967ad4 Remove toxic from core repository
New location is:
https://github.com/Tox/toxic
2013-08-23 11:31:38 +03:00
Manuel Argüelles
7ffa4017aa Make wide character support optional
Issue #514. FindCursesw modified to make it simpler. Wide character
can be disable by passing NO_WIDECHAR=ON.
2013-08-22 15:57:34 -05:00
irungentoo
7719a9ed58 init_cryptopacket is now called by new_DHT. 2013-08-22 13:19:38 -04:00
irungentoo
f249084772 Merge pull request #512 from manuel-arguelles/toxic_unicode
Add wide char support in toxic (issue #440)
2013-08-21 16:08:10 -07:00
Manuel Argüelles
d5e96fe670 Remove fix_name() function
With unicode support this function is not longer valid.
2013-08-21 16:24:33 -05:00
Manuel Argüelles
93789396b1 Add wide char support in toxic (issue #440)
Set current locale, use of get_wch instead of getch for reading, use
wctomb and friends to convert back from wchar_t, link with
cursesw. Unicode support is only added to chat windows.
2013-08-21 16:19:35 -05:00
Manuel Argüelles
d840e8a743 Add cmake module for ncursesw
Default Curses module fails to detect the wide char version of curses
when both are installed. Current module should do better.
2013-08-21 16:11:07 -05:00
Sanket Parmar
155823e7ce Fixed segfault and added support for single quotes in toxic 2013-08-21 23:27:34 +05:30
irungentoo
128223d9d1 astyle --options=tools/astylerc -r ./*.{c,h} 2013-08-20 19:37:05 -04:00
irungentoo
c7aafcfb4c Lossless UDP tests fixed. 2013-08-20 19:20:42 -04:00
Simon Levermann
6adbefab2b Use the messenger's dht instead of creating a new one 2013-08-20 23:08:14 +02:00
Simon Levermann
ffa01f8def Merge remote-tracking branch 'upstream/refactor' into refactor 2013-08-20 22:46:39 +02:00
irungentoo
1fde3ce6aa DHT_bootstrap fixed. 2013-08-20 16:37:34 -04:00
Simon Levermann
4f1dfa476a Fix Messenger_test 2013-08-20 22:36:22 +02:00
Simon Levermann
4ade191677 Remove timer test, fix CMake files to respect this change 2013-08-20 22:32:07 +02:00
irungentoo
747c290269 Fixed DHT_test.c and added some checks. 2013-08-20 15:53:15 -04:00
irungentoo
2f66b31244 nTox and cmake fixed. 2013-08-20 15:28:16 -04:00
irungentoo
ac621d96d3 Refactor of core done. 2013-08-20 14:47:32 -04:00
irungentoo
a1c40d753e More refactoring done. 2013-08-20 12:08:55 -04:00
Michael Rose
7f5591615d fixed space handling in commands (issue #495) 2013-08-20 13:40:15 +02:00
Jfreegman
22f766860f fix tab bar bugs 2013-08-19 16:59:24 -04:00
Jfreegman
2f4f81981d fix tab bar bugs 2013-08-19 16:55:04 -04:00
Michael Rose
0aabb5bc49 Merge with upstream 2013-08-19 14:40:15 +02:00
Michael Rose
d6ae8dce98 fix potential memory issue 2013-08-19 10:19:57 +02:00
Michael Rose
c2561cd67b fix define checks 2013-08-19 09:23:40 +02:00
irungentoo
b8bf05250c Merge pull request #491 from loadletter/master
Store data and DHTservers in .config/tox
2013-08-18 17:08:35 -07:00
Frederik Holden
29b61c574b Made configdir check XDG_CONFIG_HOME for config dir 2013-08-19 01:21:36 +02:00
loadletter
adac62560d Use configdir.c instead of hardcoded paths for the list of DHT servers. 2013-08-18 23:16:39 +02:00
Michael Rose
a3c985533c fix OS check in toxic 2013-08-18 21:12:54 +02:00
irungentoo
93104d1203 Fixed stack problem. 2013-08-18 11:59:34 -04:00
irungentoo
558a80f1c3 Merge branch 'tox-bugs' of https://github.com/stqism/ToxCore into stqism-tox-bugs 2013-08-18 10:19:35 -04:00
Sean Qureshi
af12267c77 Fixed toxic not running 2013-08-18 05:34:50 -07:00
Sean Qureshi
a5882f0433 No longer assumes Minix/BSD/AIX users actually use Macs when assigning a default name 2013-08-18 03:44:52 -07: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
c3d90c6764 Added mac support with data, standarized data 2013-08-18 03:25:18 -07:00
Sean Qureshi
ab830825bd Added windows support to the standarized location 2013-08-18 03:12:55 -07:00
Sean Qureshi
1986e6b7f4 Ran it through astyle 2013-08-18 01:48:36 -07:00
Aaron Lipinski
146f6ac645 remove callback introduced temporarily during refactoring 2013-08-18 20:35:38 +12:00
Aaron Lipinski
a87804cf01 reduce number of windows, use consistent naming 2013-08-18 20:35:37 +12:00
Aaron Lipinski
1e4f9802fb remove WINDOW_STATUS, simplify adding and selecting chat windows 2013-08-18 20:26:39 +12:00
Sean Qureshi
c91e459364 Might improve windows detection 2013-08-17 20:57:35 -07:00
Sean Qureshi
ebe4a3f8d0 Added more colors 2013-08-17 19:43:10 -07:00
Sean Qureshi
91ae38450c Standarized DHTservers 2013-08-17 19:26:31 -07:00
Michael Rose
d1d24c123d Messenger stores / loads nickname
new toxic command to show nickname (mynick)
2013-08-17 11:59:28 +02:00
irungentoo
88ff81d9de Passed everything through astyle. 2013-08-16 13:11:09 -04:00
irungentoo
b15230583c Fixed loading and a small problem with the length of crypto requests. 2013-08-15 20:56:22 -04:00
irungentoo
36cb9b003d Merge branch 'master' of https://github.com/rose-m/ProjectTox-Core into rose-m-master 2013-08-15 19:59:43 -04:00
Maxim Biro
d93b5e2cb8 Fixed function agruments according to new API 2013-08-15 19:45:03 -04:00
Maxim Biro
bc15b106a9 Commented out nTox_win32 2013-08-15 19:12:55 -04:00
irungentoo
575804d19f Small improvement to DHT. Useless file removed. Small fix to toxic. 2013-08-15 14:24:32 -04:00
Michael Rose
76bfefff6f Merge fix 2013-08-15 12:11:48 +02:00
Aaron Lipinski
bf6c04b2ca add dhtstatus window 2013-08-15 12:02:57 +12:00
Aaron Lipinski
1e190c97b8 add dhtstatus file 2013-08-15 12:02:57 +12:00
Aaron Lipinski
e9f15d3879 refresh windows after resize 2013-08-15 12:02:56 +12:00
irungentoo
26a01e92ec Merge branch 'master' of https://github.com/irungentoo/ProjectTox-Core 2013-08-14 18:26:17 -04:00
irungentoo
4330bfbf87 Metadata collection prevention part 1 of ???.
Crypto requests packets are packets that can be routed by nodes in the
DHT. In this pull request I have merged both Natping requests and friend
requests into one common packet (Crypto request packets). Both these
packets should now only be distinguishable by the size of the data in
them to an outside observer for an example on how to send and recieve
data with these packets see: friend_requests.c

Note that these packets are prefixed with id 32 (friend request packets)
which means this change is compatible with the currently running DHT
bootstrap servers.

Also changed small thing in DHT_test.c
2013-08-14 18:26:00 -04:00
Jfreegman
aa114d2778 small bug fixes 2013-08-14 16:02:21 -04:00
naxuroqa
1b2ac061ec Fix for another segfault/leak case when using -f arg 2013-08-14 19:21:36 +02:00
Manuel Argüelles
2196fb8bc8 Fix segfault when using -f in toxic
Call strdup() to the data file argument string to avoid segmentation
fault when it is later freed.
2013-08-14 10:40:26 -05:00
irungentoo
0e0785c822 Merge branch 'patch-6' of https://github.com/Astonex/ProjectTox-Core into pr 2013-08-14 09:00:55 -04:00
irungentoo
4ddd91b580 Fixed small compile error on my end. 2013-08-14 08:56:29 -04:00
irungentoo
661adacddf Merge branch 'remove_externs' of https://github.com/krisl/ProjectTox-Core into pr 2013-08-14 08:51:52 -04:00
Aaron Lipinski
4946c809d7 remove temporary callbacks from refactoring 2013-08-15 00:36:31 +12:00
Aaron Lipinski
1edb7c1660 move windows functions to its own file 2013-08-15 00:36:30 +12:00
Aaron Lipinski
75ce48146a remove externs in favor of includes 2013-08-15 00:36:30 +12:00
Aaron Lipinski
3f37c5580d add header guard and includes to windows.h 2013-08-15 00:36:30 +12:00
irungentoo
9fb82fc3bf Merge branch 'master' of https://github.com/naxuroqa/ProjectTox-Core into pr 2013-08-14 08:35:43 -04:00
Aaron Lipinski
4e21ac0d57 prefer param over static
Conflicts:
	testing/toxic/main.c
2013-08-15 00:34:22 +12:00
Astonex
1260aee9e1 Update prompt.c
Make id uppercase.
2013-08-14 11:23:38 +01:00
Aaron Lipinski
3b42f489e4 Have toxic handle new no-spam values from friend request 2013-08-14 21:16:58 +12:00
naxuroqa
72ee99e848 rewrite of get_id function 2013-08-14 10:44:57 +02:00
irungentoo
f93e23e411 Updated some files. 2013-08-13 11:50:33 -04:00
irungentoo
97f449a2f1 Fixed spam problem. (I broke the API so this will not build)
The friend address is what the byte string that you give away for people
to add you will be called.

1. Every friend address now contains a number set by the friend. This is
to prevent someone from randomly spamming people in the DHT with friend
requests and makes it so you need the person to actually give you the
address in some way to send the friend request. This number is expected
to be encrypted with the friend request. All requests that do not
contain this number will be rejected. This means the spammer can no
longer use the DHT to collect lists of valid addresses to spam. It also
enables users to quickly change the number in case a spammer gets hold
of the address and starts spamming it.

2. A 2 byte checksum will be added (not implemented yet) to prevent
people from accidentally adding random strings as friends. (NOTE that
this has nothing to do with the spam problem I just decided to add a
placeholder for it now.)
2013-08-13 09:32:31 -04:00
irungentoo
8fe1dec5d6 Fixed merge problem and set better default names. 2013-08-13 07:39:04 -04:00
irungentoo
d0cd78fbea Merge branch 'master' of https://github.com/JFreegman/ProjectTox-Core into JFreegman-master 2013-08-13 07:20:36 -04:00
irungentoo
cb4f67b37a Merge pull request #441 from slvr/timer
Timer Subsystem
2013-08-13 04:14:01 -07:00
slvr
4bfeb2f483 timer_new -> new_timer and timer_delete -> delete_timer to avoid name conflict 2013-08-13 09:45:11 +01:00
Andreas Schneider
6b06431e9b core: Fix a possible buffer overflow using getself_name().
If the passed buffer is smaller than MAX_NAME_LENGTH then, you
will probably overflow it.
2013-08-13 09:50:51 +02:00
Andreas Schneider
6b256ffdb4 toxic: Fix get_user_config_dir(). 2013-08-13 09:50:42 +02:00
Jfreegman
5c0da43d19 unresolved addresses fail silently 2013-08-12 22:34:08 -04:00
Jfreegman
0ac4f1fcb3 auto-connect errors verbose 2013-08-12 22:04:07 -04:00
Jfreegman
92029baff1 put a bunch of repeated code into a function and added timestamps to status/nick changes 2013-08-12 20:28:43 -04:00
Jfreegman
565a348ceb minor improvements and bug fixes 2013-08-12 19:50:50 -04:00
slvr
be840b46b9 Merge remote-tracking branch 'upstream/master' into timer
Conflicts:
	core/Messenger.c
2013-08-12 23:08:48 +01:00
irungentoo
f9bfb42504 Merge pull request #439 from Alek900/master
Added support for userdata in callbacks
2013-08-12 13:33:20 -07:00
irungentoo
107e4b8a5e Merge pull request #437 from JFreegman/master
make connection more robust for toxic
2013-08-12 08:13:33 -07:00
alek900
8d3e68b74d Added support for userdata in callbacks 2013-08-12 14:23:46 +02:00
slvr
1a39c397c5 Implemented Deadline Timer and timer_test 2013-08-12 13:08:03 +01:00
Jfreegman
d87b79d368 a little overkill 2013-08-12 05:59:08 -04:00
Chris Hall
4293c4b1e6 Messenger refactor - redid work from pull request 79
Moves static state out of Messenger.c and into a Messenger struct
Purely stylistic, no functional changes were made.

This commit also changed all the callers of Messenger as they now have
to pass an instance of the Messenger struct to messenger functions.

Also removed some uses of the 'static' keyword at the beginning of
function definitions when the function was already declared static, as
these caused gcc to whine.
2013-08-12 21:37:38 +12:00
Jfreegman
46209d958f make connection more robust 2013-08-12 03:10:47 -04:00
Maxim Biro
440871bda1 Fixed warnings on Windows 2013-08-11 14:17:02 -04:00
Simon Levermann
a34403e33b Fix a possible memory leak 2013-08-11 17:51:10 +02: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
Jfreegman
2c2d608e29 potential seg fault 2013-08-11 00:55:09 -04:00
lukechampine
1139ca57a5 make argument handling (esp. of strings) more robust 2013-08-10 20:10:03 -04:00
irungentoo
8e05bcb5f9 Merge pull request #422 from slvr/crypto-speed-boost
Cryptography speed boost
2013-08-10 16:20:54 -07:00
Jfreegman
56df7e556e was making the ID change on every startup 2013-08-10 18:00:54 -04:00
Jfreegman
401cbeff37 fix memory leak 2013-08-10 16:28:40 -04:00
Jfreegman
216efc91a5 don't need that 2013-08-10 15:50:49 -04:00
Jfreegman
2694fc8d13 auto-connect to DHT on startup 2013-08-10 15:46:29 -04:00
slvr
acca5c8e8f Added crypto_speed_test 2013-08-10 18:06:51 +01:00
slvr
7f27fcaf37 tabs -> spaces 2013-08-10 11:27:36 +01:00
slvr
6052b1f119 network_registerhandler 2013-08-10 00:43:50 +01:00
Christian Brueffer
0b9adb1f26 Kill EOF whitespace. 2013-08-09 20:46:17 +02:00
irungentoo
44902d15a7 Merge pull request #409 from lukechampine/betterprompt
make toxic handle input in a more sane manner
2013-08-09 09:29:56 -07:00
Konstantin Kowalski
fa6fd7566b Added headers to fix build errors. 2013-08-09 15:54:14 +00:00
Konstantin Kowalski
4f2ecd20e9 Minor style changes. 2013-08-09 15:45:34 +00:00
Konstantin Kowalski
5f41c30d66 Moved long comments to wiki. 2013-08-09 15:44:22 +00:00
Konstantin Kowalski
1033d897ca Added arrays. 2013-08-09 15:38:21 +00:00
Konstantin Kowalski
fdb3e194ba Added INFO() debugging macro. 2013-08-09 15:35:19 +00:00
Luke Champine
b378a246a0 make toxic handle input in a more sane manner 2013-08-09 10:31:29 -04:00
irungentoo
8542b5bac8 Merge pull request #407 from JFreegman/master
fixed chat window text wrapping in toxic
2013-08-09 05:35:01 -07:00
Christian Brueffer
0b8fa72914 Fix a recurring typo in code and comments. 2013-08-09 14:01:35 +02:00
Jfreegman
9910115b4e fixed chat window text wrapping 2013-08-09 00:25:45 -04:00