public AndroidVPNContext(AndroidVPNService service) { m_builder = new VpnService.Builder(service); m_builder.SetConfigureIntent(service.CreateConfigIntent()); InitDNS(); InitMTU(); InitApplications(); }
public OpenVPNTunnel(AndroidVPNService service) { m_service = service; // NOTE: do NOT propagate any exception from the following callbacks since they are invoked from C++ code and could cause memory leaks or crashes m_clientInterface = new NativeMethods.ovpn3_client(); m_clientInterface.socket_protect += OnSocketProtect; m_clientInterface.on_event += OnEvent; m_clientInterface.tun_builder_new += OnTunBuilderNew; m_clientInterface.tun_builder_set_layer += OnTunBuilderSetLayer; m_clientInterface.tun_builder_set_remote_address += OnTunBuilderSetRemoteAddress; m_clientInterface.tun_builder_add_address += OnTunBuilderAddAddress; m_clientInterface.tun_builder_set_route_metric_default += OnTunBuilderSetRouteMetricDefault; m_clientInterface.tun_builder_reroute_gw += OnTunBuildeRerouteGW; m_clientInterface.tun_builder_add_route += OnTunBuilderAddRoute; m_clientInterface.tun_builder_exclude_route += OnTunBuilderExcludeRoute; m_clientInterface.tun_builder_add_dns_server += OnTunBuilderAddDNSServer; m_clientInterface.tun_builder_add_search_domain += OnTunBuilderAddSearchDomain; m_clientInterface.tun_builder_set_mtu += OnTunBuilderSetMTU; m_clientInterface.tun_builder_set_session_name += OnTunBuilderSetSessionName; m_clientInterface.tun_builder_add_proxy_bypass += OnTunBuilderAddProxyBypass; m_clientInterface.tun_builder_set_proxy_auto_config_url += OnTunBuilderSetProxyAutoConfigUrl; m_clientInterface.tun_builder_set_proxy_http += OnTunBuilderSetProxyHttp; m_clientInterface.tun_builder_set_proxy_https += OnTunBuilderSetProxyHttps; m_clientInterface.tun_builder_add_wins_server += OnTunBuilderAddWinsServer; m_clientInterface.tun_builder_set_block_ipv6 += OnTunBuilderSetBlockIPV6; m_clientInterface.tun_builder_set_adapter_domain_suffix += OnTunBuilderSetAdapterDomainSuffix; m_clientInterface.tun_builder_establish += OnTunBuilderEstablish; m_clientInterface.tun_builder_persist += OnTunBuilderPersist; m_clientInterface.tun_builder_establish_lite += OnTunBuilderEstablishLite; m_clientInterface.tun_builder_teardown += OnTunBuilderTeardown; m_clientInterface.connect_attach += OnConnectAttach; m_clientInterface.connect_pre_run += OnConnectPreRun; m_clientInterface.connect_run += OnConnectRun; m_clientInterface.connect_session_stop += OnConnectSessionStop; }
public ScreenReceiver(AndroidVPNService service) { m_service = service; }