Lines Matching refs:tunnel
153 void configure_tun_ip(const struct tun_data *tunnel, const char *v4_addr) { in configure_tun_ip() argument
162 logmsg(ANDROID_LOG_INFO, "Using IPv4 address %s on %s", addrstr, tunnel->device4); in configure_tun_ip()
166 int status = add_address(tunnel->device4, AF_INET, &Global_Clatd_Config.ipv4_local_subnet, 32, in configure_tun_ip()
173 status = if_up(tunnel->device4, Global_Clatd_Config.ipv4mtu); in configure_tun_ip()
233 void open_sockets(struct tun_data *tunnel, uint32_t mark) { in open_sockets() argument
248 tunnel->write_fd6 = rawsock; in open_sockets()
250 tunnel->read_fd6 = ring_create(tunnel); in open_sockets()
251 if (tunnel->read_fd6 < 0) { in open_sockets()
322 int configure_clat_ipv6_address(const struct tun_data *tunnel, const char *interface, in configure_clat_ipv6_address() argument
337 add_anycast_address(tunnel->write_fd6, &Global_Clatd_Config.ipv6_local_subnet, interface); in configure_clat_ipv6_address()
340 if (!configure_packet_socket(tunnel->read_fd6)) { in configure_clat_ipv6_address()
357 const char *v6_addr, struct tun_data *tunnel, unsigned net_id) { in configure_interface() argument
383 configure_tun_ip(tunnel, v4_addr); in configure_interface()
385 if (!configure_clat_ipv6_address(tunnel, uplink_interface, v6_addr)) { in configure_interface()
443 void event_loop(struct tun_data *tunnel) { in event_loop() argument
446 { tunnel->read_fd6, POLLIN, 0 }, in event_loop()
447 { tunnel->fd4, POLLIN, 0 }, in event_loop()
460 ring_read(&tunnel->ring, tunnel->fd4, 0 /* to_ipv6 */); in event_loop()
465 recv(tunnel->read_fd6, NULL, 0, MSG_PEEK); in event_loop()
475 read_packet(tunnel->fd4, tunnel->write_fd6, 1 /* to_ipv6 */); in event_loop()