diff options
author | Christian Pointner <equinox@anytun.org> | 2008-12-28 03:01:38 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2008-12-28 03:01:38 +0000 |
commit | 699f04dc754ef3545ae217ab1879731f2595ae0d (patch) | |
tree | f80e29d197eedc2a1569a9ff35b43e47000e32ef /src/uanytun.c | |
parent | added enpoint to string functions (diff) |
some memory erros fixed
added udp_read and udp_write
Diffstat (limited to 'src/uanytun.c')
-rw-r--r-- | src/uanytun.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/uanytun.c b/src/uanytun.c index 881ba5b..ae052f8 100644 --- a/src/uanytun.c +++ b/src/uanytun.c @@ -71,7 +71,7 @@ int main(int argc, char* argv[]) exit(-1); } - udp_set_remote(sock, "anycast.anytun.org", "4444"); + udp_set_remote(sock, "1.2.3.4", "4444"); char* remote_string = udp_get_remote_end_string(sock); log_printf(INFO, "set remote end to: %s", remote_string); free(remote_string); @@ -81,9 +81,10 @@ int main(int argc, char* argv[]) int len = 0; unsigned int cnt = 0; while(cnt < 5) { - len = tun_read(dev, buf, 1600); - printf("read %d bytes from device\n", len); -// tun_write(dev, buf, len); + struct sockaddr_storage remote; + len = udp_read(sock, buf, 1600, &remote); + printf("read %d bytes from socket\n", len); + udp_write(sock, buf, len); cnt++; } tun_close(&dev); |