gdr / tuntox (public) (License: GPLv3) (since 2017-01-24) (hash sha1)
Tunnel TCP connections over the Tox protocol
List of commits:
Subject Hash Author Date (UTC)
Got rid of the memory leak 4e3d5e48fe25648a182dc7f67f4f49e4d8471ebf GDR! 2014-12-30 13:38:43
Removed old comments 870624e91fa526f5eeb0d699f8a33a43ff7af4a1 GDR! 2014-12-28 14:35:41
Debian init script added 86e70ffe9f835b12667d296f2df9c307ba1aff06 GDR! 2014-12-24 16:26:51
Forking/setuid/pidfile working e98c42e6712f16b60ade4f2f996b25001394da4d GDR! 2014-12-24 16:07:35
Added syslog capability 53bfa010d3ee7a0c79e4c9155e189431eeafb208 GDR! 2014-12-24 14:59:40
Clean target 4280af5e82fad6296d3581a5f62700da34ccd3ea GDR! 2014-12-24 14:35:07
Version string 325ae4c314482d10fe46c5c16c2b581959af2f41 GDR! 2014-12-24 14:28:13
Fixed callbacks on raspbian 7324419faf44b59072633a76db24a8e612460c8f GDR! 2014-12-22 02:23:21
Logging framework and command line options b8c1f1cf062ff681daf160411ad6c35ed7a49d42 GDR! 2014-12-22 02:22:38
Fixed warning on implicit function declaration 575ea150208b7ca61a639d0c9a20df656d2b178f GDR! 2014-12-22 00:52:53
Trying to make the calling convention problem go away 1fb0fae11b2d129dd380b6413e5e81d461c8806d GDR! 2014-12-22 00:52:27
Increased number of send retries - helpful on flaky links 3f86c8bb935408fdfb056a412da23b6b181d0755 GDR! 2014-12-13 18:13:12
Tokssh formatted 489cad267d4537cbe20f4c539f49a2d96ed6d0bb GDR! 2014-12-13 17:50:07
Added tokssh wrapper script 967a260e4fb84659424e9b81cc7f6318380ae02d GDR! 2014-12-13 17:49:14
More robust connection algorithm 4f28d0b194fdd9607955f2e32de44f8fbf5d7d31 GDR! 2014-12-13 17:24:39
Added -lrt for old glibc versions like raspbian 9f66ecc193b1bca4eac19f178123215340c9cb14 GDR! 2014-12-13 17:24:10
Pipe mode working, yay! 99a66836911b804dce1455580cbf75dc99f23538 GDR! 2014-12-11 22:27:26
Added MSG_NOSIGNAL to send() in client c9f51df320380a537843145ebbf4ceff7ef1c561 GDR! 2014-12-11 21:33:27
Fixed a warning and printing garbage 925a7c2bdf93c3a0209552285b77e2e585a799c4 GDR! 2014-12-11 21:31:49
Fixed a warning and printing garbage f7f5170d00ee10affcacf569842207120a7ab16d GDR! 2014-12-11 21:30:51
Commit 4e3d5e48fe25648a182dc7f67f4f49e4d8471ebf - Got rid of the memory leak
It's made possible by the new toxcore API
Author: GDR!
Author date (UTC): 2014-12-30 13:38
Committer name: GDR!
Committer date (UTC): 2014-12-30 13:38
Parent(s): 870624e91fa526f5eeb0d699f8a33a43ff7af4a1
Signer:
Signing key:
Signing status: N
Tree: 72c0015a037f4ea61e9665f83b50ad8025e85a85
File Lines added Lines deleted
main.c 3 14
File main.c changed (mode: 100644) (index b7654ae..c9cfb04)
... ... int handle_frame(protocol_frame *frame)
490 490 * It checks for basic inconsistiencies and allocates the * It checks for basic inconsistiencies and allocates the
491 491 * protocol_frame structure. * protocol_frame structure.
492 492 */ */
493 int parse_lossless_packet(Tox *tox, int32_t friendnumber, const uint8_t *data, uint32_t len, void *sender_uc)
493 int parse_lossless_packet(Tox *tox, int32_t friendnumber, const uint8_t *data, uint32_t len, void *tmp)
494 494 { {
495 495 protocol_frame *frame = NULL; protocol_frame *frame = NULL;
496 496
 
... ... int parse_lossless_packet(Tox *tox, int32_t friendnumber, const uint8_t *data, u
525 525 frame->connid = INT16_AT(data, 4); frame->connid = INT16_AT(data, 4);
526 526 frame->data_length = INT16_AT(data, 6); frame->data_length = INT16_AT(data, 6);
527 527 frame->data = (uint8_t *)(data + PROTOCOL_BUFFER_OFFSET); frame->data = (uint8_t *)(data + PROTOCOL_BUFFER_OFFSET);
528 frame->friendnumber = *((uint32_t*)sender_uc);
528 frame->friendnumber = friendnumber;
529 529 log_printf(L_DEBUG, "Got protocol frame magic 0x%x type 0x%x from friend %d\n", frame->magic, frame->packet_type, frame->friendnumber); log_printf(L_DEBUG, "Got protocol frame magic 0x%x type 0x%x from friend %d\n", frame->magic, frame->packet_type, frame->friendnumber);
530 530
531 531 if(len < frame->data_length + PROTOCOL_BUFFER_OFFSET) if(len < frame->data_length + PROTOCOL_BUFFER_OFFSET)
 
... ... void accept_friend_request(Tox *tox, const uint8_t *public_key, const uint8_t *d
654 654 { {
655 655 unsigned char tox_printable_id[TOX_FRIEND_ADDRESS_SIZE * 2 + 1]; unsigned char tox_printable_id[TOX_FRIEND_ADDRESS_SIZE * 2 + 1];
656 656 int32_t friendnumber; int32_t friendnumber;
657 int32_t *friendnumber_ptr = NULL;
658 657
659 658 log_printf(L_DEBUG, "Got friend request\n"); log_printf(L_DEBUG, "Got friend request\n");
660 659
 
... ... void accept_friend_request(Tox *tox, const uint8_t *public_key, const uint8_t *d
664 663 id_to_string(tox_printable_id, public_key); id_to_string(tox_printable_id, public_key);
665 664 log_printf(L_INFO, "Accepted friend request from %s as %d\n", tox_printable_id, friendnumber); log_printf(L_INFO, "Accepted friend request from %s as %d\n", tox_printable_id, friendnumber);
666 665
667 /* TODO: this is not freed right now, we're leaking 4 bytes per contact (OMG!) */
668 friendnumber_ptr = malloc(sizeof(int32_t));
669 if(!friendnumber_ptr)
670 {
671 log_printf(L_ERROR, "Could not allocate memory for friendnumber_ptr\n");
672 return;
673 }
674
675 *friendnumber_ptr = friendnumber;
676
677 tox_lossless_packet_registerhandler(tox, friendnumber, (PROTOCOL_MAGIC_V1)>>8, parse_lossless_packet, (void*)friendnumber_ptr);
666 tox_lossless_packet_registerhandler(tox, friendnumber, (PROTOCOL_MAGIC_V1)>>8, parse_lossless_packet, NULL);
678 667 } }
679 668
680 669 void cleanup(int status, void *tmp) void cleanup(int status, void *tmp)
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/gdr/tuntox

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/gdr/tuntox

Clone this repository using git:
git clone git://git.rocketgit.com/user/gdr/tuntox

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main