Home | History | Annotate | Download | only in linux

Lines Matching defs:tunnel

87     int tunnel = socket(AF_INET6, SOCK_DGRAM, 0);
89 setsockopt(tunnel, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof(flag));
91 setsockopt(tunnel, IPPROTO_IPV6, IPV6_V6ONLY, &flag, sizeof(flag));
100 while (bind(tunnel, (sockaddr *)&addr, sizeof(addr))) {
112 int n = recvfrom(tunnel, packet, sizeof(packet), 0,
121 connect(tunnel, (sockaddr *)&addr, addrlen);
122 return tunnel;
187 // Wait for a tunnel.
188 int tunnel;
189 while ((tunnel = get_tunnel(argv[2], argv[3])) != -1) {
190 printf("%s: Here comes a new tunnel\n", argv[1]);
198 // Put the tunnel into non-blocking mode.
199 fcntl(tunnel, F_SETFL, O_NONBLOCK);
203 send(tunnel, parameters, sizeof(parameters), MSG_NOSIGNAL);
209 // We use a timer to determine the status of the tunnel. It
222 // Write the outgoing packet to the tunnel.
223 send(tunnel, packet, length, MSG_NOSIGNAL);
234 // Read the incoming packet from the tunnel.
235 length = recv(tunnel, packet, sizeof(packet), 0);
270 send(tunnel, packet, 1, MSG_NOSIGNAL);
283 printf("%s: The tunnel is broken\n", argv[1]);
284 close(tunnel);