Searched refs:tunnel (Results 1 – 2 of 2) sorted by relevance
/development/samples/ToyVpn/server/linux/ |
D | ToyVpnServer.cpp | 87 int tunnel = socket(AF_INET6, SOCK_DGRAM, 0); in get_tunnel() local 89 setsockopt(tunnel, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof(flag)); in get_tunnel() 91 setsockopt(tunnel, IPPROTO_IPV6, IPV6_V6ONLY, &flag, sizeof(flag)); in get_tunnel() 100 while (bind(tunnel, (sockaddr *)&addr, sizeof(addr))) { in get_tunnel() 112 int n = recvfrom(tunnel, packet, sizeof(packet), 0, in get_tunnel() 121 connect(tunnel, (sockaddr *)&addr, addrlen); in get_tunnel() 122 return tunnel; in get_tunnel() 188 int tunnel; in main() local 189 while ((tunnel = get_tunnel(argv[2], argv[3])) != -1) { in main() 199 fcntl(tunnel, F_SETFL, O_NONBLOCK); in main() [all …]
|
/development/samples/ToyVpn/src/com/example/android/toyvpn/ |
D | ToyVpnConnection.java | 166 try (DatagramChannel tunnel = DatagramChannel.open()) { in run() argument 169 if (!mService.protect(tunnel.socket())) { in run() 174 tunnel.connect(server); in run() 178 tunnel.configureBlocking(false); in run() 181 iface = handshake(tunnel); in run() 211 tunnel.write(packet); in run() 220 length = tunnel.read(packet); in run() 246 tunnel.write(packet); in run() 270 private ParcelFileDescriptor handshake(DatagramChannel tunnel) in handshake() argument 288 tunnel.write(packet); in handshake() [all …]
|