Skip to content

Commit

Permalink
Remove deprecated ToxDNS
Browse files Browse the repository at this point in the history
Based on #331.

Fixes #42.
  • Loading branch information
iphydf committed Dec 29, 2017
1 parent f2b6090 commit 2c8fb05
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 533 deletions.
18 changes: 5 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# - A number of small libraries (.a/.so/...) containing independent components
# of toxcore. E.g. the DHT has its own library, and the system/network
# abstractions are in their own library as well. These libraries are not
# installed on `make install`. The toxdns, toxav, and toxencryptsave
# libraries are also not installed.
# installed on `make install`. The toxav, and toxencryptsave libraries are
# also not installed.
# - A number of small programs, statically linked if possible.
# - One big library containing all of the toxcore, toxav, toxdns, and
# toxencryptsave code.
# - One big library containing all of the toxcore, toxav, and toxencryptsave
# code.
#
################################################################################

Expand Down Expand Up @@ -328,15 +328,10 @@ endif()

################################################################################
#
# :: ToxDNS and block encryption libraries
# :: Block encryption libraries
#
################################################################################

add_submodule(toxcore toxdns
toxdns/toxdns.c)
target_link_modules(toxdns toxnetwork)
set(toxdns_API_HEADERS ${toxcore_SOURCE_DIR}/toxdns/toxdns.h^tox)

apidsl(toxencryptsave/toxencryptsave.api.h)
add_submodule(toxcore toxencryptsave
toxencryptsave/toxencryptsave.c
Expand Down Expand Up @@ -570,9 +565,6 @@ target_link_modules(DHT_test toxdht)
add_c_executable(Messenger_test testing/Messenger_test.c)
target_link_modules(Messenger_test toxmessenger)

add_c_executable(dns3_test testing/dns3_test.c)
target_link_modules(dns3_test toxdns)

if(NOT WIN32)
add_c_executable(tox_sync testing/tox_sync.c)
target_link_modules(tox_sync toxcore)
Expand Down
2 changes: 0 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ If it worked, you should have all the toxcore dylibs in /usr/local/lib: (besides
$ ls -la /usr/local/lib/libtox*.dylib
libtoxav.0.dylib
libtoxcore.0.dylib
libtoxdns.0.dylib
libtoxencryptsave.0.dylib
to check what CPU architecture they're compiled for:
$ lipo -i /usr/local/lib/libtoxencryptsave.0.dylib
Expand Down Expand Up @@ -414,7 +413,6 @@ mkdir tmp
cd tmp
$WINDOWS_TOOLCHAIN-ar x ../lib/libtoxcore.a
$WINDOWS_TOOLCHAIN-ar x ../lib/libtoxav.a
$WINDOWS_TOOLCHAIN-ar x ../lib/libtoxdns.a
$WINDOWS_TOOLCHAIN-ar x ../lib/libtoxencryptsave.a
$WINDOWS_TOOLCHAIN-gcc -Wl,--export-all-symbols -Wl,--out-implib=libtox.dll.a -shared -o libtox.dll *.o ../lib/*.a /usr/$WINDOWS_TOOLCHAIN/lib/libwinpthread.a -liphlpapi -lws2_32 -static-libgcc
```
Expand Down
1 change: 0 additions & 1 deletion build/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ LT_LDFLAGS=-avoid-version
endif

include ../toxcore/Makefile.inc
include ../toxdns/Makefile.inc
include ../toxencryptsave/Makefile.inc
include ../toxav/Makefile.inc
include ../other/Makefile.inc
Expand Down
2 changes: 1 addition & 1 deletion libtoxcore.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Name: libtoxcore
Description: Tox protocol library
Requires:
Version: @PACKAGE_VERSION@
Libs: @NACL_OBJECTS_PKGCONFIG@ -L${libdir} -ltoxcore @NACL_LDFLAGS@ -ltoxdns -ltoxencryptsave @NACL_LIBS@ @LIBS@ @MATH_LDFLAGS@ @PTHREAD_LDFLAGS@
Libs: @NACL_OBJECTS_PKGCONFIG@ -L${libdir} -ltoxcore @NACL_LDFLAGS@ -ltoxencryptsave @NACL_LIBS@ @LIBS@ @MATH_LDFLAGS@ @PTHREAD_LDFLAGS@
Cflags: -I${includedir}
2 changes: 1 addition & 1 deletion other/astyle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This directory can house various tools and utilities.

Run from ``toxcore`` directory:
```bash
astyle --options=./other/astyle/astylerc ./toxcore/*.c ./toxcore/*.h ./toxdns/*.c ./toxdns/*.h ./testing/*.c ./toxav/*.c ./toxav/*.h ./other/*.c ./other/bootstrap_daemon/*.c ./toxencryptsave/*.c ./toxencryptsave/*.h ./auto_tests/*.c
astyle --options=./other/astyle/astylerc ./toxcore/*.c ./toxcore/*.h ./testing/*.c ./toxav/*.c ./toxav/*.h ./other/*.c ./other/bootstrap_daemon/*.c ./toxencryptsave/*.c ./toxencryptsave/*.h ./auto_tests/*.c
```

### For selected file
Expand Down
20 changes: 1 addition & 19 deletions testing/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ endif
if BUILD_TESTING

noinst_PROGRAMS += DHT_test \
Messenger_test \
dns3_test
Messenger_test

DHT_test_SOURCES = ../testing/DHT_test.c

Expand Down Expand Up @@ -56,23 +55,6 @@ Messenger_test_LDADD = $(LIBSODIUM_LDFLAGS) \



dns3_test_SOURCES = \
../testing/dns3_test.c

dns3_test_CFLAGS = \
$(LIBSODIUM_CFLAGS) \
$(NACL_CFLAGS)

dns3_test_LDADD = \
$(LIBSODIUM_LDFLAGS) \
$(NACL_LDFLAGS) \
libtoxdns.la \
libtoxcore.la \
$(LIBSODIUM_LIBS) \
$(NACL_OBJECTS) \
$(NACL_LIBS) \
$(WINSOCK2_LIBS)

if !WIN32

noinst_PROGRAMS += tox_sync
Expand Down
106 changes: 0 additions & 106 deletions testing/dns3_test.c

This file was deleted.

14 changes: 0 additions & 14 deletions toxcore/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,20 +1411,6 @@ Socket net_socket(int domain, int type, int protocol)
return socket(platform_domain, platform_type, platform_prot);
}

/* TODO: Remove, when tox DNS support will be removed.
* Used only by dns3_test.c
*/
size_t net_sendto_ip4(Socket sock, const char *buf, size_t n, IP_Port ip_port)
{
struct sockaddr_in target;
size_t addrsize = sizeof(target);
target.sin_family = make_family(ip_port.ip.family);
target.sin_port = net_htons(ip_port.port);
fill_addr4(ip_port.ip.ip4, &target.sin_addr);

return (size_t)sendto(sock, buf, n, 0, (struct sockaddr *)&target, addrsize);
}

uint32_t net_htonl(uint32_t hostlong)
{
return htonl(hostlong);
Expand Down
2 changes: 0 additions & 2 deletions toxcore/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,6 @@ void net_freeipport(IP_Port *ip_ports);
*/
int bind_to_port(Socket sock, int family, uint16_t port);

size_t net_sendto_ip4(Socket sock, const char *buf, size_t n, IP_Port ip_port);

/* Initialize networking.
* bind to ip and port.
* ip must be in network order EX: 127.0.0.1 = (7F000001).
Expand Down
35 changes: 0 additions & 35 deletions toxdns/Makefile.inc

This file was deleted.

Loading

0 comments on commit 2c8fb05

Please sign in to comment.