Lines Matching refs:tunnel
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()
203 send(tunnel, parameters, sizeof(parameters), MSG_NOSIGNAL); in main()
223 send(tunnel, packet, length, MSG_NOSIGNAL); in main()
235 length = recv(tunnel, packet, sizeof(packet), 0); in main()
270 send(tunnel, packet, 1, MSG_NOSIGNAL); in main()
284 close(tunnel); in main()