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)
changed arguments for rules optoins fd085c2862153d16443451d96fc56d2e67873e9e Pietro Bonfa 2016-10-08 12:10:47
fixed bug with filter_policy 230e7ae1347fe613d63f3dca136128b29331f80d Pietro Bonfa 2016-10-07 12:17:09
Changed gdr.name relay ports d194df598555e6ba31d53f5b1ec74f370b869c8c GDR! 2016-10-05 19:45:34
Separate TCP relays from bootstrap nodes during bootstrap a5b237c6fc56787e8ce9e29c4c4778f462c0d849 GDR! 2016-10-05 18:56:18
Updated node list with generate_tox_bootstrap.py 298776994486b7c07dfede1d4190ff0e5aa8789a GDR! 2016-10-05 18:40:02
Added filter for hostname and port requests e5bf743ccb6f80b70a6017a39c30f7610012979b Pietro Bonfa 2016-10-05 18:10:15
Update README.md 24a0f954ce773571aff6562084553028c8352142 GDR! 2016-10-04 08:16:39
Whitelist debug statement a971c172985088d38297ed30318910144140a44b GDR! 2016-06-08 20:36:52
Coverity fix b081686b05931064b4f9a26621d77a5d43941832 GDR! 2016-06-08 15:28:41
Fixed default value for server whitelist mode e682a05cf64ea85e30cb88a089fe220c2081e5da GDR! 2016-06-08 15:16:25
Documentation for #14 e9393fb439f94461fdc665eb85af54f156e5be75 GDR! 2016-06-07 20:00:13
"Whitelist clients by pubkeys" mode, re-request friends 1013b2aaeafa9112849df4e08bcced23cbd91fdf GDR! 2016-06-07 19:52:48
Remove FDs of closed tunnels from fdset 816245f429145052b8908d500c64d372fc8c2972 GDR! 2016-06-07 18:42:45
Mention toxvpn c2a78f48bd44613162a6e3c1d02cb53266611936 GDR! 2016-05-05 17:55:59
ProxyCommand explained c17be222aa46a4cf1a9d19c0ae767697ad585fd3 GDR! 2016-05-05 17:50:05
Visible ToxID 4f38371fd72ba889e39805b76a1a2402194b5398 GDR! 2016-05-05 17:46:06
Tuntox does fork! 0d1230def56597b25bcd731346794058c66d3e7c GDR! 2016-05-05 17:45:25
Tox.chat 2 90990f49bda18d06c89fca0495b39726bd55a076 GDR! 2016-05-05 17:43:58
Tox.chat 5b921bc92cf04773f8e5b08120e5850156fbb580 GDR! 2016-05-05 17:43:11
Possible fix for Issue #16 cc633e9ad431850d298638dbcdcbf1e8a4dfdeb1 GDR! 2016-05-05 17:39:42
Commit fd085c2862153d16443451d96fc56d2e67873e9e - changed arguments for rules optoins
Author: Pietro Bonfa
Author date (UTC): 2016-10-08 12:10
Committer name: Pietro Bonfa
Committer date (UTC): 2016-10-08 12:10
Parent(s): 230e7ae1347fe613d63f3dca136128b29331f80d
Signer:
Signing key:
Signing status: N
Tree: a26c78d7d73098e2f2e7556af84ce13ab6ee3756
File Lines added Lines deleted
main.c 16 33
File main.c changed (mode: 100644) (index f4ec7f6..7f9380f)
... ... char config_path[500] = "/etc/tuntox/";
33 33
34 34 /* Limit hostname and port in server */ /* Limit hostname and port in server */
35 35 int nrules = 0; int nrules = 0;
36 char rules_file[500] = "/etc/tuntox/rules";
36 37 enum rules_policy_enum rules_policy = NONE; enum rules_policy_enum rules_policy = NONE;
37 38 rule *rules = NULL; rule *rules = NULL;
38 39
 
... ... int handle_request_tunnel_frame(protocol_frame *rcvd_frame)
445 446 } }
446 447
447 448 } else if (rules_policy != NONE) { } else if (rules_policy != NONE) {
448 log_printf(L_WARNING, "Filter option active but no allowed ports!\n");
449 log_printf(L_WARNING, "All requests will be dropped.\n");
450 return -1;
449 log_printf(L_WARNING, "Filter option active but no allowed host/port. All requests will be dropped.\n");
450 return -1;
451 451 } }
452 452
453 453
 
... ... void load_rules()
774 774 char * ahost=NULL; char * ahost=NULL;
775 775 int aport=0; int aport=0;
776 776 char line[100 + 1] = ""; char line[100 + 1] = "";
777 uint8_t path_tmp[512], path_real[512], *p;
778 777 FILE *file = NULL; FILE *file = NULL;
779 778 rule *rule_obj = NULL; rule *rule_obj = NULL;
780 779
781
782 strncpy(path_real, config_path, sizeof(config_path));
783
784 p = path_real + strlen(path_real);
785 memcpy(p, "rules", sizeof("rules"));
786
787 unsigned int path_len = (p - path_real) + sizeof("rules");
788
789 file = fopen((char *)path_real, "r");
780 file = fopen(rules_file, "r");
790 781
791 782 if (file == NULL) { if (file == NULL) {
792 log_printf(L_WARNING, "Could not open rules file!\n");
783 log_printf(L_WARNING, "Could not open rules file (%s)\n", rules_file);
793 784 return; return;
794 785 } }
795 786
 
... ... void help()
1204 1195 fprintf(stderr, "-p - ping the server from -i and exit\n"); fprintf(stderr, "-p - ping the server from -i and exit\n");
1205 1196 fprintf(stderr, "-C <dir> - save private key in <dir> instead of /etc/tuntox in server mode\n"); fprintf(stderr, "-C <dir> - save private key in <dir> instead of /etc/tuntox in server mode\n");
1206 1197 fprintf(stderr, "-s <secret> - shared secret used for connection authentication (max %u characters)\n", TOX_MAX_FRIEND_REQUEST_LENGTH-1); fprintf(stderr, "-s <secret> - shared secret used for connection authentication (max %u characters)\n", TOX_MAX_FRIEND_REQUEST_LENGTH-1);
1198 fprintf(stderr, "-f <file> - allows only connections to hostname/port combinations contained in <file>. Rules must by entered one per line with the <hostname>:<port> format\n");
1199 fprintf(stderr, "-e <file> - same as -f, but force the connection to a randomly selected hostname/port combination of <file>, ignoring the client's request\n");
1207 1200 fprintf(stderr, "-d - debug mode\n"); fprintf(stderr, "-d - debug mode\n");
1208 1201 fprintf(stderr, "-q - quiet mode\n"); fprintf(stderr, "-q - quiet mode\n");
1209 1202 fprintf(stderr, "-S - send output to syslog instead of stderr\n"); fprintf(stderr, "-S - send output to syslog instead of stderr\n");
 
... ... int main(int argc, char *argv[])
1225 1218
1226 1219 log_init(); log_init();
1227 1220
1228 while ((oc = getopt(argc, argv, "L:pi:C:s:f:P:dqhSF:DU:")) != -1)
1221 while ((oc = getopt(argc, argv, "L:pi:C:s:f:e:P:dqhSF:DU:")) != -1)
1229 1222 { {
1230 1223 switch(oc) switch(oc)
1231 1224 { {
 
... ... int main(int argc, char *argv[])
1299 1292 load_saved_toxid_in_client_mode = 1; load_saved_toxid_in_client_mode = 1;
1300 1293 break; break;
1301 1294 case 'f': case 'f':
1302 switch(optarg[0])
1303 {
1304 case 'E':
1305 rules_policy = ENFORCE;
1306 log_printf(L_INFO, "Filter policy set to ENFORCE\n");
1307 break;
1308 case 'V':
1309 rules_policy = VALIDATE;
1310 log_printf(L_INFO, "Filter policy set to VALIDATE\n");
1311 break;
1312 case 'N':
1313 rules_policy = NONE;
1314 log_printf(L_INFO, "Filter policy set to NONE\n");
1315 break;
1316 default:
1317 log_printf(L_WARNING, "Invalid filter policy, reverting to ENFORCE.");
1318 rules_policy = ENFORCE;
1319 }
1295 strncpy(rules_file, optarg, sizeof(rules_file) - 1);
1296 rules_policy = VALIDATE;
1297 log_printf(L_INFO, "Filter policy set to VALIDATE\n");
1298 break;
1299 case 'e':
1300 strncpy(rules_file, optarg, sizeof(rules_file) - 1);
1301 rules_policy = ENFORCE;
1302 log_printf(L_INFO, "Filter policy set to ENFORCE\n");
1320 1303 break; break;
1321 1304 case 's': case 's':
1322 1305 /* Shared secret */ /* Shared secret */
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