├── .gitignore ├── .gitmodules ├── CHANGES.md ├── LICENSE ├── Makefile ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── io │ │ └── github │ │ └── xSocks │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── aidl │ └── io │ │ └── github │ │ └── xSocks │ │ └── aidl │ │ ├── Config.aidl │ │ ├── IxSocksService.aidl │ │ └── IxSocksServiceCallback.aidl │ ├── assets │ └── fonts │ │ └── Iceland.ttf │ ├── java │ └── io │ │ └── github │ │ └── xSocks │ │ ├── System.java │ │ ├── aidl │ │ └── Config.java │ │ ├── model │ │ ├── Profile.java │ │ ├── Profiles.java │ │ └── ProxiedApp.java │ │ ├── preferences │ │ ├── PasswordEditTextPreference.java │ │ ├── ProfileEditTextPreference.java │ │ ├── SummaryEditTextPreference.java │ │ └── SummaryListPreference.java │ │ ├── service │ │ ├── xSocksVpnService.java │ │ └── xSocksVpnThread.java │ │ ├── store │ │ └── ProfileManager.java │ │ ├── ui │ │ ├── AboutActivity.java │ │ ├── AppManagerActivity.java │ │ ├── AppManagerActivityFragment.java │ │ ├── MainActivity.java │ │ ├── PrefsFragment.java │ │ ├── ProfileDrawerItem.java │ │ └── xSocksRunnerActivity.java │ │ ├── utils │ │ ├── ConfigUtils.java │ │ ├── Console.java │ │ ├── Constants.java │ │ ├── MovementCheck.java │ │ └── Utils.java │ │ ├── xSocksApplication.java │ │ └── xSocksReceiver.java │ └── res │ ├── drawable-hdpi │ └── ic_logo.png │ ├── drawable-xhdpi │ └── ic_logo.png │ ├── layout │ ├── activity_about.xml │ ├── activity_app_manager.xml │ ├── activity_main.xml │ ├── apps_item.xml │ └── fragment_app_manager.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── raw │ ├── dns_black_list │ ├── dns_reject_list │ ├── pdnsd_direct │ ├── pdnsd_local │ ├── route_bypass │ ├── route_chn │ └── route_lan │ ├── values-v21 │ └── styles.xml │ ├── values-zh │ └── strings.xml │ ├── values │ ├── about.xml │ ├── arrays.xml │ ├── colors.xml │ ├── dimens.xml │ ├── ids.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ └── preferences.xml ├── build.gradle ├── gradle.properties ├── jni ├── Android.mk ├── Application.mk ├── badvpn │ ├── CMakeLists.txt │ ├── COPYING │ ├── ChangeLog │ ├── INSTALL │ ├── INSTALL-WINDOWS │ ├── arpprobe │ │ ├── BArpProbe.c │ │ ├── BArpProbe.h │ │ └── CMakeLists.txt │ ├── badvpn.7 │ ├── base │ │ ├── BLog.c │ │ ├── BLog.h │ │ ├── BLog_syslog.c │ │ ├── BLog_syslog.h │ │ ├── BMutex.h │ │ ├── BPending.c │ │ ├── BPending.h │ │ ├── BPending_list.h │ │ ├── CMakeLists.txt │ │ ├── DebugObject.c │ │ └── DebugObject.h │ ├── blog_channels.txt │ ├── blog_generator │ │ ├── blog.php │ │ └── blog_functions.php │ ├── bproto │ │ └── BProto.h │ ├── bproto_generator │ │ ├── ProtoParser.lime │ │ ├── ProtoParser.php │ │ ├── bproto.php │ │ └── bproto_functions.php │ ├── client │ │ ├── CMakeLists.txt │ │ ├── DPReceive.c │ │ ├── DPReceive.h │ │ ├── DPRelay.c │ │ ├── DPRelay.h │ │ ├── DataProto.c │ │ ├── DataProto.h │ │ ├── DataProtoKeepaliveSource.c │ │ ├── DataProtoKeepaliveSource.h │ │ ├── DatagramPeerIO.c │ │ ├── DatagramPeerIO.h │ │ ├── FragmentProtoAssembler.c │ │ ├── FragmentProtoAssembler.h │ │ ├── FragmentProtoAssembler_tree.h │ │ ├── FragmentProtoDisassembler.c │ │ ├── FragmentProtoDisassembler.h │ │ ├── FrameDecider.c │ │ ├── FrameDecider.h │ │ ├── FrameDecider_groups_tree.h │ │ ├── FrameDecider_macs_tree.h │ │ ├── FrameDecider_multicast_tree.h │ │ ├── PasswordListener.c │ │ ├── PasswordListener.h │ │ ├── PeerChat.c │ │ ├── PeerChat.h │ │ ├── SCOutmsgEncoder.c │ │ ├── SCOutmsgEncoder.h │ │ ├── SPProtoDecoder.c │ │ ├── SPProtoDecoder.h │ │ ├── SPProtoEncoder.c │ │ ├── SPProtoEncoder.h │ │ ├── SimpleStreamBuffer.c │ │ ├── SimpleStreamBuffer.h │ │ ├── SinglePacketSource.c │ │ ├── SinglePacketSource.h │ │ ├── StreamPeerIO.c │ │ ├── StreamPeerIO.h │ │ ├── badvpn-client.8 │ │ ├── client.c │ │ └── client.h │ ├── cmake │ │ └── modules │ │ │ ├── COPYING-CMAKE-SCRIPTS │ │ │ ├── FindGLIB2.cmake │ │ │ ├── FindLibraryWithDebug.cmake │ │ │ ├── FindNSPR.cmake │ │ │ ├── FindNSS.cmake │ │ │ └── FindOpenSSL.cmake │ ├── compile-tun2sock.sh │ ├── dhcpclient │ │ ├── BDHCPClient.c │ │ ├── BDHCPClient.h │ │ ├── BDHCPClientCore.c │ │ ├── BDHCPClientCore.h │ │ ├── CMakeLists.txt │ │ ├── DHCPIpUdpDecoder.c │ │ ├── DHCPIpUdpDecoder.h │ │ ├── DHCPIpUdpEncoder.c │ │ └── DHCPIpUdpEncoder.h │ ├── dostest │ │ ├── CMakeLists.txt │ │ ├── StreamBuffer.c │ │ ├── StreamBuffer.h │ │ ├── dostest-attacker.c │ │ └── dostest-server.c │ ├── examples │ │ ├── CMakeLists.txt │ │ ├── FastPacketSource.h │ │ ├── RandomPacketSink.h │ │ ├── TimerPacketSink.h │ │ ├── arpprobe_test.c │ │ ├── bavl_test.c │ │ ├── bencryption_bench.c │ │ ├── bprocess_example.c │ │ ├── brandom2_test.c │ │ ├── btimer_example.c │ │ ├── cavl_test.c │ │ ├── cavl_test_tree.h │ │ ├── dhcpclient_test.c │ │ ├── emscripten_test.c │ │ ├── fairqueue_test.c │ │ ├── fairqueue_test2.c │ │ ├── indexedlist_test.c │ │ ├── ipaddr6_test.c │ │ ├── ncd_parser_test.c │ │ ├── ncd_tokenizer_test.c │ │ ├── ncd_value_parser_test.c │ │ ├── ncdinterfacemonitor_test.c │ │ ├── ncdudevmanager_test.c │ │ ├── ncdudevmonitor_test.c │ │ ├── ncdval_test.c │ │ ├── ncdvalcons_test.c │ │ ├── parse_number_test.c │ │ ├── predicate_test.c │ │ ├── savl_test.c │ │ ├── savl_test_tree.h │ │ ├── stdin_input.c │ │ └── substring_test.c │ ├── fix_flex.php │ ├── flooder │ │ ├── CMakeLists.txt │ │ ├── flooder.c │ │ └── flooder.h │ ├── flow │ │ ├── BufferWriter.c │ │ ├── BufferWriter.h │ │ ├── CMakeLists.txt │ │ ├── LineBuffer.c │ │ ├── LineBuffer.h │ │ ├── PacketBuffer.c │ │ ├── PacketBuffer.h │ │ ├── PacketCopier.c │ │ ├── PacketCopier.h │ │ ├── PacketPassConnector.c │ │ ├── PacketPassConnector.h │ │ ├── PacketPassFairQueue.c │ │ ├── PacketPassFairQueue.h │ │ ├── PacketPassFairQueue_tree.h │ │ ├── PacketPassFifoQueue.c │ │ ├── PacketPassFifoQueue.h │ │ ├── PacketPassInterface.c │ │ ├── PacketPassInterface.h │ │ ├── PacketPassNotifier.c │ │ ├── PacketPassNotifier.h │ │ ├── PacketPassPriorityQueue.c │ │ ├── PacketPassPriorityQueue.h │ │ ├── PacketPassPriorityQueue_tree.h │ │ ├── PacketProtoDecoder.c │ │ ├── PacketProtoDecoder.h │ │ ├── PacketProtoEncoder.c │ │ ├── PacketProtoEncoder.h │ │ ├── PacketProtoFlow.c │ │ ├── PacketProtoFlow.h │ │ ├── PacketRecvBlocker.c │ │ ├── PacketRecvBlocker.h │ │ ├── PacketRecvConnector.c │ │ ├── PacketRecvConnector.h │ │ ├── PacketRecvInterface.c │ │ ├── PacketRecvInterface.h │ │ ├── PacketRouter.c │ │ ├── PacketRouter.h │ │ ├── PacketStreamSender.c │ │ ├── PacketStreamSender.h │ │ ├── RouteBuffer.c │ │ ├── RouteBuffer.h │ │ ├── SinglePacketBuffer.c │ │ ├── SinglePacketBuffer.h │ │ ├── SinglePacketSender.c │ │ ├── SinglePacketSender.h │ │ ├── SingleStreamReceiver.c │ │ ├── SingleStreamReceiver.h │ │ ├── SingleStreamSender.c │ │ ├── SingleStreamSender.h │ │ ├── StreamPacketSender.c │ │ ├── StreamPacketSender.h │ │ ├── StreamPassConnector.c │ │ ├── StreamPassConnector.h │ │ ├── StreamPassInterface.c │ │ ├── StreamPassInterface.h │ │ ├── StreamRecvConnector.c │ │ ├── StreamRecvConnector.h │ │ ├── StreamRecvInterface.c │ │ └── StreamRecvInterface.h │ ├── flowextra │ │ ├── CMakeLists.txt │ │ ├── KeepaliveIO.c │ │ ├── KeepaliveIO.h │ │ ├── PacketPassInactivityMonitor.c │ │ └── PacketPassInactivityMonitor.h │ ├── generate_files │ ├── generated │ │ ├── NCDConfigParser_parse.c │ │ ├── NCDConfigParser_parse.h │ │ ├── NCDConfigParser_parse.out │ │ ├── NCDConfigParser_parse.y │ │ ├── NCDValParser_parse.c │ │ ├── NCDValParser_parse.h │ │ ├── NCDValParser_parse.out │ │ ├── NCDValParser_parse.y │ │ ├── bison_BPredicate.c │ │ ├── bison_BPredicate.h │ │ ├── blog_channel_BArpProbe.h │ │ ├── blog_channel_BConnection.h │ │ ├── blog_channel_BDHCPClient.h │ │ ├── blog_channel_BDHCPClientCore.h │ │ ├── blog_channel_BDatagram.h │ │ ├── blog_channel_BEncryption.h │ │ ├── blog_channel_BInputProcess.h │ │ ├── blog_channel_BLockReactor.h │ │ ├── blog_channel_BNetwork.h │ │ ├── blog_channel_BPredicate.h │ │ ├── blog_channel_BProcess.h │ │ ├── blog_channel_BReactor.h │ │ ├── blog_channel_BSSLConnection.h │ │ ├── blog_channel_BSignal.h │ │ ├── blog_channel_BSocksClient.h │ │ ├── blog_channel_BTap.h │ │ ├── blog_channel_BThreadSignal.h │ │ ├── blog_channel_BThreadWork.h │ │ ├── blog_channel_BTime.h │ │ ├── blog_channel_BUnixSignal.h │ │ ├── blog_channel_DPReceive.h │ │ ├── blog_channel_DPRelay.h │ │ ├── blog_channel_DataProto.h │ │ ├── blog_channel_DatagramPeerIO.h │ │ ├── blog_channel_FragmentProtoAssembler.h │ │ ├── blog_channel_FrameDecider.h │ │ ├── blog_channel_LineBuffer.h │ │ ├── blog_channel_Listener.h │ │ ├── blog_channel_NCDBuildProgram.h │ │ ├── blog_channel_NCDConfigParser.h │ │ ├── blog_channel_NCDConfigTokenizer.h │ │ ├── blog_channel_NCDIfConfig.h │ │ ├── blog_channel_NCDInterfaceMonitor.h │ │ ├── blog_channel_NCDModuleIndex.h │ │ ├── blog_channel_NCDModuleProcess.h │ │ ├── blog_channel_NCDPlaceholderDb.h │ │ ├── blog_channel_NCDRequest.h │ │ ├── blog_channel_NCDRequestClient.h │ │ ├── blog_channel_NCDRfkillMonitor.h │ │ ├── blog_channel_NCDUdevCache.h │ │ ├── blog_channel_NCDUdevManager.h │ │ ├── blog_channel_NCDUdevMonitor.h │ │ ├── blog_channel_NCDUdevMonitorParser.h │ │ ├── blog_channel_NCDVal.h │ │ ├── blog_channel_NCDValGenerator.h │ │ ├── blog_channel_NCDValParser.h │ │ ├── blog_channel_PRStreamSink.h │ │ ├── blog_channel_PRStreamSource.h │ │ ├── blog_channel_PacketProtoDecoder.h │ │ ├── blog_channel_PasswordListener.h │ │ ├── blog_channel_PeerChat.h │ │ ├── blog_channel_SPProtoDecoder.h │ │ ├── blog_channel_ServerConnection.h │ │ ├── blog_channel_SocksUdpGwClient.h │ │ ├── blog_channel_StreamPeerIO.h │ │ ├── blog_channel_UdpGwClient.h │ │ ├── blog_channel_addr.h │ │ ├── blog_channel_client.h │ │ ├── blog_channel_dostest_attacker.h │ │ ├── blog_channel_dostest_server.h │ │ ├── blog_channel_flooder.h │ │ ├── blog_channel_lwip.h │ │ ├── blog_channel_ncd.h │ │ ├── blog_channel_ncd_alias.h │ │ ├── blog_channel_ncd_arithmetic.h │ │ ├── blog_channel_ncd_assert.h │ │ ├── blog_channel_ncd_backtrack.h │ │ ├── blog_channel_ncd_blocker.h │ │ ├── blog_channel_ncd_buffer.h │ │ ├── blog_channel_ncd_call2.h │ │ ├── blog_channel_ncd_choose.h │ │ ├── blog_channel_ncd_concat.h │ │ ├── blog_channel_ncd_daemon.h │ │ ├── blog_channel_ncd_depend.h │ │ ├── blog_channel_ncd_depend_scope.h │ │ ├── blog_channel_ncd_dynamic_depend.h │ │ ├── blog_channel_ncd_exit.h │ │ ├── blog_channel_ncd_explode.h │ │ ├── blog_channel_ncd_file.h │ │ ├── blog_channel_ncd_file_open.h │ │ ├── blog_channel_ncd_foreach.h │ │ ├── blog_channel_ncd_from_string.h │ │ ├── blog_channel_ncd_getargs.h │ │ ├── blog_channel_ncd_getenv.h │ │ ├── blog_channel_ncd_if.h │ │ ├── blog_channel_ncd_imperative.h │ │ ├── blog_channel_ncd_implode.h │ │ ├── blog_channel_ncd_index.h │ │ ├── blog_channel_ncd_list.h │ │ ├── blog_channel_ncd_load_module.h │ │ ├── blog_channel_ncd_log.h │ │ ├── blog_channel_ncd_log_msg.h │ │ ├── blog_channel_ncd_logical.h │ │ ├── blog_channel_ncd_multidepend.h │ │ ├── blog_channel_ncd_net_backend_badvpn.h │ │ ├── blog_channel_ncd_net_backend_rfkill.h │ │ ├── blog_channel_ncd_net_backend_waitdevice.h │ │ ├── blog_channel_ncd_net_backend_waitlink.h │ │ ├── blog_channel_ncd_net_backend_wpa_supplicant.h │ │ ├── blog_channel_ncd_net_dns.h │ │ ├── blog_channel_ncd_net_iptables.h │ │ ├── blog_channel_ncd_net_ipv4_addr.h │ │ ├── blog_channel_ncd_net_ipv4_addr_in_network.h │ │ ├── blog_channel_ncd_net_ipv4_arp_probe.h │ │ ├── blog_channel_ncd_net_ipv4_dhcp.h │ │ ├── blog_channel_ncd_net_ipv4_route.h │ │ ├── blog_channel_ncd_net_ipv6_addr.h │ │ ├── blog_channel_ncd_net_ipv6_addr_in_network.h │ │ ├── blog_channel_ncd_net_ipv6_route.h │ │ ├── blog_channel_ncd_net_ipv6_wait_dynamic_addr.h │ │ ├── blog_channel_ncd_net_up.h │ │ ├── blog_channel_ncd_net_watch_interfaces.h │ │ ├── blog_channel_ncd_netmask.h │ │ ├── blog_channel_ncd_ondemand.h │ │ ├── blog_channel_ncd_parse.h │ │ ├── blog_channel_ncd_print.h │ │ ├── blog_channel_ncd_process_manager.h │ │ ├── blog_channel_ncd_reboot.h │ │ ├── blog_channel_ncd_ref.h │ │ ├── blog_channel_ncd_regex_match.h │ │ ├── blog_channel_ncd_request.h │ │ ├── blog_channel_ncd_run.h │ │ ├── blog_channel_ncd_runonce.h │ │ ├── blog_channel_ncd_sleep.h │ │ ├── blog_channel_ncd_socket.h │ │ ├── blog_channel_ncd_spawn.h │ │ ├── blog_channel_ncd_strcmp.h │ │ ├── blog_channel_ncd_substr.h │ │ ├── blog_channel_ncd_sys_evdev.h │ │ ├── blog_channel_ncd_sys_request_client.h │ │ ├── blog_channel_ncd_sys_request_server.h │ │ ├── blog_channel_ncd_sys_start_process.h │ │ ├── blog_channel_ncd_sys_watch_directory.h │ │ ├── blog_channel_ncd_sys_watch_input.h │ │ ├── blog_channel_ncd_sys_watch_usb.h │ │ ├── blog_channel_ncd_timer.h │ │ ├── blog_channel_ncd_to_string.h │ │ ├── blog_channel_ncd_try.h │ │ ├── blog_channel_ncd_value.h │ │ ├── blog_channel_ncd_valuemetic.h │ │ ├── blog_channel_ncd_var.h │ │ ├── blog_channel_nsskey.h │ │ ├── blog_channel_server.h │ │ ├── blog_channel_tun2socks.h │ │ ├── blog_channel_udpgw.h │ │ ├── blog_channels_defines.h │ │ ├── blog_channels_list.h │ │ ├── bproto_addr.h │ │ ├── bproto_bproto_test.h │ │ ├── bproto_msgproto.h │ │ ├── flex_BPredicate.c │ │ └── flex_BPredicate.h │ ├── lemon │ │ ├── lemon.c │ │ └── lempar.c │ ├── lime │ │ ├── HOWTO │ │ ├── flex_token_stream.php │ │ ├── lemon.c │ │ ├── lime.bootstrap │ │ ├── lime.php │ │ ├── lime_scan_tokens.l │ │ ├── metagrammar │ │ ├── parse_engine.php │ │ └── set.so.php │ ├── lwip │ │ ├── CHANGELOG │ │ ├── CMakeLists.txt │ │ ├── COPYING │ │ ├── FILES │ │ ├── README │ │ ├── UPGRADING │ │ ├── custom │ │ │ ├── arch │ │ │ │ ├── cc.h │ │ │ │ └── perf.h │ │ │ ├── lwipopts.h │ │ │ └── sys.c │ │ ├── doc │ │ │ ├── FILES │ │ │ ├── contrib.txt │ │ │ ├── rawapi.txt │ │ │ ├── savannah.txt │ │ │ ├── snmp_agent.txt │ │ │ └── sys_arch.txt │ │ ├── lwip-base-version │ │ ├── src │ │ │ ├── FILES │ │ │ ├── api │ │ │ │ ├── api_lib.c │ │ │ │ ├── api_msg.c │ │ │ │ ├── err.c │ │ │ │ ├── netbuf.c │ │ │ │ ├── netdb.c │ │ │ │ ├── netifapi.c │ │ │ │ ├── sockets.c │ │ │ │ └── tcpip.c │ │ │ ├── core │ │ │ │ ├── def.c │ │ │ │ ├── dhcp.c │ │ │ │ ├── dns.c │ │ │ │ ├── inet_chksum.c │ │ │ │ ├── init.c │ │ │ │ ├── ipv4 │ │ │ │ │ ├── autoip.c │ │ │ │ │ ├── icmp.c │ │ │ │ │ ├── igmp.c │ │ │ │ │ ├── ip4.c │ │ │ │ │ ├── ip4_addr.c │ │ │ │ │ └── ip_frag.c │ │ │ │ ├── ipv6 │ │ │ │ │ ├── README │ │ │ │ │ ├── dhcp6.c │ │ │ │ │ ├── ethip6.c │ │ │ │ │ ├── icmp6.c │ │ │ │ │ ├── inet6.c │ │ │ │ │ ├── ip6.c │ │ │ │ │ ├── ip6_addr.c │ │ │ │ │ ├── ip6_frag.c │ │ │ │ │ ├── mld6.c │ │ │ │ │ └── nd6.c │ │ │ │ ├── mem.c │ │ │ │ ├── memp.c │ │ │ │ ├── netif.c │ │ │ │ ├── pbuf.c │ │ │ │ ├── raw.c │ │ │ │ ├── snmp │ │ │ │ │ ├── asn1_dec.c │ │ │ │ │ ├── asn1_enc.c │ │ │ │ │ ├── mib2.c │ │ │ │ │ ├── mib_structs.c │ │ │ │ │ ├── msg_in.c │ │ │ │ │ └── msg_out.c │ │ │ │ ├── stats.c │ │ │ │ ├── sys.c │ │ │ │ ├── tcp.c │ │ │ │ ├── tcp_in.c │ │ │ │ ├── tcp_out.c │ │ │ │ ├── timers.c │ │ │ │ └── udp.c │ │ │ ├── include │ │ │ │ ├── ipv4 │ │ │ │ │ └── lwip │ │ │ │ │ │ ├── autoip.h │ │ │ │ │ │ ├── icmp.h │ │ │ │ │ │ ├── igmp.h │ │ │ │ │ │ ├── inet.h │ │ │ │ │ │ ├── ip4.h │ │ │ │ │ │ ├── ip4_addr.h │ │ │ │ │ │ └── ip_frag.h │ │ │ │ ├── ipv6 │ │ │ │ │ └── lwip │ │ │ │ │ │ ├── dhcp6.h │ │ │ │ │ │ ├── ethip6.h │ │ │ │ │ │ ├── icmp6.h │ │ │ │ │ │ ├── inet6.h │ │ │ │ │ │ ├── ip6.h │ │ │ │ │ │ ├── ip6_addr.h │ │ │ │ │ │ ├── ip6_frag.h │ │ │ │ │ │ ├── mld6.h │ │ │ │ │ │ └── nd6.h │ │ │ │ ├── lwip │ │ │ │ │ ├── api.h │ │ │ │ │ ├── api_msg.h │ │ │ │ │ ├── arch.h │ │ │ │ │ ├── debug.h │ │ │ │ │ ├── def.h │ │ │ │ │ ├── dhcp.h │ │ │ │ │ ├── dns.h │ │ │ │ │ ├── err.h │ │ │ │ │ ├── inet_chksum.h │ │ │ │ │ ├── init.h │ │ │ │ │ ├── ip.h │ │ │ │ │ ├── ip_addr.h │ │ │ │ │ ├── mem.h │ │ │ │ │ ├── memp.h │ │ │ │ │ ├── memp_std.h │ │ │ │ │ ├── netbuf.h │ │ │ │ │ ├── netdb.h │ │ │ │ │ ├── netif.h │ │ │ │ │ ├── netifapi.h │ │ │ │ │ ├── opt.h │ │ │ │ │ ├── pbuf.h │ │ │ │ │ ├── raw.h │ │ │ │ │ ├── sio.h │ │ │ │ │ ├── snmp.h │ │ │ │ │ ├── snmp_asn1.h │ │ │ │ │ ├── snmp_msg.h │ │ │ │ │ ├── snmp_structs.h │ │ │ │ │ ├── sockets.h │ │ │ │ │ ├── stats.h │ │ │ │ │ ├── sys.h │ │ │ │ │ ├── tcp.h │ │ │ │ │ ├── tcp_impl.h │ │ │ │ │ ├── tcpip.h │ │ │ │ │ ├── timers.h │ │ │ │ │ └── udp.h │ │ │ │ ├── netif │ │ │ │ │ ├── etharp.h │ │ │ │ │ ├── ppp_oe.h │ │ │ │ │ └── slipif.h │ │ │ │ └── posix │ │ │ │ │ ├── netdb.h │ │ │ │ │ └── sys │ │ │ │ │ └── socket.h │ │ │ └── netif │ │ │ │ ├── FILES │ │ │ │ ├── etharp.c │ │ │ │ ├── ethernetif.c │ │ │ │ ├── ppp │ │ │ │ ├── auth.c │ │ │ │ ├── auth.h │ │ │ │ ├── chap.c │ │ │ │ ├── chap.h │ │ │ │ ├── chpms.c │ │ │ │ ├── chpms.h │ │ │ │ ├── fsm.c │ │ │ │ ├── fsm.h │ │ │ │ ├── ipcp.c │ │ │ │ ├── ipcp.h │ │ │ │ ├── lcp.c │ │ │ │ ├── lcp.h │ │ │ │ ├── magic.c │ │ │ │ ├── magic.h │ │ │ │ ├── md5.c │ │ │ │ ├── md5.h │ │ │ │ ├── pap.c │ │ │ │ ├── pap.h │ │ │ │ ├── ppp.c │ │ │ │ ├── ppp.h │ │ │ │ ├── ppp_impl.h │ │ │ │ ├── ppp_oe.c │ │ │ │ ├── pppdebug.h │ │ │ │ ├── randm.c │ │ │ │ ├── randm.h │ │ │ │ ├── readme.txt │ │ │ │ ├── vj.c │ │ │ │ └── vj.h │ │ │ │ └── slipif.c │ │ └── test │ │ │ └── unit │ │ │ ├── core │ │ │ ├── test_mem.c │ │ │ ├── test_mem.h │ │ │ ├── test_pbuf.c │ │ │ └── test_pbuf.h │ │ │ ├── dhcp │ │ │ ├── test_dhcp.c │ │ │ └── test_dhcp.h │ │ │ ├── etharp │ │ │ ├── test_etharp.c │ │ │ └── test_etharp.h │ │ │ ├── lwip_check.h │ │ │ ├── lwip_unittests.c │ │ │ ├── lwipopts.h │ │ │ ├── tcp │ │ │ ├── tcp_helper.c │ │ │ ├── tcp_helper.h │ │ │ ├── test_tcp.c │ │ │ ├── test_tcp.h │ │ │ ├── test_tcp_oos.c │ │ │ └── test_tcp_oos.h │ │ │ └── udp │ │ │ ├── test_udp.c │ │ │ └── test_udp.h │ ├── misc │ │ ├── BRefTarget.h │ │ ├── Utf16Decoder.h │ │ ├── Utf16Encoder.h │ │ ├── Utf8Decoder.h │ │ ├── Utf8Encoder.h │ │ ├── arp_proto.h │ │ ├── array_length.h │ │ ├── balign.h │ │ ├── balloc.h │ │ ├── blimits.h │ │ ├── bsize.h │ │ ├── bsort.h │ │ ├── bstring.h │ │ ├── byteorder.h │ │ ├── cmdline.h │ │ ├── compare.h │ │ ├── concat_strings.h │ │ ├── cstring.h │ │ ├── dead.h │ │ ├── debug.h │ │ ├── debugcounter.h │ │ ├── debugerror.h │ │ ├── dhcp_proto.h │ │ ├── ethernet_proto.h │ │ ├── exparray.h │ │ ├── expstring.h │ │ ├── find_char.h │ │ ├── find_program.h │ │ ├── get_iface_info.h │ │ ├── grow_array.h │ │ ├── hashfun.h │ │ ├── igmp_proto.h │ │ ├── ipaddr.h │ │ ├── ipaddr6.h │ │ ├── ipv4_proto.h │ │ ├── ipv6_proto.h │ │ ├── loggers_string.h │ │ ├── loglevel.h │ │ ├── maxalign.h │ │ ├── merge.h │ │ ├── minmax.h │ │ ├── modadd.h │ │ ├── mswsock.h │ │ ├── nonblocking.h │ │ ├── nsskey.h │ │ ├── offset.h │ │ ├── open_standard_streams.h │ │ ├── overflow.h │ │ ├── packed.h │ │ ├── parse_number.h │ │ ├── print_macros.h │ │ ├── read_file.h │ │ ├── read_write_int.h │ │ ├── socks_proto.h │ │ ├── sslsocket.h │ │ ├── stdbuf_cmdline.h │ │ ├── strdup.h │ │ ├── string_begins_with.h │ │ ├── substring.h │ │ ├── udp_proto.h │ │ ├── unicode_funcs.h │ │ ├── version.h │ │ └── write_file.h │ ├── ncd-request │ │ ├── CMakeLists.txt │ │ └── ncd-request.c │ ├── ncd │ │ ├── CMakeLists.txt │ │ ├── NCDAst.c │ │ ├── NCDAst.h │ │ ├── NCDBuildProgram.c │ │ ├── NCDBuildProgram.h │ │ ├── NCDConfigParser.c │ │ ├── NCDConfigParser.h │ │ ├── NCDConfigParser_parse.y │ │ ├── NCDConfigTokenizer.c │ │ ├── NCDConfigTokenizer.h │ │ ├── NCDInterpProcess.c │ │ ├── NCDInterpProcess.h │ │ ├── NCDInterpProg.c │ │ ├── NCDInterpProg.h │ │ ├── NCDInterpProg_hash.h │ │ ├── NCDInterpreter.c │ │ ├── NCDInterpreter.h │ │ ├── NCDMethodIndex.c │ │ ├── NCDMethodIndex.h │ │ ├── NCDMethodIndex_hash.h │ │ ├── NCDModule.c │ │ ├── NCDModule.h │ │ ├── NCDModuleIndex.c │ │ ├── NCDModuleIndex.h │ │ ├── NCDModuleIndex_mhash.h │ │ ├── NCDObject.c │ │ ├── NCDObject.h │ │ ├── NCDPlaceholderDb.c │ │ ├── NCDPlaceholderDb.h │ │ ├── NCDStringIndex.c │ │ ├── NCDStringIndex.h │ │ ├── NCDStringIndex_hash.h │ │ ├── NCDSugar.c │ │ ├── NCDSugar.h │ │ ├── NCDVal.c │ │ ├── NCDVal.h │ │ ├── NCDValCons.c │ │ ├── NCDValCons.h │ │ ├── NCDValGenerator.c │ │ ├── NCDValGenerator.h │ │ ├── NCDValParser.c │ │ ├── NCDValParser.h │ │ ├── NCDValParser_parse.y │ │ ├── NCDVal_maptree.h │ │ ├── README │ │ ├── emncd.c │ │ ├── emncd.html │ │ ├── examples │ │ │ ├── dbus_start.ncd │ │ │ ├── dhcpd.conf.template │ │ │ ├── directory_updater.ncd │ │ │ ├── events.ncd │ │ │ ├── igmpproxy.conf.template │ │ │ ├── make_dhcp_config.ncd │ │ │ ├── make_igmpproxy_config.ncd │ │ │ ├── network.ncd │ │ │ ├── onoff_server.ncdi │ │ │ ├── onoff_server_test.ncd │ │ │ ├── tcp_echo_client.ncd │ │ │ └── tcp_echo_server.ncd │ │ ├── extra │ │ │ ├── BEventLock.c │ │ │ ├── BEventLock.h │ │ │ ├── NCDBProcessOpts.c │ │ │ ├── NCDBProcessOpts.h │ │ │ ├── NCDBuf.c │ │ │ ├── NCDBuf.h │ │ │ ├── NCDIfConfig.c │ │ │ ├── NCDIfConfig.h │ │ │ ├── NCDInterfaceMonitor.c │ │ │ ├── NCDInterfaceMonitor.h │ │ │ ├── NCDRequestClient.c │ │ │ ├── NCDRequestClient.h │ │ │ ├── NCDRfkillMonitor.c │ │ │ ├── NCDRfkillMonitor.h │ │ │ ├── address_utils.h │ │ │ ├── build_cmdline.c │ │ │ ├── build_cmdline.h │ │ │ ├── make_fast_names.h │ │ │ └── value_utils.h │ │ ├── include_linux_input.c │ │ ├── make_name_indices.h │ │ ├── modules │ │ │ ├── alias.c │ │ │ ├── arithmetic.c │ │ │ ├── assert.c │ │ │ ├── backtrack.c │ │ │ ├── blocker.c │ │ │ ├── buffer.c │ │ │ ├── buffer_chunks_tree.h │ │ │ ├── call2.c │ │ │ ├── choose.c │ │ │ ├── command_template.c │ │ │ ├── command_template.h │ │ │ ├── concat.c │ │ │ ├── daemon.c │ │ │ ├── depend.c │ │ │ ├── depend_scope.c │ │ │ ├── dynamic_depend.c │ │ │ ├── event_template.c │ │ │ ├── event_template.h │ │ │ ├── exit.c │ │ │ ├── explode.c │ │ │ ├── file.c │ │ │ ├── file_open.c │ │ │ ├── foreach.c │ │ │ ├── from_string.c │ │ │ ├── getargs.c │ │ │ ├── getenv.c │ │ │ ├── if.c │ │ │ ├── imperative.c │ │ │ ├── implode.c │ │ │ ├── index.c │ │ │ ├── list.c │ │ │ ├── load_module.c │ │ │ ├── log.c │ │ │ ├── logical.c │ │ │ ├── modules.h │ │ │ ├── multidepend.c │ │ │ ├── net_backend_badvpn.c │ │ │ ├── net_backend_rfkill.c │ │ │ ├── net_backend_waitdevice.c │ │ │ ├── net_backend_waitlink.c │ │ │ ├── net_backend_wpa_supplicant.c │ │ │ ├── net_dns.c │ │ │ ├── net_iptables.c │ │ │ ├── net_ipv4_addr.c │ │ │ ├── net_ipv4_addr_in_network.c │ │ │ ├── net_ipv4_arp_probe.c │ │ │ ├── net_ipv4_dhcp.c │ │ │ ├── net_ipv4_route.c │ │ │ ├── net_ipv6_addr.c │ │ │ ├── net_ipv6_addr_in_network.c │ │ │ ├── net_ipv6_route.c │ │ │ ├── net_ipv6_wait_dynamic_addr.c │ │ │ ├── net_up.c │ │ │ ├── net_watch_interfaces.c │ │ │ ├── netmask.c │ │ │ ├── ondemand.c │ │ │ ├── parse.c │ │ │ ├── print.c │ │ │ ├── process_manager.c │ │ │ ├── reboot.c │ │ │ ├── ref.c │ │ │ ├── regex_match.c │ │ │ ├── run.c │ │ │ ├── runonce.c │ │ │ ├── sleep.c │ │ │ ├── socket.c │ │ │ ├── spawn.c │ │ │ ├── strcmp.c │ │ │ ├── substr.c │ │ │ ├── sys_evdev.c │ │ │ ├── sys_request_client.c │ │ │ ├── sys_request_server.c │ │ │ ├── sys_start_process.c │ │ │ ├── sys_watch_directory.c │ │ │ ├── sys_watch_input.c │ │ │ ├── sys_watch_usb.c │ │ │ ├── timer.c │ │ │ ├── to_string.c │ │ │ ├── try.c │ │ │ ├── value.c │ │ │ ├── value_maptree.h │ │ │ ├── valuemetic.c │ │ │ └── var.c │ │ ├── ncd.c │ │ ├── ncd.h │ │ ├── parse_linux_input.sh │ │ ├── static_strings.h │ │ └── tests │ │ │ ├── addr_in_network.ncd │ │ │ ├── alias.ncd │ │ │ ├── arithmetic.ncd │ │ │ ├── backtracking.ncd │ │ │ ├── buffer.ncd │ │ │ ├── call.ncd │ │ │ ├── concat.ncd │ │ │ ├── depend.ncd │ │ │ ├── depend_scope.ncd │ │ │ ├── escape_and_nulls.ncd │ │ │ ├── explode.ncd │ │ │ ├── foreach.ncd │ │ │ ├── if.ncd │ │ │ ├── implode.ncd │ │ │ ├── include.ncd │ │ │ ├── include_included.ncdi │ │ │ ├── include_included2.ncdi │ │ │ ├── logical.ncd │ │ │ ├── multidepend.ncd │ │ │ ├── netmask.ncd │ │ │ ├── parse.ncd │ │ │ ├── process_manager.ncd │ │ │ ├── regex.ncd │ │ │ ├── run_tests │ │ │ ├── strings.ncd │ │ │ ├── substr.ncd │ │ │ ├── turing.ncd │ │ │ ├── value.ncd │ │ │ └── value_substr.ncd │ ├── nspr_support │ │ ├── BSSLConnection.c │ │ ├── BSSLConnection.h │ │ ├── CMakeLists.txt │ │ ├── DummyPRFileDesc.c │ │ └── DummyPRFileDesc.h │ ├── predicate │ │ ├── BPredicate.c │ │ ├── BPredicate.h │ │ ├── BPredicate.l │ │ ├── BPredicate.y │ │ ├── BPredicate_internal.h │ │ ├── BPredicate_parser.h │ │ ├── CMakeLists.txt │ │ └── LexMemoryBufferInput.h │ ├── protocol │ │ ├── addr.bproto │ │ ├── addr.h │ │ ├── dataproto.h │ │ ├── fragmentproto.h │ │ ├── msgproto.bproto │ │ ├── msgproto.h │ │ ├── packetproto.h │ │ ├── requestproto.h │ │ ├── scproto.h │ │ ├── spproto.h │ │ └── udpgw_proto.h │ ├── random │ │ ├── BRandom2.c │ │ ├── BRandom2.h │ │ └── CMakeLists.txt │ ├── scripts │ │ ├── cmake │ │ ├── copy_nss │ │ └── toolchain.cmake │ ├── security │ │ ├── BEncryption.c │ │ ├── BEncryption.h │ │ ├── BHash.c │ │ ├── BHash.h │ │ ├── BRandom.c │ │ ├── BRandom.h │ │ ├── BSecurity.c │ │ ├── BSecurity.h │ │ ├── CMakeLists.txt │ │ ├── OTPCalculator.c │ │ ├── OTPCalculator.h │ │ ├── OTPChecker.c │ │ ├── OTPChecker.h │ │ ├── OTPGenerator.c │ │ └── OTPGenerator.h │ ├── server │ │ ├── CMakeLists.txt │ │ ├── badvpn-server.8 │ │ ├── server.c │ │ └── server.h │ ├── server_connection │ │ ├── CMakeLists.txt │ │ ├── SCKeepaliveSource.c │ │ ├── SCKeepaliveSource.h │ │ ├── ServerConnection.c │ │ └── ServerConnection.h │ ├── socksclient │ │ ├── BSocksClient.c │ │ ├── BSocksClient.h │ │ └── CMakeLists.txt │ ├── stringmap │ │ ├── BStringMap.c │ │ ├── BStringMap.h │ │ └── CMakeLists.txt │ ├── structure │ │ ├── BAVL.h │ │ ├── CAvl.h │ │ ├── CAvl_decl.h │ │ ├── CAvl_footer.h │ │ ├── CAvl_header.h │ │ ├── CAvl_impl.h │ │ ├── CHash.h │ │ ├── CHash_decl.h │ │ ├── CHash_footer.h │ │ ├── CHash_header.h │ │ ├── CHash_impl.h │ │ ├── ChunkBuffer2.h │ │ ├── IndexedList.h │ │ ├── IndexedList_tree.h │ │ ├── LinkedList0.h │ │ ├── LinkedList1.h │ │ ├── LinkedList3.h │ │ ├── SAvl.h │ │ ├── SAvl_decl.h │ │ ├── SAvl_footer.h │ │ ├── SAvl_header.h │ │ ├── SAvl_impl.h │ │ ├── SAvl_tree.h │ │ ├── SLinkedList.h │ │ ├── SLinkedList_decl.h │ │ ├── SLinkedList_footer.h │ │ ├── SLinkedList_header.h │ │ └── SLinkedList_impl.h │ ├── system │ │ ├── BAddr.h │ │ ├── BConnection.h │ │ ├── BConnectionGeneric.h │ │ ├── BConnection_unix.c │ │ ├── BConnection_unix.h │ │ ├── BConnection_win.c │ │ ├── BConnection_win.h │ │ ├── BDatagram.h │ │ ├── BDatagram_unix.c │ │ ├── BDatagram_unix.h │ │ ├── BDatagram_win.c │ │ ├── BDatagram_win.h │ │ ├── BInputProcess.c │ │ ├── BInputProcess.h │ │ ├── BLockReactor.c │ │ ├── BLockReactor.h │ │ ├── BNetwork.c │ │ ├── BNetwork.h │ │ ├── BProcess.c │ │ ├── BProcess.h │ │ ├── BReactor.h │ │ ├── BReactor_badvpn.c │ │ ├── BReactor_badvpn.h │ │ ├── BReactor_badvpn_timerstree.h │ │ ├── BReactor_emscripten.c │ │ ├── BReactor_emscripten.h │ │ ├── BReactor_glib.c │ │ ├── BReactor_glib.h │ │ ├── BSignal.c │ │ ├── BSignal.h │ │ ├── BThreadSignal.c │ │ ├── BThreadSignal.h │ │ ├── BTime.c │ │ ├── BTime.h │ │ ├── BUnixSignal.c │ │ ├── BUnixSignal.h │ │ └── CMakeLists.txt │ ├── tests │ │ ├── CMakeLists.txt │ │ ├── bproto_test.bproto │ │ ├── bproto_test.c │ │ ├── chunkbuffer2_test.c │ │ └── threadwork_test.c │ ├── threadwork │ │ ├── BThreadWork.c │ │ ├── BThreadWork.h │ │ └── CMakeLists.txt │ ├── tun2socks │ │ ├── CMakeLists.txt │ │ ├── SocksUdpGwClient.c │ │ ├── SocksUdpGwClient.h │ │ ├── badvpn-tun2socks.8 │ │ ├── tun2socks.c │ │ └── tun2socks.h │ ├── tunctl │ │ ├── CMakeLists.txt │ │ └── tunctl.c │ ├── tuntap │ │ ├── BTap.c │ │ ├── BTap.h │ │ ├── CMakeLists.txt │ │ ├── tapwin32-funcs.c │ │ ├── tapwin32-funcs.h │ │ └── wintap-common.h │ ├── udevmonitor │ │ ├── CMakeLists.txt │ │ ├── NCDUdevCache.c │ │ ├── NCDUdevCache.h │ │ ├── NCDUdevManager.c │ │ ├── NCDUdevManager.h │ │ ├── NCDUdevMonitor.c │ │ ├── NCDUdevMonitor.h │ │ ├── NCDUdevMonitorParser.c │ │ └── NCDUdevMonitorParser.h │ ├── udpgw │ │ ├── CMakeLists.txt │ │ ├── udpgw.c │ │ └── udpgw.h │ └── udpgw_client │ │ ├── CMakeLists.txt │ │ ├── UdpGwClient.c │ │ └── UdpGwClient.h ├── libancillary │ ├── API │ ├── COPYING │ ├── Makefile │ ├── ancillary.h │ ├── fd_recv.c │ ├── fd_send.c │ └── test.c ├── pdnsd │ ├── AUTHORS │ ├── COPYING │ ├── COPYING.BSD │ ├── ChangeLog │ ├── ChangeLog.old │ ├── INSTALL │ ├── Makefile.am │ ├── Makefile.in │ ├── NEWS │ ├── PKGBUILD.in │ ├── README │ ├── README.par │ ├── README.par.old │ ├── THANKS │ ├── TODO │ ├── acconfig.h │ ├── aclocal.m4 │ ├── compile │ ├── config.h │ ├── config.h.in │ ├── configure │ ├── configure.in │ ├── contrib │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── README │ │ ├── change_pdnsd_server_ip.pl │ │ ├── dhcp2pdnsd │ │ └── pdnsd_dhcp.pl │ ├── depcomp │ ├── doc │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── doc_makefile │ │ ├── html │ │ │ ├── dl.html │ │ │ ├── dl.html.in │ │ │ ├── doc.html │ │ │ ├── doc_makefile │ │ │ ├── faq.html │ │ │ ├── htmlsubst.pl │ │ │ └── index.html │ │ ├── html2confman.pl │ │ ├── pdnsd-ctl.8 │ │ ├── pdnsd.8.in │ │ ├── pdnsd.conf.5.in │ │ ├── pdnsd.conf.in │ │ └── txt │ │ │ ├── doc_makefile │ │ │ ├── faq.txt │ │ │ ├── intro.txt │ │ │ └── manual.txt │ ├── file-list.base.in │ ├── install-sh │ ├── missing │ ├── pdnsd.spec.in │ ├── src │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── cache.c │ │ ├── cache.h │ │ ├── conf-keywords.h │ │ ├── conf-parser.c │ │ ├── conf-parser.h │ │ ├── conff.c │ │ ├── conff.h │ │ ├── consts.c │ │ ├── consts.h │ │ ├── debug.c │ │ ├── debug.h │ │ ├── dns.c │ │ ├── dns.h │ │ ├── dns_answer.c │ │ ├── dns_answer.h │ │ ├── dns_query.c │ │ ├── dns_query.h │ │ ├── error.c │ │ ├── error.h │ │ ├── freebsd_netinet_ip_icmp.h │ │ ├── hash.c │ │ ├── hash.h │ │ ├── helpers.c │ │ ├── helpers.h │ │ ├── icmp.c │ │ ├── icmp.h │ │ ├── ipvers.h │ │ ├── list.c │ │ ├── list.h │ │ ├── main.c │ │ ├── make_rr_types_h.pl │ │ ├── netdev.c │ │ ├── netdev.h │ │ ├── pdnsd-ctl │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ └── pdnsd-ctl.c │ │ ├── pdnsd_assert.h │ │ ├── rc │ │ │ ├── ArchLinux │ │ │ │ ├── Makefile.am │ │ │ │ ├── Makefile.in │ │ │ │ └── pdnsd.in │ │ │ ├── Debian │ │ │ │ ├── Makefile.am │ │ │ │ ├── Makefile.in │ │ │ │ └── pdnsd.in │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── README │ │ │ ├── RedHat │ │ │ │ ├── Makefile.am │ │ │ │ ├── Makefile.in │ │ │ │ └── pdnsd.in │ │ │ ├── Slackware │ │ │ │ ├── Makefile.am │ │ │ │ ├── Makefile.in │ │ │ │ └── rc.pdnsd.in │ │ │ └── SuSE │ │ │ │ ├── Makefile.am │ │ │ │ ├── Makefile.in │ │ │ │ └── pdnsd.in │ │ ├── rr_types.c │ │ ├── rr_types.h │ │ ├── rr_types.in │ │ ├── servers.c │ │ ├── servers.h │ │ ├── sort_namevalues.pl │ │ ├── status.c │ │ ├── status.h │ │ ├── test │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── if_up.c │ │ │ ├── is_local_addr.c │ │ │ ├── random.c │ │ │ └── tping.c │ │ ├── thread.c │ │ └── thread.h │ └── version └── system.cpp └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *.o 3 | *.a 4 | *.so 5 | .ycm_extra_conf.pyc 6 | 7 | # built application files 8 | #*.apk 9 | #*.ap_ 10 | 11 | # files for the dex VM 12 | *.dex 13 | 14 | # Java class files 15 | *.class 16 | 17 | # generated files 18 | bin/ 19 | out/ 20 | gen/ 21 | lib/ 22 | obj/ 23 | 24 | # Local configuration file (sdk path, etc) 25 | .idea 26 | .navigation 27 | .gradle 28 | local.properties 29 | ant.properties 30 | project.properties 31 | build.xml 32 | build/ 33 | *.iml 34 | proguard-project.txt 35 | 36 | /libs 37 | /app/src/main/assets/x86/* 38 | /app/src/main/assets/armeabi-v7a/* 39 | /app/src/main/jniLibs/* 40 | /jni/x86/ 41 | /jni/armeabi-v7a/ 42 | 43 | .gradle 44 | gradle/ 45 | gradlew* 46 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "jni/xSocks"] 2 | path = jni/xSocks 3 | url = https://github.com/lparam/xSocks.git 4 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | v1.5.0 (2015-10-21) 2 | ----------- 3 | * Change: rename program 4 | 5 | 6 | v1.4.0 (2015-10-18) 7 | ----------- 8 | * Feature: Protect VpnService 9 | * Change: Black list 10 | 11 | 12 | v1.3.0 (2015-10-9) 13 | ----------- 14 | * Feature: Support ACL 15 | * Feature: Add App Manager 16 | * Change: Adjust Route policy 17 | 18 | 19 | v1.2.2 (2015-9-16) 20 | ----------- 21 | * Hotfix: crypto initialization 22 | 23 | 24 | v1.2.1 (2015-9-12) 25 | ----------- 26 | * Change: update 3rd library to latest 27 | * Change: update appcompat 28 | * Change: update xsocks's arguments 29 | 30 | 31 | v1.2.0 (2015-6-07) 32 | ----------- 33 | * Change: json instead of realm for profile store 34 | * Change: Remove libsuperuser 35 | 36 | 37 | v1.1.7 (2015-5-22) 38 | ----------- 39 | * Change: Remove snackbar action 40 | * Change: Remove redundant code and icon 41 | 42 | 43 | v1.1.6 (2015-5-20) 44 | ----------- 45 | * The first public version. 46 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | LIB_SYSTEM=app/src/main/jniLibs/armeabi/libsystem.so 3 | 4 | all: $(LIB_SYSTEM) 5 | 6 | .PHONY: clean 7 | 8 | clean: 9 | rm -rf libs 10 | rm -rf app/src/main/jniLibs 11 | $(ANDROID_NDK_HOME)/ndk-build clean 12 | 13 | $(LIB_SYSTEM): jni/system.cpp jni/Android.mk 14 | if [ a == a$(ANDROID_NDK_HOME) ]; then \ 15 | echo ANDROID_NDK_HOME is not set ;\ 16 | exit 1 ;\ 17 | fi ;\ 18 | pushd jni/xSocks || exit 1 ;\ 19 | dist-build/android-x86.sh || exit 1 ;\ 20 | dist-build/android-armv7-a.sh || exit 1 ;\ 21 | popd ;\ 22 | pushd jni ;\ 23 | $(ANDROID_NDK_HOME)/ndk-build NDK_LOG=1 V=0 || exit 1 ;\ 24 | popd ;\ 25 | rm -rf app/src/main/assets/x86 ;\ 26 | rm -rf app/src/main/assets/armeabi-v7a ;\ 27 | mkdir -p app/src/main/assets/x86 ;\ 28 | mkdir -p app/src/main/assets/armeabi-v7a ;\ 29 | install -d app/src/main/jniLibs/x86 ;\ 30 | install -d app/src/main/jniLibs/armeabi-v7a ;\ 31 | install libs/x86/pdnsd app/src/main/assets/x86 ;\ 32 | install libs/x86/tun2socks app/src/main/assets/x86 ;\ 33 | install libs/x86/libsystem.so app/src/main/jniLibs/x86 ;\ 34 | install libs/armeabi-v7a/pdnsd app/src/main/assets/armeabi-v7a ;\ 35 | install libs/armeabi-v7a/tun2socks app/src/main/assets/armeabi-v7a ;\ 36 | install libs/armeabi-v7a/libsystem.so app/src/main/jniLibs/armeabi-v7a ;\ 37 | install jni/xSocks/xSocks-android-i686/xSocks app/src/main/assets/x86 ;\ 38 | install jni/xSocks/xSocks-android-i686/xForwarder app/src/main/assets/x86 ;\ 39 | install jni/xSocks/xSocks-android-armv7-a/xSocks app/src/main/assets/armeabi-v7a ;\ 40 | install jni/xSocks/xSocks-android-armv7-a/xForwarder app/src/main/assets/armeabi-v7a ; 41 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # retrolambda 2 | -dontwarn java.lang.invoke.* 3 | 4 | # javadns 5 | -dontwarn org.xbill.DNS.spi.* 6 | 7 | # rxjava 8 | -dontwarn rx.internal.util.unsafe.* 9 | -keep class rx.internal.util.unsafe.** { *; } 10 | 11 | # materialdrawer 12 | -dontwarn com.mikepenz.materialdrawer.* 13 | 14 | # iconics 15 | -dontwarn com.mikepenz.iconics.* 16 | 17 | # gson 18 | -keepattributes Signature 19 | -keepattributes *Annotation* 20 | -keep class sun.misc.Unsafe { *; } 21 | -keep class com.google.gson.** { *; } 22 | 23 | # universal-image-loader 24 | -dontwarn com.nostra13.universalimageloader.** 25 | -keep class com.nostra13.universalimageloader.** { *; } 26 | 27 | # xSocks 28 | -keep class xSocks.model.** { *; } -------------------------------------------------------------------------------- /app/src/androidTest/java/io/github/xSocks/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/aidl/io/github/xSocks/aidl/Config.aidl: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.aidl; 2 | 3 | parcelable Config; 4 | -------------------------------------------------------------------------------- /app/src/main/aidl/io/github/xSocks/aidl/IxSocksService.aidl: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.aidl; 2 | 3 | import io.github.xSocks.aidl.Config; 4 | import io.github.xSocks.aidl.IxSocksServiceCallback; 5 | 6 | interface IxSocksService { 7 | int getState(); 8 | 9 | oneway void registerCallback(IxSocksServiceCallback cb); 10 | oneway void unregisterCallback(IxSocksServiceCallback cb); 11 | 12 | oneway void start(in Config config); 13 | oneway void stop(); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/aidl/io/github/xSocks/aidl/IxSocksServiceCallback.aidl: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.aidl; 2 | 3 | interface IxSocksServiceCallback { 4 | oneway void stateChanged(int state, String msg); 5 | } 6 | -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Iceland.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/app/src/main/assets/fonts/Iceland.ttf -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/System.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks; 2 | 3 | public class System { 4 | static { 5 | java.lang.System.loadLibrary("system"); 6 | } 7 | 8 | public static native void exec(String cmd); 9 | public static native String getABI(); 10 | public static native int sendfd(int fd); 11 | public static native void jniclose(int fd); 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/model/Profiles.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.model; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | public class Profiles { 9 | @SerializedName("profiles") 10 | private List profiles; 11 | 12 | public List getProfiles() { 13 | return profiles; 14 | } 15 | 16 | public Profiles() { 17 | profiles = new ArrayList<>(); 18 | } 19 | 20 | public void remove(int id) { 21 | for (Profile p : profiles) { 22 | if (p.getId() == id) { 23 | profiles.remove(p); 24 | break; 25 | } 26 | } 27 | } 28 | 29 | public Profile getProfile(int id) { 30 | for (Profile p : profiles) { 31 | if (p.getId() == id) { 32 | return p; 33 | } 34 | } 35 | return null; 36 | } 37 | 38 | public int getMaxId() { 39 | int max = 0; 40 | for (Profile p : profiles) { 41 | if (p.getId() > max) { 42 | max = p.getId(); 43 | } 44 | } 45 | return max; 46 | } 47 | 48 | public void addProfile(Profile profile) { 49 | profiles.add(profile); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/model/ProxiedApp.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.model; 2 | 3 | public class ProxiedApp { 4 | private int uid; 5 | private String name; 6 | private String packageName; 7 | private boolean proxied; 8 | 9 | public ProxiedApp(int uid, String name, String packageName, boolean proxied) { 10 | this.uid = uid; 11 | this.name = name; 12 | this.packageName = packageName; 13 | this.proxied = proxied; 14 | } 15 | 16 | public int getId() { 17 | return uid; 18 | } 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public String getPackageName() { 25 | return packageName; 26 | } 27 | 28 | public boolean getProxied() { 29 | return proxied; 30 | } 31 | 32 | public void setProxied(boolean proxied) { 33 | this.proxied = proxied; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/preferences/PasswordEditTextPreference.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.preferences; 2 | 3 | import android.content.Context; 4 | import android.preference.EditTextPreference; 5 | import android.util.AttributeSet; 6 | 7 | public class PasswordEditTextPreference extends EditTextPreference { 8 | private CharSequence mDefaultSummary = getSummary(); 9 | 10 | public PasswordEditTextPreference(Context context, AttributeSet attrs) { 11 | this(context, attrs, android.R.attr.editTextPreferenceStyle); 12 | mDefaultSummary = getSummary(); 13 | } 14 | 15 | public PasswordEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr) { 16 | super(context, attrs, defStyleAttr); 17 | } 18 | 19 | @Override 20 | public void setText(String text) { 21 | super.setText(text); 22 | setSummary(text); 23 | } 24 | 25 | @Override 26 | public void setSummary(CharSequence summary) { 27 | if (summary.toString().isEmpty()) { 28 | super.setSummary(mDefaultSummary); 29 | } else { 30 | StringBuilder sb = new StringBuilder(); 31 | int length = summary.toString().length(); 32 | for(int i = 0; i < length; i++) { 33 | sb.append("*"); 34 | } 35 | super.setSummary(sb.toString()); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/preferences/ProfileEditTextPreference.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.preferences; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.preference.EditTextPreference; 6 | import android.util.AttributeSet; 7 | 8 | import io.github.xSocks.utils.Constants; 9 | 10 | public class ProfileEditTextPreference extends EditTextPreference { 11 | private CharSequence mDefaultSummary = getSummary(); 12 | private Context context; 13 | 14 | public ProfileEditTextPreference(Context context, AttributeSet attrs) { 15 | this(context, attrs, android.R.attr.editTextPreferenceStyle); 16 | mDefaultSummary = getSummary(); 17 | } 18 | 19 | public ProfileEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr) { 20 | super(context, attrs, defStyleAttr); 21 | this.context = context; 22 | } 23 | 24 | @Override 25 | public void setText(String text) { 26 | super.setText(text); 27 | setSummary(text); 28 | } 29 | 30 | @Override 31 | public void setSummary(CharSequence summary) { 32 | if (summary.toString().isEmpty()) { 33 | super.setSummary(mDefaultSummary); 34 | } else { 35 | super.setSummary(summary); 36 | } 37 | context.sendBroadcast(new Intent(Constants.Action.UPDATE_PREFS)); 38 | } 39 | 40 | public void resetSummary(CharSequence summary) { 41 | if (summary.toString().isEmpty()) { 42 | super.setSummary(mDefaultSummary); 43 | } else { 44 | super.setSummary(summary); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/preferences/SummaryEditTextPreference.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.preferences; 2 | 3 | import android.content.Context; 4 | import android.preference.EditTextPreference; 5 | import android.util.AttributeSet; 6 | 7 | public class SummaryEditTextPreference extends EditTextPreference { 8 | private CharSequence mDefaultSummary = getSummary(); 9 | 10 | public SummaryEditTextPreference(Context context, AttributeSet attrs) { 11 | this(context, attrs, android.R.attr.editTextPreferenceStyle); 12 | mDefaultSummary = getSummary(); 13 | } 14 | 15 | public SummaryEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr) { 16 | super(context, attrs, defStyleAttr); 17 | } 18 | 19 | @Override 20 | public void setText(String text) { 21 | super.setText(text); 22 | setSummary(text); 23 | } 24 | 25 | @Override 26 | public void setSummary(CharSequence summary) { 27 | if (summary.toString().isEmpty()) { 28 | super.setSummary(mDefaultSummary); 29 | } else { 30 | super.setSummary(summary); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/preferences/SummaryListPreference.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.preferences; 2 | 3 | import android.content.Context; 4 | import android.preference.ListPreference; 5 | import android.util.AttributeSet; 6 | 7 | public class SummaryListPreference extends ListPreference { 8 | public SummaryListPreference(Context context, AttributeSet attrs) { 9 | super(context, attrs); 10 | } 11 | 12 | @Override 13 | public void setValue(String text) { 14 | super.setValue(text); 15 | CharSequence entry = getEntry(); 16 | if (entry != null) 17 | setSummary(entry); 18 | else 19 | setSummary(text); 20 | } 21 | 22 | @Override 23 | public void setSummary(CharSequence summary) { 24 | if (summary == null || summary.toString().isEmpty()) { 25 | super.setSummary(""); 26 | } else { 27 | super.setSummary(summary); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/ui/AppManagerActivityFragment.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.ui; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.os.Bundle; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import io.github.xSocks.R; 10 | 11 | /** 12 | * A placeholder fragment containing a simple view. 13 | */ 14 | public class AppManagerActivityFragment extends Fragment { 15 | 16 | public AppManagerActivityFragment() { 17 | } 18 | 19 | @Override 20 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 21 | Bundle savedInstanceState) { 22 | return inflater.inflate(R.layout.fragment_app_manager, container, false); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/utils/ConfigUtils.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.utils; 2 | 3 | import android.content.SharedPreferences; 4 | import android.util.Log; 5 | 6 | import io.github.xSocks.aidl.Config; 7 | 8 | public class ConfigUtils { 9 | 10 | public static boolean printToFile(java.io.File file, String content) { 11 | try { 12 | java.io.PrintWriter printer = new java.io.PrintWriter(file); 13 | printer.println(content); 14 | printer.flush(); 15 | return true; 16 | } catch (Exception ex) { 17 | Log.e("XSOCKS", ex.getMessage()); 18 | return false; 19 | } 20 | } 21 | 22 | public static Config load(SharedPreferences settings) { 23 | boolean isGlobalProxy = settings.getBoolean(Constants.Key.isGlobalProxy, false); 24 | boolean isBypassApps = settings.getBoolean(Constants.Key.isBypassApps, false); 25 | boolean isUdpDns = settings.getBoolean(Constants.Key.isUdpDns, false); 26 | 27 | String profileName = settings.getString(Constants.Key.profileName, "Default"); 28 | String proxy = settings.getString(Constants.Key.proxy, ""); 29 | String sitekey = settings.getString(Constants.Key.sitekey, ""); 30 | String route = settings.getString(Constants.Key.route, "all"); 31 | 32 | int remotePort = Integer.parseInt(settings.getString(Constants.Key.remotePort, "1073")); 33 | int localPort = Integer.parseInt(settings.getString(Constants.Key.localPort, "1080")); 34 | 35 | String proxiedAppString = settings.getString(Constants.Key.proxied, ""); 36 | 37 | return new Config(isGlobalProxy, isBypassApps, isUdpDns, profileName, proxy, 38 | sitekey, proxiedAppString, route, remotePort, localPort); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/utils/Console.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.utils; 2 | 3 | public class Console { 4 | 5 | public static void runCommand(String[] cmds) { 6 | for (String cmd : cmds) { 7 | io.github.xSocks.System.exec(cmd); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/utils/MovementCheck.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks.utils; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.text.Spannable; 5 | import android.text.method.LinkMovementMethod; 6 | import android.view.MotionEvent; 7 | import android.widget.TextView; 8 | 9 | public class MovementCheck extends LinkMovementMethod { 10 | 11 | @Override 12 | public boolean onTouchEvent(@NonNull TextView widget, @NonNull Spannable buffer, @NonNull MotionEvent event) { 13 | try { 14 | return super.onTouchEvent(widget, buffer, event); 15 | } catch (Exception ex) { 16 | return true; 17 | } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/xSocksApplication.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks; 2 | 3 | import android.app.Application; 4 | 5 | public class xSocksApplication extends Application { 6 | 7 | @Override 8 | public void onCreate() { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/io/github/xSocks/xSocksReceiver.java: -------------------------------------------------------------------------------- 1 | package io.github.xSocks; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | import android.content.pm.PackageManager; 8 | import android.preference.PreferenceManager; 9 | 10 | import io.github.xSocks.ui.xSocksRunnerActivity; 11 | import io.github.xSocks.utils.Constants; 12 | 13 | public class xSocksReceiver extends BroadcastReceiver{ 14 | @Override 15 | public void onReceive(Context context, Intent intent) { 16 | SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); 17 | SharedPreferences status = context.getSharedPreferences(Constants.Key.status, Context.MODE_PRIVATE); 18 | 19 | String versionName; 20 | try { 21 | versionName = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; 22 | } catch (PackageManager.NameNotFoundException e) { 23 | versionName = null; 24 | } 25 | boolean isAutoConnect = settings.getBoolean(Constants.Key.isAutoConnect, false); 26 | boolean isInstalled = status.getBoolean(versionName, false); 27 | if (isAutoConnect && isInstalled) { 28 | String action = intent.getAction(); 29 | if (action.equals(Intent.ACTION_BOOT_COMPLETED)) { 30 | Intent i = new Intent(context, xSocksRunnerActivity.class); 31 | i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 32 | i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 33 | context.startActivity(i); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/app/src/main/res/drawable-hdpi/ic_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/app/src/main/res/drawable-xhdpi/ic_logo.png -------------------------------------------------------------------------------- /app/src/main/res/layout/apps_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 16 | 17 | 26 | 27 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_app_manager.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/raw/dns_black_list: -------------------------------------------------------------------------------- 1 | .gmail.com, 2 | .google.com, 3 | .google.co.jp, 4 | .android.com, 5 | .gstatic.com, 6 | .googleapis.com, 7 | .googleagmanager.com, 8 | .googleusercontent.com, 9 | .gvt0.com, 10 | .gvt1.com, 11 | .gvt2.com, 12 | .gvt3.com, 13 | 14 | .youtube.com, 15 | .ytimg.com, 16 | .ggpht.com, 17 | .youtube-nocookie.com, 18 | .googlevideo.com, 19 | 20 | .twitter.com, 21 | .twimg.com, 22 | 23 | .facebook.com, 24 | .fbcdn.net, 25 | .akamaihd.net, 26 | 27 | .amazonaws.com, 28 | .cloudfront.net, 29 | 30 | .dropbox.com, 31 | .dropboxstatic.com, 32 | 33 | .feedly.com, 34 | 35 | .t.co, 36 | .bit.ly, 37 | .bitly.com, 38 | .slideshare.net, 39 | .akamai.net, 40 | .edgecastcdn.net, 41 | .appspot.com, 42 | 43 | .blogspot.com, 44 | .blogblog.com, 45 | .blogger.com, 46 | .blogspot.hk, 47 | .blogspot.tw, 48 | .wp.com, 49 | .wordpress.com, 50 | 51 | .zh.wikipedia.org, 52 | .zh.m.wikipedia.org, 53 | 54 | .telegram.org -------------------------------------------------------------------------------- /app/src/main/res/raw/pdnsd_direct: -------------------------------------------------------------------------------- 1 | global { 2 | perm_cache = 2048; 3 | cache_dir = "/data/data/io.github.xSocks"; 4 | server_ip = any; 5 | server_port = %d; 6 | query_method = tcp_only; 7 | run_ipv4 = on; 8 | min_ttl = 15m; 9 | max_ttl = 1w; 10 | timeout = 10; 11 | daemon = off; 12 | } 13 | 14 | server { 15 | label = "china-servers"; 16 | randomize_servers = on; 17 | ip = 114.114.114.114, 18 | 112.124.47.27; 19 | proxy_only=on; 20 | uptest = none; 21 | preset = on; 22 | timeout = 4; 23 | reject_policy = fail; 24 | reject_recursively = on; 25 | policy = included; 26 | exclude = %s; 27 | } 28 | 29 | server { 30 | label = "local-server"; 31 | ip = 127.0.0.1; 32 | port = %d; 33 | proxy_only = on; 34 | uptest = none; 35 | reject = ::/0; 36 | reject_policy = negate; 37 | reject_recursively = on; 38 | policy = excluded; 39 | include = %s; 40 | } 41 | 42 | rr { 43 | name=localhost; 44 | reverse=on; 45 | a=127.0.0.1; 46 | owner=localhost; 47 | soa=localhost,root.localhost,42,86400,900,86400,86400; 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/res/raw/pdnsd_local: -------------------------------------------------------------------------------- 1 | global { 2 | perm_cache = 2048; 3 | cache_dir = "/data/data/io.github.xSocks"; 4 | server_ip = any; 5 | server_port = %d; 6 | query_method = tcp_only; 7 | run_ipv4 = on; 8 | min_ttl = 15m; 9 | max_ttl = 1w; 10 | timeout = 10; 11 | daemon = off; 12 | } 13 | 14 | server { 15 | label = "local-server"; 16 | ip = 127.0.0.1; 17 | port = %d; 18 | reject = ::/0; 19 | reject_policy = negate; 20 | reject_recursively = on; 21 | timeout = 5; 22 | } 23 | 24 | rr { 25 | name=localhost; 26 | reverse=on; 27 | a=127.0.0.1; 28 | owner=localhost; 29 | soa=localhost,root.localhost,42,86400,900,86400,86400; 30 | } -------------------------------------------------------------------------------- /app/src/main/res/raw/route_lan: -------------------------------------------------------------------------------- 1 | 0.0.0.0/8 2 | 10.0.0.0/8 3 | 100.64.0.0/10 4 | 127.0.0.0/8 5 | 169.254.0.0/16 6 | 172.16.0.0/12 7 | 192.0.0.0/29 8 | 192.0.2.0/24 9 | 192.88.99.0/24 10 | 192.168.0.0/16 11 | 198.18.0.0/15 12 | 198.51.100.0/24 13 | 203.0.113.0/24 14 | 224.0.0.0/3 -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/about.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A xSocks client for Android.

6 |

Copyright (C) 2015 lparam

7 |

This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version.

11 |

This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details.

15 |

You should have received a copy of the GNU General Public License 16 | along with this program. If not, see http://www.gnu.org/licenses/.

17 | 18 | ]]> 19 |
20 |
-------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | All 5 | Bypass LAN 6 | Bypass LAN & China 7 | 8 | 9 | 10 | all 11 | bypass-lan 12 | bypass-china 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | #FFFFFF 5 | 6 | #727272 7 | #AAA 8 | #DADADA 9 | #727272 10 | 11 | #4caf50 12 | #388e3c 13 | #1b5e20 14 | #8bc34a 15 | #689f38 16 | #33691e 17 | 18 | @color/sk_material_lightGreen500 19 | 20 | @color/sk_material_lightGreen 21 | @color/sk_material_green500 22 | @color/sk_material_green700 23 | 24 | #ffe2e2e2 25 | #ffeeeeee 26 | #ff6a6a6a 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 72dp 7 | 14sp 8 | 18sp 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.0' 9 | classpath 'me.tatarka:gradle-retrolambda:3.2.3' 10 | // classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2' 11 | classpath 'com.jakewharton:butterknife:6.0.0' 12 | // NOTE: Do not place your application dependencies here; they belong 13 | // in the individual module build.gradle files 14 | } 15 | 16 | // Exclude the version that the android plugin depends on. 17 | configurations.classpath.exclude group: 'com.android.tools.external.lombok' 18 | } 19 | 20 | allprojects { 21 | repositories { 22 | jcenter() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 10 | # 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | #Thu Oct 08 11:01:01 CST 2015 16 | org.gradle.daemon=true 17 | org.gradle.parallel=true 18 | org.gradle.jvmargs=-Xmx1024m 19 | -------------------------------------------------------------------------------- /jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := x86 armeabi-v7a 2 | APP_PLATFORM := android-16 3 | APP_STL := stlport_static 4 | NDK_TOOLCHAIN_VERSION := 4.9 5 | -------------------------------------------------------------------------------- /jni/badvpn/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009, Ambroz Bizjak 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the author nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /jni/badvpn/arpprobe/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(arpprobe BArpProbe.c) 2 | target_link_libraries(arpprobe base system flow) 3 | -------------------------------------------------------------------------------- /jni/badvpn/base/BPending_list.h: -------------------------------------------------------------------------------- 1 | #define SLINKEDLIST_PARAM_NAME BPending__List 2 | #define SLINKEDLIST_PARAM_FEATURE_LAST 0 3 | #define SLINKEDLIST_PARAM_TYPE_ENTRY struct BSmallPending_s 4 | #define SLINKEDLIST_PARAM_MEMBER_NODE pending_node 5 | -------------------------------------------------------------------------------- /jni/badvpn/base/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(BASE_ADDITIONAL_SOURCES) 2 | 3 | if (HAVE_SYSLOG_H) 4 | list(APPEND BASE_ADDITIONAL_SOURCES BLog_syslog.c) 5 | endif () 6 | 7 | set(BASE_SOURCES 8 | DebugObject.c 9 | BLog.c 10 | BPending.c 11 | ${BASE_ADDITIONAL_SOURCES} 12 | ) 13 | badvpn_add_library(base "" "" "${BASE_SOURCES}") 14 | -------------------------------------------------------------------------------- /jni/badvpn/blog_generator/blog_functions.php: -------------------------------------------------------------------------------- 1 | 0) { 7 | if (preg_match('/^\\/\\/.*/', $str, $matches)) { 8 | $str = substr($str, strlen($matches[0])); 9 | } 10 | else if (preg_match('/^\\s+/', $str, $matches)) { 11 | $str = substr($str, strlen($matches[0])); 12 | } 13 | else if (preg_match('/^[0-9]+/', $str, $matches)) { 14 | $out[] = array('number', $matches[0]); 15 | $str = substr($str, strlen($matches[0])); 16 | } 17 | else if (preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*/', $str, $matches)) { 18 | $out[] = array('name', $matches[0]); 19 | $str = substr($str, strlen($matches[0])); 20 | } 21 | else { 22 | return FALSE; 23 | } 24 | } 25 | 26 | return TRUE; 27 | } 28 | 29 | function fatal_error ($message) 30 | { 31 | fwrite(STDERR, "Fatal error: $message\n"); 32 | 33 | ob_get_clean(); 34 | exit(1); 35 | } 36 | -------------------------------------------------------------------------------- /jni/badvpn/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(badvpn-client 2 | client.c 3 | StreamPeerIO.c 4 | DatagramPeerIO.c 5 | PasswordListener.c 6 | DataProto.c 7 | FrameDecider.c 8 | DPRelay.c 9 | DPReceive.c 10 | FragmentProtoDisassembler.c 11 | FragmentProtoAssembler.c 12 | SPProtoEncoder.c 13 | SPProtoDecoder.c 14 | DataProtoKeepaliveSource.c 15 | PeerChat.c 16 | SCOutmsgEncoder.c 17 | SimpleStreamBuffer.c 18 | SinglePacketSource.c 19 | ) 20 | target_link_libraries(badvpn-client system flow flowextra tuntap server_conection security threadwork ${NSPR_LIBRARIES} ${NSS_LIBRARIES}) 21 | 22 | install( 23 | TARGETS badvpn-client 24 | RUNTIME DESTINATION bin 25 | ) 26 | 27 | install( 28 | FILES badvpn-client.8 29 | DESTINATION share/man/man8 30 | ) 31 | -------------------------------------------------------------------------------- /jni/badvpn/client/FragmentProtoAssembler_tree.h: -------------------------------------------------------------------------------- 1 | #define SAVL_PARAM_NAME FPAFramesTree 2 | #define SAVL_PARAM_FEATURE_COUNTS 0 3 | #define SAVL_PARAM_FEATURE_NOKEYS 0 4 | #define SAVL_PARAM_TYPE_ENTRY struct FragmentProtoAssembler_frame 5 | #define SAVL_PARAM_TYPE_KEY fragmentproto_frameid 6 | #define SAVL_PARAM_TYPE_ARG int 7 | #define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) B_COMPARE((entry1)->id, (entry2)->id) 8 | #define SAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) B_COMPARE((key1), (entry2)->id) 9 | #define SAVL_PARAM_MEMBER_NODE tree_node 10 | -------------------------------------------------------------------------------- /jni/badvpn/client/FrameDecider_groups_tree.h: -------------------------------------------------------------------------------- 1 | #define SAVL_PARAM_NAME FDGroupsTree 2 | #define SAVL_PARAM_FEATURE_COUNTS 0 3 | #define SAVL_PARAM_FEATURE_NOKEYS 0 4 | #define SAVL_PARAM_TYPE_ENTRY struct _FrameDecider_group_entry 5 | #define SAVL_PARAM_TYPE_KEY uint32_t 6 | #define SAVL_PARAM_TYPE_ARG int 7 | #define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) B_COMPARE((entry1)->group, (entry2)->group) 8 | #define SAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) B_COMPARE((key1), (entry2)->group) 9 | #define SAVL_PARAM_MEMBER_NODE tree_node 10 | -------------------------------------------------------------------------------- /jni/badvpn/client/FrameDecider_macs_tree.h: -------------------------------------------------------------------------------- 1 | #define SAVL_PARAM_NAME FDMacsTree 2 | #define SAVL_PARAM_FEATURE_COUNTS 0 3 | #define SAVL_PARAM_FEATURE_NOKEYS 0 4 | #define SAVL_PARAM_TYPE_ENTRY struct _FrameDecider_mac_entry 5 | #define SAVL_PARAM_TYPE_KEY FDMacsTree_key 6 | #define SAVL_PARAM_TYPE_ARG int 7 | #define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) compare_macs((entry1)->mac, (entry2)->mac) 8 | #define SAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) compare_macs((key1), (entry2)->mac) 9 | #define SAVL_PARAM_MEMBER_NODE tree_node 10 | -------------------------------------------------------------------------------- /jni/badvpn/client/FrameDecider_multicast_tree.h: -------------------------------------------------------------------------------- 1 | #define SAVL_PARAM_NAME FDMulticastTree 2 | #define SAVL_PARAM_FEATURE_COUNTS 0 3 | #define SAVL_PARAM_FEATURE_NOKEYS 0 4 | #define SAVL_PARAM_TYPE_ENTRY struct _FrameDecider_group_entry 5 | #define SAVL_PARAM_TYPE_KEY uint32_t 6 | #define SAVL_PARAM_TYPE_ARG int 7 | #define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) B_COMPARE((entry1)->master.sig, (entry2)->master.sig) 8 | #define SAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) B_COMPARE((key1), (entry2)->master.sig) 9 | #define SAVL_PARAM_MEMBER_NODE master.tree_node 10 | -------------------------------------------------------------------------------- /jni/badvpn/cmake/modules/COPYING-CMAKE-SCRIPTS: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without 2 | modification, are permitted provided that the following conditions 3 | are met: 4 | 5 | 1. Redistributions of source code must retain the copyright 6 | notice, this list of conditions and the following disclaimer. 7 | 2. Redistributions in binary form must reproduce the copyright 8 | notice, this list of conditions and the following disclaimer in the 9 | documentation and/or other materials provided with the distribution. 10 | 3. The name of the author may not be used to endorse or promote products 11 | derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 15 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 16 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 17 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 18 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 19 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 20 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /jni/badvpn/dhcpclient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(dhcpclientcore 2 | BDHCPClientCore.c 3 | ) 4 | target_link_libraries(dhcpclientcore system flow flowextra badvpn_random) 5 | 6 | if (CMAKE_SYSTEM_NAME STREQUAL "Linux") 7 | add_library(dhcpclient 8 | BDHCPClient.c 9 | DHCPIpUdpEncoder.c 10 | DHCPIpUdpDecoder.c 11 | ) 12 | target_link_libraries(dhcpclient system flow dhcpclientcore) 13 | endif () 14 | -------------------------------------------------------------------------------- /jni/badvpn/dostest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(dostest-server 2 | dostest-server.c 3 | StreamBuffer.c 4 | ) 5 | target_link_libraries(dostest-server base system) 6 | 7 | add_executable(dostest-attacker 8 | dostest-attacker.c 9 | ) 10 | target_link_libraries(dostest-attacker base system) 11 | -------------------------------------------------------------------------------- /jni/badvpn/examples/cavl_test_tree.h: -------------------------------------------------------------------------------- 1 | #define CAVL_PARAM_NAME MyTree 2 | #define CAVL_PARAM_FEATURE_COUNTS USE_COUNTS 3 | #define CAVL_PARAM_FEATURE_KEYS_ARE_INDICES 0 4 | #define CAVL_PARAM_FEATURE_ASSOC USE_ASSOC 5 | #define CAVL_PARAM_TYPE_ENTRY struct entry 6 | #define CAVL_PARAM_TYPE_LINK entry_index 7 | #define CAVL_PARAM_TYPE_KEY entry_key 8 | #define CAVL_PARAM_TYPE_ARG entry_ptr 9 | #define CAVL_PARAM_TYPE_COUNT size_t 10 | #define CAVL_PARAM_TYPE_ASSOC assoc_sum 11 | #define CAVL_PARAM_VALUE_COUNT_MAX SIZE_MAX 12 | #define CAVL_PARAM_VALUE_NULL ((entry_index)-1) 13 | #define CAVL_PARAM_VALUE_ASSOC_ZERO 0 14 | #define CAVL_PARAM_FUN_DEREF(arg, link) (&(arg)[(link)]) 15 | #define CAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) B_COMPARE((entry1).ptr->key, (entry2).ptr->key) 16 | #define CAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) B_COMPARE((key1), (entry2).ptr->key) 17 | #define CAVL_PARAM_FUN_ASSOC_VALUE(arg, entry) ((entry).ptr->assoc_value) 18 | #define CAVL_PARAM_FUN_ASSOC_OPER(arg, value1, value2) ((value1) + (value2)) 19 | #define CAVL_PARAM_MEMBER_CHILD tree_child 20 | #define CAVL_PARAM_MEMBER_BALANCE tree_balance 21 | #define CAVL_PARAM_MEMBER_PARENT tree_parent 22 | #define CAVL_PARAM_MEMBER_COUNT tree_count 23 | #define CAVL_PARAM_MEMBER_ASSOC assoc_sum 24 | -------------------------------------------------------------------------------- /jni/badvpn/examples/savl_test_tree.h: -------------------------------------------------------------------------------- 1 | #define SAVL_PARAM_NAME MyTree 2 | #define SAVL_PARAM_FEATURE_COUNTS 1 3 | #define SAVL_PARAM_FEATURE_NOKEYS 1 4 | #define SAVL_PARAM_TYPE_ENTRY struct mynode 5 | #define SAVL_PARAM_TYPE_ARG int 6 | #define SAVL_PARAM_TYPE_COUNT int 7 | #define SAVL_PARAM_VALUE_COUNT_MAX INT_MAX 8 | #define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) B_COMPARE((entry1)->num, (entry2)->num) 9 | #define SAVL_PARAM_MEMBER_NODE tree_node 10 | -------------------------------------------------------------------------------- /jni/badvpn/fix_flex.php: -------------------------------------------------------------------------------- 1 | ", "#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L"); 7 | $replace = array("", "#if 1"); 8 | $contents = str_replace($search, $replace, $contents); 9 | $res = file_put_contents($filename, $contents); 10 | if ($res === FALSE) exit(1); 11 | -------------------------------------------------------------------------------- /jni/badvpn/flooder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(badvpn-flooder flooder.c) 2 | target_link_libraries(badvpn-flooder system flow server_conection ${NSPR_LIBRARIES} ${NSS_LIBRARIES}) 3 | 4 | install( 5 | TARGETS badvpn-flooder 6 | RUNTIME DESTINATION bin 7 | ) 8 | -------------------------------------------------------------------------------- /jni/badvpn/flow/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(FLOW_SOURCES 2 | PacketPassFairQueue.c 3 | PacketPassPriorityQueue.c 4 | PacketPassConnector.c 5 | PacketRecvConnector.c 6 | StreamRecvConnector.c 7 | PacketRecvBlocker.c 8 | PacketPassNotifier.c 9 | PacketBuffer.c 10 | SinglePacketBuffer.c 11 | PacketCopier.c 12 | PacketStreamSender.c 13 | PacketProtoEncoder.c 14 | PacketProtoDecoder.c 15 | PacketProtoFlow.c 16 | SinglePacketSender.c 17 | BufferWriter.c 18 | PacketPassInterface.c 19 | PacketRecvInterface.c 20 | StreamPassInterface.c 21 | StreamRecvInterface.c 22 | RouteBuffer.c 23 | PacketRouter.c 24 | LineBuffer.c 25 | SingleStreamSender.c 26 | SingleStreamReceiver.c 27 | StreamPacketSender.c 28 | StreamPassConnector.c 29 | PacketPassFifoQueue.c 30 | ) 31 | badvpn_add_library(flow "base" "" "${FLOW_SOURCES}") 32 | -------------------------------------------------------------------------------- /jni/badvpn/flow/PacketPassFairQueue_tree.h: -------------------------------------------------------------------------------- 1 | #define SAVL_PARAM_NAME PacketPassFairQueue__Tree 2 | #define SAVL_PARAM_FEATURE_COUNTS 0 3 | #define SAVL_PARAM_FEATURE_NOKEYS 1 4 | #define SAVL_PARAM_TYPE_ENTRY struct PacketPassFairQueueFlow_s 5 | #define SAVL_PARAM_TYPE_ARG int 6 | #define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) compare_flows((entry1), (entry2)) 7 | #define SAVL_PARAM_MEMBER_NODE queued.tree_node 8 | -------------------------------------------------------------------------------- /jni/badvpn/flow/PacketPassPriorityQueue_tree.h: -------------------------------------------------------------------------------- 1 | #define SAVL_PARAM_NAME PacketPassPriorityQueue__Tree 2 | #define SAVL_PARAM_FEATURE_COUNTS 0 3 | #define SAVL_PARAM_FEATURE_NOKEYS 1 4 | #define SAVL_PARAM_TYPE_ENTRY struct PacketPassPriorityQueueFlow_s 5 | #define SAVL_PARAM_TYPE_ARG int 6 | #define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) compare_flows((entry1), (entry2)) 7 | #define SAVL_PARAM_MEMBER_NODE queued.tree_node 8 | -------------------------------------------------------------------------------- /jni/badvpn/flowextra/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(flowextra 2 | PacketPassInactivityMonitor.c 3 | KeepaliveIO.c 4 | ) 5 | target_link_libraries(flowextra flow system) 6 | -------------------------------------------------------------------------------- /jni/badvpn/generate_files: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | PHP_CMD=( php ) 6 | FLEX_CMD=( flex ) 7 | BISON_CMD=( bison ) 8 | 9 | OUT_DIR="generated/" 10 | 11 | function bproto() { 12 | local input="$1" 13 | local name="$2" 14 | "${PHP_CMD[@]}" bproto_generator/bproto.php --input-file "${input}" --output-dir "${OUT_DIR}" --name "bproto_${name}" 15 | } 16 | 17 | function do_flex() { 18 | local input="$1" 19 | local name="$2" 20 | "${FLEX_CMD[@]}" -o "${OUT_DIR}/flex_${name}.c" --header-file="${OUT_DIR}/flex_${name}.h" "${input}" 21 | "${PHP_CMD[@]}" fix_flex.php "${OUT_DIR}/flex_${name}.c" 22 | "${PHP_CMD[@]}" fix_flex.php "${OUT_DIR}/flex_${name}.h" 23 | } 24 | 25 | function do_bison() { 26 | local input="$1" 27 | local name="$2" 28 | "${BISON_CMD[@]}" -d -o "${OUT_DIR}/bison_${name}.c" "${input}" 29 | } 30 | 31 | function do_lemon() { 32 | local input="$1" 33 | local name=$(basename "${input}") 34 | ( 35 | cd generated && 36 | rm -f "${name}" && 37 | cp ../"${input}" "${name}" && 38 | ../lemon/lemon "${name}" 39 | ) 40 | } 41 | 42 | mkdir -p generated 43 | 44 | bproto tests/bproto_test.bproto bproto_test 45 | bproto protocol/msgproto.bproto msgproto 46 | bproto protocol/addr.bproto addr 47 | do_flex predicate/BPredicate.l BPredicate 48 | do_bison predicate/BPredicate.y BPredicate 49 | "${PHP_CMD[@]}" blog_generator/blog.php --input-file blog_channels.txt --output-dir "${OUT_DIR}" 50 | do_lemon ncd/NCDConfigParser_parse.y 51 | do_lemon ncd/NCDValParser_parse.y 52 | -------------------------------------------------------------------------------- /jni/badvpn/generated/NCDConfigParser_parse.h: -------------------------------------------------------------------------------- 1 | #define INCLUDE 1 2 | #define STRING 2 3 | #define INCLUDE_GUARD 3 4 | #define NAME 4 5 | #define CURLY_OPEN 5 6 | #define CURLY_CLOSE 6 7 | #define ROUND_OPEN 7 8 | #define ROUND_CLOSE 8 9 | #define SEMICOLON 9 10 | #define ARROW 10 11 | #define IF 11 12 | #define FOREACH 12 13 | #define AS 13 14 | #define COLON 14 15 | #define ELIF 15 16 | #define ELSE 16 17 | #define DOT 17 18 | #define COMMA 18 19 | #define BRACKET_OPEN 19 20 | #define BRACKET_CLOSE 20 21 | #define PROCESS 21 22 | #define TEMPLATE 22 23 | -------------------------------------------------------------------------------- /jni/badvpn/generated/NCDValParser_parse.h: -------------------------------------------------------------------------------- 1 | #define COMMA 1 2 | #define CURLY_OPEN 2 3 | #define CURLY_CLOSE 3 4 | #define COLON 4 5 | #define BRACKET_OPEN 5 6 | #define BRACKET_CLOSE 6 7 | #define STRING 7 8 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BArpProbe.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BArpProbe 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BConnection.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BConnection 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BDHCPClient.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BDHCPClient 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BDHCPClientCore.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BDHCPClientCore 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BDatagram.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BDatagram 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BEncryption.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BEncryption 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BInputProcess.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BInputProcess 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BLockReactor.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BLockReactor 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BNetwork.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BNetwork 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BPredicate.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BPredicate 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BProcess.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BProcess 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BReactor.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BReactor 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BSSLConnection.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BSSLConnection 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BSignal.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BSignal 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BSocksClient.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BSocksClient 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BTap.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BTap 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BThreadSignal.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BThreadSignal 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BThreadWork.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BThreadWork 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BTime.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BTime 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_BUnixSignal.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_BUnixSignal 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_DPReceive.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_DPReceive 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_DPRelay.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_DPRelay 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_DataProto.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_DataProto 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_DatagramPeerIO.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_DatagramPeerIO 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_FragmentProtoAssembler.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_FragmentProtoAssembler 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_FrameDecider.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_FrameDecider 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_LineBuffer.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_LineBuffer 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_Listener.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_Listener 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDBuildProgram.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDBuildProgram 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDConfigParser.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDConfigParser 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDConfigTokenizer.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDConfigTokenizer 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDIfConfig.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDIfConfig 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDInterfaceMonitor.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDInterfaceMonitor 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDModuleIndex.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDModuleIndex 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDModuleProcess.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDModuleProcess 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDPlaceholderDb.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDPlaceholderDb 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDRequest.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDRequest 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDRequestClient.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDRequestClient 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDRfkillMonitor.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDRfkillMonitor 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDUdevCache.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDUdevCache 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDUdevManager.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDUdevManager 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDUdevMonitor.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDUdevMonitor 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDUdevMonitorParser.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDUdevMonitorParser 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDVal.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDVal 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDValGenerator.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDValGenerator 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_NCDValParser.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_NCDValParser 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_PRStreamSink.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_PRStreamSink 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_PRStreamSource.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_PRStreamSource 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_PacketProtoDecoder.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_PacketProtoDecoder 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_PasswordListener.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_PasswordListener 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_PeerChat.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_PeerChat 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_SPProtoDecoder.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_SPProtoDecoder 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ServerConnection.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ServerConnection 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_SocksUdpGwClient.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_SocksUdpGwClient 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_StreamPeerIO.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_StreamPeerIO 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_UdpGwClient.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_UdpGwClient 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_addr.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_addr 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_client.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_client 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_dostest_attacker.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_dostest_attacker 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_dostest_server.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_dostest_server 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_flooder.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_flooder 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_lwip.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_lwip 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_alias.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_alias 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_arithmetic.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_arithmetic 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_assert.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_assert 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_backtrack.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_backtrack 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_blocker.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_blocker 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_buffer.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_buffer 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_call2.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_call2 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_choose.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_choose 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_concat.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_concat 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_daemon.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_daemon 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_depend.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_depend 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_depend_scope.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_depend_scope 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_dynamic_depend.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_dynamic_depend 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_exit.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_exit 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_explode.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_explode 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_file.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_file 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_file_open.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_file_open 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_foreach.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_foreach 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_from_string.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_from_string 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_getargs.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_getargs 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_getenv.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_getenv 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_if.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_if 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_imperative.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_imperative 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_implode.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_implode 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_index.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_index 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_list.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_list 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_load_module.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_load_module 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_log.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_log 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_log_msg.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_log_msg 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_logical.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_logical 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_multidepend.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_multidepend 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_backend_badvpn.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_backend_badvpn 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_backend_rfkill.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_backend_rfkill 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_backend_waitdevice.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_backend_waitdevice 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_backend_waitlink.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_backend_waitlink 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_backend_wpa_supplicant.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_backend_wpa_supplicant 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_dns.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_dns 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_iptables.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_iptables 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_ipv4_addr.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_ipv4_addr 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_ipv4_addr_in_network.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_ipv4_addr_in_network 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_ipv4_arp_probe.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_ipv4_arp_probe 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_ipv4_dhcp.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_ipv4_dhcp 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_ipv4_route.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_ipv4_route 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_ipv6_addr.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_ipv6_addr 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_ipv6_addr_in_network.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_ipv6_addr_in_network 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_ipv6_route.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_ipv6_route 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_ipv6_wait_dynamic_addr.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_ipv6_wait_dynamic_addr 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_up.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_up 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_net_watch_interfaces.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_net_watch_interfaces 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_netmask.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_netmask 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_ondemand.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_ondemand 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_parse.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_parse 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_print.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_print 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_process_manager.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_process_manager 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_reboot.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_reboot 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_ref.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_ref 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_regex_match.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_regex_match 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_request.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_request 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_run.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_run 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_runonce.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_runonce 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_sleep.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_sleep 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_socket.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_socket 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_spawn.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_spawn 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_strcmp.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_strcmp 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_substr.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_substr 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_sys_evdev.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_sys_evdev 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_sys_request_client.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_sys_request_client 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_sys_request_server.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_sys_request_server 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_sys_start_process.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_sys_start_process 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_sys_watch_directory.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_sys_watch_directory 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_sys_watch_input.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_sys_watch_input 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_sys_watch_usb.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_sys_watch_usb 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_timer.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_timer 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_to_string.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_to_string 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_try.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_try 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_value.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_value 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_valuemetic.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_valuemetic 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_ncd_var.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_ncd_var 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_nsskey.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_nsskey 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_server.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_server 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_tun2socks.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_tun2socks 5 | -------------------------------------------------------------------------------- /jni/badvpn/generated/blog_channel_udpgw.h: -------------------------------------------------------------------------------- 1 | #ifdef BLOG_CURRENT_CHANNEL 2 | #undef BLOG_CURRENT_CHANNEL 3 | #endif 4 | #define BLOG_CURRENT_CHANNEL BLOG_CHANNEL_udpgw 5 | -------------------------------------------------------------------------------- /jni/badvpn/lime/flex_token_stream.php: -------------------------------------------------------------------------------- 1 | executable(); 17 | $tokens = explode("\0", `$scanner < "\$PHP_LIME_SCAN_STDIN"`); 18 | array_pop($tokens); 19 | $this->tokens = $tokens; 20 | $this->lineno = 1; 21 | } 22 | function next() { 23 | if (list($key, $token) = each($this->tokens)) { 24 | list($this->lineno, $type, $text) = explode("\1", $token); 25 | return array($type, $text); 26 | } 27 | } 28 | function feed($parser) { 29 | while (list($type, $text) = $this->next()) { 30 | $parser->eat($type, $text); 31 | } 32 | return $parser->eat_eof(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /jni/badvpn/lime/lime.bootstrap: -------------------------------------------------------------------------------- 1 | There is nothing to see here. Go and look at the file called "metagrammar". 2 | 3 | : $$ = new lime(); 4 | grammar pragma toklist stop : $$->pragma($2, $3); 5 | grammar rewrite stop : $2->update($$); 6 | to grammar 7 | : {$$=array();} 8 | toklist sym : $$[] = $2; 9 | toklist lit : $$[] = $2; 10 | to toklist 11 | sym '=' rhs : $$ = new lime_rewrite($1); $$->add_rhs($3); 12 | rewrite '|' rhs : $$->add_rhs($3); 13 | to rewrite 14 | list : $$ = new lime_rhs($1, ''); 15 | list action : $$ = new lime_rhs($1, $2); 16 | to rhs 17 | action : $$ = new lime_action($1, NULL); 18 | action lambda : $$ = new lime_action($1, $2); 19 | sym : $$ = new lime_glyph($1, NULL); 20 | sym lambda : $$ = new lime_glyph($1, $2); 21 | lit : $$ = new lime_glyph($1, NULL); 22 | to slot 23 | : $$ = new lime_rhs(); 24 | rhs slot : $$->add($2); 25 | to rhs 26 | '{' code '}' : $$ = $2; 27 | to action 28 | : 29 | code php : $$.=$2; 30 | code '{' code '}' : $$.='{'.$3.'}'; 31 | to code 32 | -------------------------------------------------------------------------------- /jni/badvpn/lime/set.so.php: -------------------------------------------------------------------------------- 1 | data = array_count_values($list); } 11 | function has($item) { return isset($this->data[$item]); } 12 | function add($item) { $this->data[$item] = true; } 13 | function del($item) { unset($this->data[$item]); return $item;} 14 | function all() { return array_keys($this->data); } 15 | function one() { return key($this->data); } 16 | function count() { return count($this->data); } 17 | function pop() { return $this->del($this->one()); } 18 | function union($that) { 19 | $progress = false; 20 | foreach ($that->all() as $item) if (!$this->has($item)) { 21 | $this->add($item); 22 | $progress = true; 23 | } 24 | return $progress; 25 | } 26 | function text() { 27 | return ' { '.implode(' ', $this->all()).' } '; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/jni/badvpn/lwip/CHANGELOG -------------------------------------------------------------------------------- /jni/badvpn/lwip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(lwip 2 | src/core/timers.c 3 | src/core/udp.c 4 | src/core/memp.c 5 | src/core/init.c 6 | src/core/pbuf.c 7 | src/core/tcp.c 8 | src/core/tcp_out.c 9 | src/core/sys.c 10 | src/core/netif.c 11 | src/core/def.c 12 | src/core/mem.c 13 | src/core/tcp_in.c 14 | src/core/stats.c 15 | src/core/inet_chksum.c 16 | src/core/ipv4/icmp.c 17 | src/core/ipv4/ip4.c 18 | src/core/ipv4/ip4_addr.c 19 | src/core/ipv4/ip_frag.c 20 | src/core/ipv6/ip6.c 21 | src/core/ipv6/nd6.c 22 | src/core/ipv6/icmp6.c 23 | src/core/ipv6/ip6_addr.c 24 | src/core/ipv6/ip6_frag.c 25 | custom/sys.c 26 | ) 27 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/COPYING: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | 34 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/FILES: -------------------------------------------------------------------------------- 1 | src/ - The source code for the lwIP TCP/IP stack. 2 | doc/ - The documentation for lwIP. 3 | 4 | See also the FILES file in each subdirectory. 5 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/custom/arch/perf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file perf.h 3 | * @author Ambroz Bizjak 4 | * 5 | * @section LICENSE 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the author nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef LWIP_CUSTOM_PERF_H 31 | #define LWIP_CUSTOM_PERF_H 32 | 33 | #define PERF_START 34 | #define PERF_STOP(x) 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/custom/sys.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file sys.c 3 | * @author Ambroz Bizjak 4 | * 5 | * @section LICENSE 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the author nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | 34 | u32_t sys_now (void) 35 | { 36 | return btime_gettime(); 37 | } 38 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/doc/FILES: -------------------------------------------------------------------------------- 1 | savannah.txt - How to obtain the current development source code. 2 | contrib.txt - How to contribute to lwIP as a developer. 3 | rawapi.txt - The documentation for the core API of lwIP. 4 | Also provides an overview about the other APIs and multithreading. 5 | snmp_agent.txt - The documentation for the lwIP SNMP agent. 6 | sys_arch.txt - The documentation for a system abstraction layer of lwIP. 7 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/lwip-base-version: -------------------------------------------------------------------------------- 1 | 666e84eef281d0059377d0f5029c1c550488f829 2 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/src/FILES: -------------------------------------------------------------------------------- 1 | api/ - The code for the high-level wrapper API. Not needed if 2 | you use the lowel-level call-back/raw API. 3 | 4 | core/ - The core of the TPC/IP stack; protocol implementations, 5 | memory and buffer management, and the low-level raw API. 6 | 7 | include/ - lwIP include files. 8 | 9 | netif/ - Generic network interface device drivers are kept here, 10 | as well as the ARP module. 11 | 12 | For more information on the various subdirectories, check the FILES 13 | file in each directory. 14 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/src/core/ipv6/README: -------------------------------------------------------------------------------- 1 | IPv6 support in lwIP is very experimental. 2 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/src/include/posix/netdb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/netdb.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/netdb.h" 34 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/src/include/posix/sys/socket.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/sockets.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/sockets.h" 34 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/src/netif/FILES: -------------------------------------------------------------------------------- 1 | This directory contains generic network interface device drivers that 2 | do not contain any hardware or architecture specific code. The files 3 | are: 4 | 5 | etharp.c 6 | Implements the ARP (Address Resolution Protocol) over 7 | Ethernet. The code in this file should be used together with 8 | Ethernet device drivers. Note that this module has been 9 | largely made Ethernet independent so you should be able to 10 | adapt this for other link layers (such as Firewire). 11 | 12 | ethernetif.c 13 | An example of how an Ethernet device driver could look. This 14 | file can be used as a "skeleton" for developing new Ethernet 15 | network device drivers. It uses the etharp.c ARP code. 16 | 17 | loopif.c 18 | A "loopback" network interface driver. It requires configuration 19 | through the define LWIP_LOOPIF_MULTITHREADING (see opt.h). 20 | 21 | slipif.c 22 | A generic implementation of the SLIP (Serial Line IP) 23 | protocol. It requires a sio (serial I/O) module to work. 24 | 25 | ppp/ Point-to-Point Protocol stack 26 | The PPP stack has been ported from ucip (http://ucip.sourceforge.net). 27 | It matches quite well to pppd 2.3.1 (http://ppp.samba.org), although 28 | compared to that, it has some modifications for embedded systems and 29 | the source code has been reordered a bit. -------------------------------------------------------------------------------- /jni/badvpn/lwip/src/netif/ppp/readme.txt: -------------------------------------------------------------------------------- 1 | About the PPP code: 2 | 3 | The PPP code is not our "own" code - we just copied it from pppd (http://ppp.samba.org/) and adapted it to lwIP. 4 | Unfortunately, not many here know their way around it too well. Back in 2009, we took the effort to see which 5 | version of pppd our code relates to and we're pretty much on 2.3.11 with some bugs from 2.4.x backported. 6 | 7 | Aside from simple code adaptions, there are some files that are different, however: 8 | - chpms.c/.h are named chap_ms.c/.h in the original pppd 2.3.11 sources 9 | - pap.c/.h are named upap.c/.h in the original pppd 2.3.11 sources 10 | - randm.c is a random generator not included in the original pppd 11 | - magic.c does not use the C library's random functions, but uses randm.c instead 12 | - vj.c/.h is an implementation of the Van Jacobson header compression algorithm adapted to lwIP pbufs, 13 | probably copied from one of the vjcompress.c files from pppd. 14 | - ppp.c, ppp.h and ppp_impl.h contain the adaption from pppd to lwIP. This is the "OS"-dependent part like there 15 | is an implementation for linux, xBSD etc. in the pppd sources. 16 | - ppp_oe.c is Marc Boucher's implementation based on NetBSD's if_pppoe.c 17 | 18 | There is of course potential for bugs in it, but when analyzing of reporting bugs, it is strongly encouraged to 19 | compare the code in question to pppd 2.3.11 (our basis) and newer versions (perhaps it's already fixed?) and to 20 | share this knowledge with us when reporting a bug. 21 | 22 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/core/test_mem.c: -------------------------------------------------------------------------------- 1 | #include "test_mem.h" 2 | 3 | #include "lwip/mem.h" 4 | #include "lwip/stats.h" 5 | 6 | #if !LWIP_STATS || !MEM_STATS 7 | #error "This tests needs MEM-statistics enabled" 8 | #endif 9 | #if LWIP_DNS 10 | #error "This test needs DNS turned off (as it mallocs on init)" 11 | #endif 12 | 13 | /* Setups/teardown functions */ 14 | 15 | static void 16 | mem_setup(void) 17 | { 18 | } 19 | 20 | static void 21 | mem_teardown(void) 22 | { 23 | } 24 | 25 | 26 | /* Test functions */ 27 | 28 | /** Call mem_malloc, mem_free and mem_trim and check stats */ 29 | START_TEST(test_mem_one) 30 | { 31 | #define SIZE1 16 32 | #define SIZE1_2 12 33 | #define SIZE2 16 34 | void *p1, *p2; 35 | mem_size_t s1, s2; 36 | LWIP_UNUSED_ARG(_i); 37 | 38 | #if LWIP_DNS 39 | fail("This test needs DNS turned off (as it mallocs on init)"); 40 | #endif 41 | 42 | fail_unless(lwip_stats.mem.used == 0); 43 | 44 | p1 = mem_malloc(SIZE1); 45 | fail_unless(p1 != NULL); 46 | fail_unless(lwip_stats.mem.used >= SIZE1); 47 | s1 = lwip_stats.mem.used; 48 | 49 | p2 = mem_malloc(SIZE2); 50 | fail_unless(p2 != NULL); 51 | fail_unless(lwip_stats.mem.used >= SIZE2 + s1); 52 | s2 = lwip_stats.mem.used; 53 | 54 | mem_trim(p1, SIZE1_2); 55 | 56 | mem_free(p2); 57 | fail_unless(lwip_stats.mem.used <= s2 - SIZE2); 58 | 59 | mem_free(p1); 60 | fail_unless(lwip_stats.mem.used == 0); 61 | } 62 | END_TEST 63 | 64 | 65 | /** Create the suite including all tests for this module */ 66 | Suite * 67 | mem_suite(void) 68 | { 69 | TFun tests[] = { 70 | test_mem_one 71 | }; 72 | return create_suite("MEM", tests, sizeof(tests)/sizeof(TFun), mem_setup, mem_teardown); 73 | } 74 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/core/test_mem.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_MEM_H__ 2 | #define __TEST_MEM_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *mem_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/core/test_pbuf.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_PBUF_H__ 2 | #define __TEST_PBUF_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *pbuf_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/dhcp/test_dhcp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_DHCP_H__ 2 | #define __TEST_DHCP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* dhcp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/etharp/test_etharp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_ETHARP_H__ 2 | #define __TEST_ETHARP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* etharp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/lwip_check.h: -------------------------------------------------------------------------------- 1 | #ifndef __LWIP_CHECK_H__ 2 | #define __LWIP_CHECK_H__ 3 | 4 | /* Common header file for lwIP unit tests using the check framework */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define FAIL_RET() do { fail(); return; } while(0) 11 | #define EXPECT(x) fail_unless(x) 12 | #define EXPECT_RET(x) do { fail_unless(x); if(!(x)) { return; }} while(0) 13 | #define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0) 14 | #define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL) 15 | 16 | /** typedef for a function returning a test suite */ 17 | typedef Suite* (suite_getter_fn)(void); 18 | 19 | /** Create a test suite */ 20 | static Suite* create_suite(const char* name, TFun *tests, size_t num_tests, SFun setup, SFun teardown) 21 | { 22 | size_t i; 23 | Suite *s = suite_create(name); 24 | 25 | for(i = 0; i < num_tests; i++) { 26 | /* Core test case */ 27 | TCase *tc_core = tcase_create("Core"); 28 | if ((setup != NULL) || (teardown != NULL)) { 29 | tcase_add_checked_fixture(tc_core, setup, teardown); 30 | } 31 | tcase_add_test(tc_core, tests[i]); 32 | suite_add_tcase(s, tc_core); 33 | } 34 | return s; 35 | } 36 | 37 | #endif /* __LWIP_CHECK_H__ */ 38 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/lwip_unittests.c: -------------------------------------------------------------------------------- 1 | #include "lwip_check.h" 2 | 3 | #include "udp/test_udp.h" 4 | #include "tcp/test_tcp.h" 5 | #include "tcp/test_tcp_oos.h" 6 | #include "core/test_mem.h" 7 | #include "core/test_pbuf.h" 8 | #include "etharp/test_etharp.h" 9 | #include "dhcp/test_dhcp.h" 10 | 11 | #include "lwip/init.h" 12 | 13 | 14 | int main() 15 | { 16 | int number_failed; 17 | SRunner *sr; 18 | size_t i; 19 | suite_getter_fn* suites[] = { 20 | udp_suite, 21 | tcp_suite, 22 | tcp_oos_suite, 23 | mem_suite, 24 | pbuf_suite, 25 | etharp_suite, 26 | dhcp_suite 27 | }; 28 | size_t num = sizeof(suites)/sizeof(void*); 29 | LWIP_ASSERT("No suites defined", num > 0); 30 | 31 | lwip_init(); 32 | 33 | sr = srunner_create((suites[0])()); 34 | for(i = 1; i < num; i++) { 35 | srunner_add_suite(sr, ((suite_getter_fn*)suites[i])()); 36 | } 37 | 38 | #ifdef LWIP_UNITTESTS_NOFORK 39 | srunner_set_fork_status(sr, CK_NOFORK); 40 | #endif 41 | #ifdef LWIP_UNITTESTS_FORK 42 | srunner_set_fork_status(sr, CK_FORK); 43 | #endif 44 | 45 | srunner_run_all(sr, CK_NORMAL); 46 | number_failed = srunner_ntests_failed(sr); 47 | srunner_free(sr); 48 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 49 | } 50 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/tcp/test_tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_H__ 2 | #define __TEST_TCP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/tcp/test_tcp_oos.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_OOS_H__ 2 | #define __TEST_TCP_OOS_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_oos_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/udp/test_udp.c: -------------------------------------------------------------------------------- 1 | #include "test_udp.h" 2 | 3 | #include "lwip/udp.h" 4 | #include "lwip/stats.h" 5 | 6 | #if !LWIP_STATS || !UDP_STATS || !MEMP_STATS 7 | #error "This tests needs UDP- and MEMP-statistics enabled" 8 | #endif 9 | 10 | /* Helper functions */ 11 | static void 12 | udp_remove_all(void) 13 | { 14 | struct udp_pcb *pcb = udp_pcbs; 15 | struct udp_pcb *pcb2; 16 | 17 | while(pcb != NULL) { 18 | pcb2 = pcb; 19 | pcb = pcb->next; 20 | udp_remove(pcb2); 21 | } 22 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 23 | } 24 | 25 | /* Setups/teardown functions */ 26 | 27 | static void 28 | udp_setup(void) 29 | { 30 | udp_remove_all(); 31 | } 32 | 33 | static void 34 | udp_teardown(void) 35 | { 36 | udp_remove_all(); 37 | } 38 | 39 | 40 | /* Test functions */ 41 | 42 | START_TEST(test_udp_new_remove) 43 | { 44 | struct udp_pcb* pcb; 45 | LWIP_UNUSED_ARG(_i); 46 | 47 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 48 | 49 | pcb = udp_new(); 50 | fail_unless(pcb != NULL); 51 | if (pcb != NULL) { 52 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 1); 53 | udp_remove(pcb); 54 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 55 | } 56 | } 57 | END_TEST 58 | 59 | 60 | /** Create the suite including all tests for this module */ 61 | Suite * 62 | udp_suite(void) 63 | { 64 | TFun tests[] = { 65 | test_udp_new_remove, 66 | }; 67 | return create_suite("UDP", tests, sizeof(tests)/sizeof(TFun), udp_setup, udp_teardown); 68 | } 69 | -------------------------------------------------------------------------------- /jni/badvpn/lwip/test/unit/udp/test_udp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_UDP_H__ 2 | #define __TEST_UDP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* udp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /jni/badvpn/misc/merge.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file merge.h 3 | * @author Ambroz Bizjak 4 | * 5 | * @section LICENSE 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the author nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef BADVPN_MERGE_H 31 | #define BADVPN_MERGE_H 32 | 33 | #define MERGE_HELPER(x, y) x ## y 34 | #define MERGE(x, y) MERGE_HELPER(x, y) 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /jni/badvpn/ncd-request/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(badvpn-ncd-request 2 | ncd-request.c 3 | ) 4 | target_link_libraries(badvpn-ncd-request ncdrequest ncdvalgenerator ncdvalparser) 5 | 6 | install( 7 | TARGETS badvpn-ncd-request 8 | RUNTIME DESTINATION bin 9 | ) 10 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/NCDInterpProg_hash.h: -------------------------------------------------------------------------------- 1 | #define CHASH_PARAM_NAME NCDInterpProg__Hash 2 | #define CHASH_PARAM_ENTRY NCDInterpProg__hashentry 3 | #define CHASH_PARAM_LINK int 4 | #define CHASH_PARAM_KEY NCD_string_id_t 5 | #define CHASH_PARAM_ARG NCDInterpProg__hasharg 6 | #define CHASH_PARAM_NULL ((int)-1) 7 | #define CHASH_PARAM_DEREF(arg, link) (&(arg)[(link)]) 8 | #define CHASH_PARAM_ENTRYHASH(arg, entry) ((size_t)(entry).ptr->name) 9 | #define CHASH_PARAM_KEYHASH(arg, key) ((size_t)(key)) 10 | #define CHASH_PARAM_COMPARE_ENTRIES(arg, entry1, entry2) ((entry1).ptr->name == (entry2).ptr->name) 11 | #define CHASH_PARAM_COMPARE_KEY_ENTRY(arg, key1, entry2) ((key1) == (entry2).ptr->name) 12 | #define CHASH_PARAM_ENTRY_NEXT hash_next 13 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/NCDMethodIndex_hash.h: -------------------------------------------------------------------------------- 1 | #define CHASH_PARAM_NAME NCDMethodIndex__Hash 2 | #define CHASH_PARAM_ENTRY NCDMethodIndex__hashentry 3 | #define CHASH_PARAM_LINK int 4 | #define CHASH_PARAM_KEY NCDMethodIndex__hashkey 5 | #define CHASH_PARAM_ARG NCDMethodIndex__hasharg 6 | #define CHASH_PARAM_NULL ((int)-1) 7 | #define CHASH_PARAM_DEREF(arg, link) (&(arg)[(link)]) 8 | #define CHASH_PARAM_ENTRYHASH(arg, entry) (badvpn_djb2_hash((const uint8_t *)(entry).ptr->method_name)) 9 | #define CHASH_PARAM_KEYHASH(arg, key) (badvpn_djb2_hash((const uint8_t *)(key))) 10 | #define CHASH_PARAM_COMPARE_ENTRIES(arg, entry1, entry2) (!strcmp((entry1).ptr->method_name, (entry2).ptr->method_name)) 11 | #define CHASH_PARAM_COMPARE_KEY_ENTRY(arg, key1, entry2) (!strcmp((key1), (entry2).ptr->method_name)) 12 | #define CHASH_PARAM_ENTRY_NEXT hash_next 13 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/NCDModuleIndex_mhash.h: -------------------------------------------------------------------------------- 1 | #define CHASH_PARAM_NAME NCDModuleIndex__MHash 2 | #define CHASH_PARAM_ENTRY struct NCDModuleIndex_module 3 | #define CHASH_PARAM_LINK NCDModuleIndex__mhash_link 4 | #define CHASH_PARAM_KEY NCDModuleIndex__mhash_key 5 | #define CHASH_PARAM_ARG int 6 | #define CHASH_PARAM_NULL ((NCDModuleIndex__mhash_link)NULL) 7 | #define CHASH_PARAM_DEREF(arg, link) (link) 8 | #define CHASH_PARAM_ENTRYHASH(arg, entry) (badvpn_djb2_hash((const uint8_t *)(entry).ptr->imodule.module.type)) 9 | #define CHASH_PARAM_KEYHASH(arg, key) (badvpn_djb2_hash((const uint8_t *)(key))) 10 | #define CHASH_PARAM_COMPARE_ENTRIES(arg, entry1, entry2) (!strcmp((entry1).ptr->imodule.module.type, (entry2).ptr->imodule.module.type)) 11 | #define CHASH_PARAM_COMPARE_KEY_ENTRY(arg, key1, entry2) (!strcmp((key1), (entry2).ptr->imodule.module.type)) 12 | #define CHASH_PARAM_ENTRY_NEXT hash_next 13 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/NCDStringIndex_hash.h: -------------------------------------------------------------------------------- 1 | #define CHASH_PARAM_NAME NCDStringIndex__Hash 2 | #define CHASH_PARAM_ENTRY struct NCDStringIndex__entry 3 | #define CHASH_PARAM_LINK NCD_string_id_t 4 | #define CHASH_PARAM_KEY NCDStringIndex_hash_key 5 | #define CHASH_PARAM_ARG NCDStringIndex_hash_arg 6 | #define CHASH_PARAM_NULL ((NCD_string_id_t)-1) 7 | #define CHASH_PARAM_DEREF(arg, link) (&(arg)[(link)]) 8 | #define CHASH_PARAM_ENTRYHASH(arg, entry) badvpn_djb2_hash_bin((const uint8_t *)(entry).ptr->str, (entry).ptr->str_len) 9 | #define CHASH_PARAM_KEYHASH(arg, key) badvpn_djb2_hash_bin((const uint8_t *)(key).str, (key).len) 10 | #define CHASH_PARAM_ENTRYHASH_IS_CHEAP 0 11 | #define CHASH_PARAM_COMPARE_ENTRIES(arg, entry1, entry2) ((entry1).ptr->str_len == (entry2).ptr->str_len && !memcmp((entry1).ptr->str, (entry2).ptr->str, (entry1).ptr->str_len)) 12 | #define CHASH_PARAM_COMPARE_KEY_ENTRY(arg, key1, entry2) ((key1).len == (entry2).ptr->str_len && !memcmp((key1).str, (entry2).ptr->str, (key1).len)) 13 | #define CHASH_PARAM_ENTRY_NEXT hash_next 14 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/NCDVal_maptree.h: -------------------------------------------------------------------------------- 1 | #define CAVL_PARAM_NAME NCDVal__MapTree 2 | #define CAVL_PARAM_FEATURE_COUNTS 0 3 | #define CAVL_PARAM_FEATURE_KEYS_ARE_INDICES 0 4 | #define CAVL_PARAM_FEATURE_NOKEYS 0 5 | #define CAVL_PARAM_TYPE_ENTRY NCDVal__maptree_entry 6 | #define CAVL_PARAM_TYPE_LINK NCDVal__idx 7 | #define CAVL_PARAM_TYPE_KEY NCDValRef 8 | #define CAVL_PARAM_TYPE_ARG NCDVal__maptree_arg 9 | #define CAVL_PARAM_VALUE_NULL ((NCDVal__idx)-1) 10 | #define CAVL_PARAM_FUN_DEREF(arg, link) ((struct NCDVal__mapelem *)NCDValMem__BufAt((arg), (link))) 11 | #define CAVL_PARAM_FUN_COMPARE_ENTRIES(arg, node1, node2) NCDVal_Compare(NCDVal__Ref((arg), (node1).ptr->key_idx), NCDVal__Ref((arg), (node2).ptr->key_idx)) 12 | #define CAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, node2) NCDVal_Compare((key1), NCDVal__Ref((arg), (node2).ptr->key_idx)) 13 | #define CAVL_PARAM_MEMBER_CHILD tree_child 14 | #define CAVL_PARAM_MEMBER_BALANCE tree_balance 15 | #define CAVL_PARAM_MEMBER_PARENT tree_parent 16 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/examples/dhcpd.conf.template: -------------------------------------------------------------------------------- 1 | default-lease-time 600; 2 | max-lease-time 7200; 3 | log-facility local7; 4 | ddns-update-style none; 5 | local-address ; 6 | 7 | subnet netmask { 8 | range ; 9 | option routers ; 10 | option domain-name-servers ; 11 | } 12 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/examples/igmpproxy.conf.template: -------------------------------------------------------------------------------- 1 | quickleave 2 | 3 | phyint upstream ratelimit 0 threshold 1 4 | altnet 89.143.8.0/24 5 | altnet 95.176.0.0/16 6 | 7 | phyint downstream ratelimit 0 threshold 1 8 | 9 | # A lot of these will be appended by make_igmpproxy_config: 10 | # phyint eth0 disabled 11 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/examples/make_dhcp_config.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | call("make_dhcp_config", {"192.168.1.1", "24", "192.168.1.100", "192.168.1.199", {"192.168.1.1"}, {"192.168.1.1", "4.4.4.4"}, "dhcpd.conf.template", "dhcpd.conf"}) config; 3 | exit("0"); 4 | } 5 | 6 | template make_dhcp_config { 7 | alias("_arg0") addr; 8 | alias("_arg1") prefix; 9 | alias("_arg2") range_start; 10 | alias("_arg3") range_end; 11 | alias("_arg4") routers; 12 | alias("_arg5") dns_servers; 13 | alias("_arg6") template_file; 14 | alias("_arg7") output_file; 15 | 16 | ipv4_net_from_addr_and_prefix(addr, prefix) network; 17 | ipv4_prefix_to_mask(prefix) netmask; 18 | implode(", ", routers) routers_str; 19 | implode(", ", dns_servers) dns_servers_str; 20 | 21 | var({"", "", "", "", "", "", ""}) regex; 22 | var({addr, network, netmask, range_start, range_end, routers_str, dns_servers_str}) replace; 23 | 24 | file_read(template_file) template_data; 25 | regex_replace(template_data, regex, replace) replaced_data; 26 | file_write(output_file, replaced_data); 27 | } 28 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/examples/onoff_server_test.ncd: -------------------------------------------------------------------------------- 1 | include "onoff_server.ncdi" 2 | 3 | process main { 4 | call("onoff_server_main", {"/home/ambro/onoff.socket"}) onoff_server; 5 | 6 | process_manager() mgr; 7 | mgr->start("service1", {}); 8 | #mgr->start("service2", {}); 9 | } 10 | 11 | template service1 { 12 | alias("_caller") main; 13 | 14 | call("onoff_server_onoff", {"_caller.main.onoff_server", "ServiceId1", "true"}); 15 | 16 | println("service1 up"); 17 | rprintln("service1 down"); 18 | 19 | # Do your stuff. 20 | } 21 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/examples/tcp_echo_client.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | getargs() args; 3 | value(args) args; 4 | 5 | num_different(args.length, "2") bad_args; 6 | If (bad_args) { 7 | println("bad arguments"); 8 | exit("1"); 9 | }; 10 | 11 | args->get("0") addr_ip; 12 | args->get("1") addr_port; 13 | 14 | sys.connect({"tcp", {"ipv4", addr_ip, addr_port}}) socket; 15 | If (socket.is_error) { 16 | println("connection error!"); 17 | exit("1"); 18 | }; 19 | 20 | println("connected"); 21 | 22 | socket->write("This echo client is implemented in NCD!\n\n"); 23 | 24 | backtrack_point() recv_point; 25 | 26 | socket->read() data; 27 | If (data.not_eof) { 28 | socket->write(data); 29 | recv_point->go(); 30 | }; 31 | 32 | println("server disconnected"); 33 | 34 | exit("0"); 35 | } 36 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/examples/tcp_echo_server.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | getargs() args; 3 | value(args) args; 4 | 5 | num_different(args.length, "2") bad_args; 6 | If (bad_args) { 7 | println("bad arguments"); 8 | exit("1"); 9 | }; 10 | 11 | args->get("0") addr_ip; 12 | args->get("1") addr_port; 13 | 14 | sys.listen({"tcp", {"ipv4", addr_ip, addr_port}}, "client_handler", {}) listener; 15 | If (listener.is_error) { 16 | println("failed to listen"); 17 | exit("1"); 18 | }; 19 | 20 | println("listening"); 21 | } 22 | 23 | template client_handler { 24 | to_string(_socket.client_addr) addr_str; 25 | 26 | println("client ", addr_str, ": connected"); 27 | rprintln("client ", addr_str, ": disconnected"); 28 | 29 | _socket->write("This echo server is implemented in NCD!\n\n"); 30 | 31 | backtrack_point() recv_point; 32 | 33 | _socket->read() data; 34 | If (data.not_eof) { 35 | _socket->write(data); 36 | recv_point->go(); 37 | }; 38 | 39 | _socket->close(); 40 | } 41 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/include_linux_input.c: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/modules/buffer_chunks_tree.h: -------------------------------------------------------------------------------- 1 | #define SAVL_PARAM_NAME ChunksTree 2 | #define SAVL_PARAM_FEATURE_COUNTS 0 3 | #define SAVL_PARAM_FEATURE_NOKEYS 0 4 | #define SAVL_PARAM_TYPE_ENTRY struct chunk 5 | #define SAVL_PARAM_TYPE_KEY size_t 6 | #define SAVL_PARAM_TYPE_ARG int 7 | #define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) B_COMPARE((entry1)->offset, (entry2)->offset) 8 | #define SAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) B_COMPARE((key1), (entry2)->offset) 9 | #define SAVL_PARAM_MEMBER_NODE chunks_tree_node 10 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/modules/value_maptree.h: -------------------------------------------------------------------------------- 1 | #define SAVL_PARAM_NAME MapTree 2 | #define SAVL_PARAM_FEATURE_COUNTS 1 3 | #define SAVL_PARAM_FEATURE_NOKEYS 0 4 | #define SAVL_PARAM_TYPE_ENTRY struct value 5 | #define SAVL_PARAM_TYPE_KEY NCDValRef 6 | #define SAVL_PARAM_TYPE_ARG int 7 | #define SAVL_PARAM_TYPE_COUNT size_t 8 | #define SAVL_PARAM_VALUE_COUNT_MAX SIZE_MAX 9 | #define SAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) NCDVal_Compare((entry1)->map_parent.key, (entry2)->map_parent.key) 10 | #define SAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) NCDVal_Compare((key1), (entry2)->map_parent.key) 11 | #define SAVL_PARAM_MEMBER_NODE map_parent.maptree_node 12 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/addr_in_network.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | net.ipv4.addr_in_network("192.168.6.0", "192.168.6.0", "24") r; 3 | assert(r); 4 | 5 | net.ipv4.addr_in_network("192.168.6.0", "192.168.6.0/24") r; 6 | assert(r); 7 | 8 | net.ipv4.addr_in_network("192.168.6.1", "192.168.6.0", "24") r; 9 | assert(r); 10 | 11 | net.ipv4.addr_in_network("192.168.6.255", "192.168.6.0", "24") r; 12 | assert(r); 13 | 14 | net.ipv4.addr_in_network("192.168.5.255", "192.168.6.0", "24") r; 15 | not(r) r; 16 | assert(r); 17 | 18 | net.ipv4.addr_in_network("192.168.7.0", "192.168.6.0", "24") r; 19 | not(r) r; 20 | assert(r); 21 | 22 | net.ipv4.addr_in_network("192.168.7.0", "192.168.6.0/24") r; 23 | not(r) r; 24 | assert(r); 25 | 26 | net.ipv4.addr_in_network("0.0.0.0", "192.168.6.0", "0") r; 27 | assert(r); 28 | 29 | net.ipv4.addr_in_network("0.0.0.0", "0.0.0.0", "0") r; 30 | assert(r); 31 | 32 | net.ipv4.addr_in_network("255.255.255.255", "0.0.0.0", "0") r; 33 | assert(r); 34 | 35 | net.ipv6.addr_in_network("::123:0", "::123:0/112") r; 36 | assert(r); 37 | 38 | net.ipv6.addr_in_network("::123:1", "::123:0/112") r; 39 | assert(r); 40 | 41 | net.ipv6.addr_in_network("::123:ffff", "::123:0/112") r; 42 | assert(r); 43 | 44 | net.ipv6.addr_in_network("::123:ffff", "::123:ffff/128") r; 45 | assert(r); 46 | 47 | net.ipv6.addr_in_network("::122:ffff", "::123:0/112") r; 48 | not(r) r; 49 | assert(r); 50 | 51 | net.ipv6.addr_in_network("::124:0", "::123:0/112") r; 52 | not(r) r; 53 | assert(r); 54 | 55 | net.ipv6.addr_in_network("::123:fffe", "::123:ffff/128") r; 56 | not(r) r; 57 | assert(r); 58 | 59 | exit("0"); 60 | } 61 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/alias.ncd: -------------------------------------------------------------------------------- 1 | process foo { 2 | var("hello") x; 3 | alias("x") y; 4 | val_equal(y, "hello") a; 5 | assert(a); 6 | 7 | var("hello") x; 8 | alias("x") y; 9 | y->set("world"); 10 | val_equal(y, "world") a; 11 | assert(a); 12 | 13 | var("hello") x; 14 | alias("x") y; 15 | alias("y") z; 16 | z->set("world"); 17 | val_equal(x, "world") a; 18 | assert(a); 19 | 20 | call("test", {"hello"}) c; 21 | alias("c.x") x; 22 | val_equal(x, "hello") a; 23 | assert(a); 24 | 25 | call("test", {"hello"}) c; 26 | alias("c") x; 27 | alias("x") y; 28 | alias("y.x") z; 29 | c.x->set("world"); 30 | val_equal(z, "world") a; 31 | assert(a); 32 | 33 | var("hello") x; 34 | call("test2", {"_caller.x"}) c; 35 | c.x->set("world"); 36 | val_equal(x, "world") a; 37 | assert(a); 38 | 39 | exit("0"); 40 | } 41 | 42 | template test { 43 | var(_arg0) x; 44 | } 45 | 46 | template test2 { 47 | alias(_arg0) x; 48 | } 49 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/arithmetic.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | num_lesser("6", "7") r; 3 | assert(r); 4 | 5 | num_lesser("7", "7") r; 6 | not(r) a; 7 | assert(a); 8 | 9 | num_greater("7", "6") r; 10 | assert(r); 11 | 12 | num_greater("7", "7") r; 13 | not(r) a; 14 | assert(a); 15 | 16 | num_lesser_equal("7", "7") r; 17 | assert(r); 18 | 19 | num_lesser_equal("8", "7") r; 20 | not(r) a; 21 | assert(a); 22 | 23 | num_greater_equal("7", "7") r; 24 | assert(r); 25 | 26 | num_greater_equal("7", "8") r; 27 | not(r) a; 28 | assert(a); 29 | 30 | num_equal("7", "7") r; 31 | assert(r); 32 | 33 | num_equal("6", "7") r; 34 | not(r) a; 35 | assert(a); 36 | 37 | num_equal("7", "6") r; 38 | not(r) a; 39 | assert(a); 40 | 41 | num_different("7", "6") a; 42 | assert(a); 43 | 44 | num_different("7", "007") a; 45 | not(a) a; 46 | assert(a); 47 | 48 | num_add("4", "7") r; 49 | strcmp(r, "11") a; 50 | assert(a); 51 | 52 | num_subtract("4", "3") r; 53 | strcmp(r, "1") a; 54 | assert(a); 55 | 56 | num_multiply("4", "5") r; 57 | strcmp(r, "20") a; 58 | assert(a); 59 | 60 | num_divide("7", "3") r; 61 | strcmp(r, "2") a; 62 | assert(a); 63 | 64 | num_modulo("7", "3") r; 65 | strcmp(r, "1") a; 66 | assert(a); 67 | 68 | exit("0"); 69 | } 70 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/backtracking.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | value({}) list; 3 | var("0") i; 4 | backtrack_point() point; 5 | num_lesser(i, "100") do_more; 6 | If (do_more) { 7 | list->insert(i); 8 | num_add(i, "1") new_i; 9 | i->set(new_i); 10 | point->go(); 11 | }; 12 | val_equal(list.length, "100") a; 13 | assert(a); 14 | 15 | value({}) list; 16 | var("0") i; 17 | blocker() blk; 18 | blk->up(); 19 | blk->use(); 20 | num_lesser(i, "100") do_more; 21 | If (do_more) { 22 | list->insert(i); 23 | num_add(i, "1") new_i; 24 | i->set(new_i); 25 | blk->downup(); 26 | }; 27 | val_equal(list.length, "100") a; 28 | assert(a); 29 | 30 | exit("0"); 31 | } 32 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/buffer.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | buffer() buf; 3 | val_equal(buf, "") a; 4 | assert(a); 5 | 6 | buf->append("12"); 7 | val_equal(buf, "12") a; 8 | assert(a); 9 | 10 | buf->append("345"); 11 | val_equal(buf, "12345") a; 12 | assert(a); 13 | 14 | buf->consume("1"); 15 | val_equal(buf, "2345") a; 16 | assert(a); 17 | 18 | buf->consume("1"); 19 | val_equal(buf, "345") a; 20 | assert(a); 21 | 22 | buf->consume("3"); 23 | val_equal(buf, "") a; 24 | assert(a); 25 | 26 | buf->append("6"); 27 | val_equal(buf, "6") a; 28 | assert(a); 29 | 30 | buf->append("7890"); 31 | val_equal(buf, "67890") a; 32 | assert(a); 33 | 34 | buf->append(""); 35 | val_equal(buf, "67890") a; 36 | assert(a); 37 | 38 | buf->consume("4"); 39 | val_equal(buf, "0") a; 40 | assert(a); 41 | 42 | buf->append("1234567890"); 43 | val_equal(buf, "01234567890") a; 44 | assert(a); 45 | 46 | val_equal(buf.length, "11") a; 47 | assert(a); 48 | 49 | buffer("hello") buf2; 50 | val_equal(buf2, "hello") a; 51 | assert(a); 52 | 53 | exit("0"); 54 | } 55 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/call.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | var("bad_x") x; 3 | var("good_x") y; 4 | call("helper_func", {}) helper; 5 | call_with_caller_target("func1", {}, "helper") c; 6 | val_equal(c.x, "good_x") a; 7 | assert(a); 8 | 9 | exit("0"); 10 | } 11 | 12 | template helper_func { 13 | var(_caller.y) x; 14 | } 15 | 16 | template func1 { 17 | var(_caller.x) x; 18 | } 19 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/concat.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | concat("Hello", "", "World") x; 3 | strcmp(x, "HelloWorld") a; 4 | assert(a); 5 | 6 | concat("\x00\x00", "\x00") x; 7 | strcmp(x, "\x00\x00\x00") a; 8 | assert(a); 9 | 10 | concatv({"Hello", "", "World"}) x; 11 | strcmp(x, "HelloWorld") a; 12 | assert(a); 13 | 14 | concatv({"\x00\x00", "\x00"}) x; 15 | strcmp(x, "\x00\x00\x00") a; 16 | assert(a); 17 | 18 | exit("0"); 19 | } 20 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/depend.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | var("hello") x; 3 | provide("A"); 4 | depend("A") d; 5 | val_equal(d.x, "hello") a; 6 | assert(a); 7 | d.x->set("world"); 8 | val_equal(d.x, "world") a; 9 | assert(a); 10 | 11 | var("hello") x; 12 | provide("B"); 13 | val_equal(x, "world") a; 14 | assert(a); 15 | 16 | var("hello") x; 17 | provide("C"); 18 | val_equal(x, "hello") a; 19 | assert(a); 20 | depend("C_done"); 21 | val_equal(x, "world") a; 22 | assert(a); 23 | 24 | var("hello") x; 25 | blocker() blk; 26 | provide("D"); 27 | val_equal(x, "hello") a; 28 | assert(a); 29 | blk->up(); 30 | val_equal(x, "0") a; 31 | assert(a); 32 | blk->down(); 33 | blk->up(); 34 | val_equal(x, "1") a; 35 | assert(a); 36 | 37 | exit("0"); 38 | } 39 | 40 | process proc1 { 41 | depend("B") dep; 42 | dep.x->set("world"); 43 | } 44 | 45 | process proc2 { 46 | depend("C") dep; 47 | sleep("0", "0"); 48 | dep.x->set("world"); 49 | provide("C_done"); 50 | } 51 | 52 | process proc3 { 53 | depend("D") dep; 54 | dep.blk->use(); 55 | provide("E"); 56 | } 57 | 58 | process proc4 { 59 | var("0") i; 60 | depend("E") dep; 61 | dep.dep.x->set(i); 62 | num_add(i, "1") j; 63 | i->set(j); 64 | } 65 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/depend_scope.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | depend_scope() scope; 3 | var("0") x; 4 | process_manager() mgr; 5 | 6 | var("false") backtrack_check; 7 | backtrack_point() point; 8 | If (backtrack_check) { 9 | val_equal(x, "2") a; # must not have rebound temporarily to A during backtracking 10 | assert(a); 11 | exit("0"); 12 | }; 13 | 14 | scope->provide("A"); 15 | mgr->start("t1", "t1", {}); 16 | val_equal(x, "1") a; # must have bound to A immediately 17 | assert(a); 18 | 19 | scope->provide("B") mgr; 20 | val_equal(x, "2") a; # must have rebound to B immediately 21 | assert(a); 22 | 23 | backtrack_check->set("true"); 24 | point->go(); 25 | } 26 | 27 | template t1 { 28 | _caller.scope->depend({"B", "A"}) dep; 29 | num_add(dep.x, "1") new_x; 30 | dep.x->set(new_x); 31 | } 32 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/escape_and_nulls.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | value("ab\0") str1; 3 | value("ab") str2; 4 | 5 | strcmp(str1.length, "3") a; 6 | assert(a); 7 | 8 | strcmp(str2.length, "2") a; 9 | assert(a); 10 | 11 | strcmp(str1, str2) a; 12 | not(a) a; 13 | assert(a); 14 | 15 | concat(str1, str2) strc; 16 | strcmp(strc, "ab\0ab") a; 17 | assert(a); 18 | 19 | concat(str2, str1) strc; 20 | strcmp(strc, "abab\0") a; 21 | assert(a); 22 | 23 | value("") str1; 24 | value("\x00\x00") str2; 25 | value("\x00\x01") str3; 26 | value("\x01") str4; 27 | 28 | val_lesser(str1, str2) a; 29 | assert(a); 30 | 31 | val_lesser(str2, str3) a; 32 | assert(a); 33 | 34 | val_lesser(str3, str4) a; 35 | assert(a); 36 | 37 | exit("0"); 38 | } 39 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/explode.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | explode("FOO", "aaaFOObbbFOOcccFOOddd") l; 3 | val_equal(l, {"aaa", "bbb", "ccc", "ddd"}) a; 4 | assert(a); 5 | 6 | explode("FOO", "FOObbbFOOFOO") l; 7 | val_equal(l, {"", "bbb", "", ""}) a; 8 | assert(a); 9 | 10 | explode("FOO", "foo") l; 11 | val_equal(l, {"foo"}) a; 12 | assert(a); 13 | 14 | explode("FOO", "FOO") l; 15 | val_equal(l, {"", ""}) a; 16 | assert(a); 17 | 18 | explode("participate in parachute", "parachute in participation of participate in parachuteparparticipate in parachute participate in parachut") l; 19 | val_equal(l, {"parachute in participation of ", "par", " participate in parachut"}) a; 20 | assert(a); 21 | 22 | exit("0"); 23 | } 24 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/foreach.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | var({"a", "b", "c", "d"}) list; 3 | value(["a":"1", "b":"2", "c":"3", "d":"4"]) map; 4 | 5 | value({}) new; 6 | Foreach (list As value) { 7 | new->insert(new.length, value); 8 | }; 9 | val_equal(new, list) a; 10 | assert(a); 11 | 12 | value({}) new; 13 | Foreach (list As index:value) { 14 | new->insert(index, value); 15 | }; 16 | val_equal(new, list) a; 17 | assert(a); 18 | 19 | value([]) new; 20 | Foreach (map As key) { 21 | map->get(key) value; 22 | new->insert(key, value); 23 | }; 24 | val_equal(new, map) a; 25 | assert(a); 26 | 27 | value([]) new; 28 | Foreach (map As key:value) { 29 | new->insert(key, value); 30 | }; 31 | val_equal(new, map) a; 32 | assert(a); 33 | 34 | exit("0"); 35 | } 36 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/if.ncd: -------------------------------------------------------------------------------- 1 | process foo { 2 | If ("true") { 3 | If ("truee") { 4 | var("A1") y; 5 | } else { 6 | If ("true") { 7 | var("A11") q; 8 | } else { 9 | var("A22") q; 10 | } t; 11 | var(t.q) y; 12 | } s; 13 | var(s.y) x; 14 | } elif ("true") { 15 | var("B") x; 16 | } else { 17 | var("C") x; 18 | } ifs; 19 | 20 | val_equal(ifs.x, "A11") a; 21 | assert(a); 22 | 23 | var("a") v; 24 | If ("false") { 25 | v->set("b"); 26 | }; 27 | val_equal(v, "a") a; 28 | assert(a); 29 | 30 | var("a") v; 31 | If ("true") { 32 | v->set("b"); 33 | }; 34 | val_equal(v, "b") a; 35 | assert(a); 36 | 37 | exit("0"); 38 | } 39 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/implode.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | implode("X", {"a", "bb", "", "c"}) str; 3 | strcmp(str, "aXbbXXc") a; 4 | assert(a); 5 | 6 | implode("", {"a", "b"}) str; 7 | strcmp(str, "ab") a; 8 | assert(a); 9 | 10 | implode("X", {}) str; 11 | strcmp(str, "") a; 12 | assert(a); 13 | 14 | exit("0"); 15 | } 16 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/include.ncd: -------------------------------------------------------------------------------- 1 | include "include_included.ncdi" 2 | include "include_included.ncdi" 3 | include "include_included2.ncdi" 4 | include "include_included2.ncdi" 5 | 6 | process main { 7 | call("incl_tmpl", {}) c; 8 | val_equal(c.x, "good") a; 9 | assert(a); 10 | 11 | call("incl_tmpl2", {}) c; 12 | val_equal(c.x, "good2") a; 13 | assert(a); 14 | 15 | exit("0"); 16 | } 17 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/include_included.ncdi: -------------------------------------------------------------------------------- 1 | include_guard "include_included" 2 | 3 | template incl_tmpl { 4 | var("good") x; 5 | } 6 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/include_included2.ncdi: -------------------------------------------------------------------------------- 1 | include_guard "include_included2" 2 | 3 | template incl_tmpl2 { 4 | var("good2") x; 5 | } 6 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/logical.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | var("true") t; 3 | var("Faalse") f; 4 | 5 | and(t, f) r; 6 | strcmp(r, "false") a; 7 | assert(a); 8 | 9 | and(f, t) r; 10 | strcmp(r, "false") a; 11 | assert(a); 12 | 13 | and(f, f) r; 14 | strcmp(r, "false") a; 15 | assert(a); 16 | 17 | and(t, t) r; 18 | strcmp(r, "true") a; 19 | assert(a); 20 | 21 | or(t, f) r; 22 | strcmp(r, "true") a; 23 | assert(a); 24 | 25 | or(f, t) r; 26 | strcmp(r, "true") a; 27 | assert(a); 28 | 29 | or(t, t) r; 30 | strcmp(r, "true") a; 31 | assert(a); 32 | 33 | or(f, f) r; 34 | strcmp(r, "false") a; 35 | assert(a); 36 | 37 | not(f) r; 38 | strcmp(r, "true") a; 39 | assert(a); 40 | 41 | not(t) r; 42 | strcmp(r, "false") a; 43 | assert(a); 44 | 45 | exit("0"); 46 | } 47 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/multidepend.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | var("0") x; 3 | process_manager() mgr; 4 | 5 | var("false") backtrack_check; 6 | backtrack_point() point; 7 | If (backtrack_check) { 8 | val_equal(x, "2") a; # must not have rebound temporarily to A during backtracking 9 | assert(a); 10 | exit("0"); 11 | }; 12 | 13 | multiprovide("A"); 14 | mgr->start("t1", "t1", {}); 15 | val_equal(x, "1") a; # must have bound to A immediately 16 | assert(a); 17 | 18 | multiprovide("B") mgr; 19 | val_equal(x, "2") a; # must have rebound to B immediately 20 | assert(a); 21 | 22 | backtrack_check->set("true"); 23 | point->go(); 24 | } 25 | 26 | template t1 { 27 | multidepend({"B", "A"}) dep; 28 | num_add(dep.x, "1") new_x; 29 | dep.x->set(new_x); 30 | } 31 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/netmask.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | ipv4_prefix_to_mask("16") mask; 3 | strcmp(mask, "255.255.0.0") a; 4 | assert(a); 5 | 6 | ipv4_mask_to_prefix("128.0.0.0") prefix; 7 | strcmp(prefix, "1") a; 8 | assert(a); 9 | 10 | ipv4_net_from_addr_and_prefix("192.168.1.4", "24") net; 11 | strcmp(net, "192.168.1.0") a; 12 | assert(a); 13 | 14 | exit("0"); 15 | } 16 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/regex.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | var("FOO BAR BAZ QUX goo") x; 3 | regex_replace(x, {"FOO", "BAR", "goo"}, {"BAR", "bar", "GOO"}) y; 4 | strcmp(y, "BAR bar BAZ QUX GOO") a; 5 | assert(a); 6 | 7 | var("hello world") x; 8 | regex_replace(x, {"^hello"}, {"Hello,"}) y; 9 | strcmp(y, "Hello, world") a; 10 | assert(a); 11 | 12 | var("hello world") x; 13 | regex_replace(x, {"goodbye"}, {"hello"}) y; 14 | strcmp(y, "hello world") a; 15 | assert(a); 16 | 17 | var("hello world") x; 18 | regex_replace(x, {"hello world"}, {"hello NCD"}) y; 19 | strcmp(y, "hello NCD") a; 20 | assert(a); 21 | 22 | var("hello world") x; 23 | regex_replace(x, {"wor"}, {"Wor"}) y; 24 | strcmp(y, "hello World") a; 25 | assert(a); 26 | 27 | var("hello world") x; 28 | regex_replace(x, {"ell", "llo"}, {"ELL", "LLO"}) y; 29 | strcmp(y, "hELLo world") a; 30 | assert(a); 31 | 32 | var("hello world") x; 33 | regex_replace(x, {"ell", "el"}, {"ELL", "EL"}) y; 34 | strcmp(y, "hELLo world") a; 35 | assert(a); 36 | 37 | var("hello world") x; 38 | regex_replace(x, {"el", "lo"}, {"EL", "LO"}) y; 39 | strcmp(y, "hELLO world") a; 40 | assert(a); 41 | 42 | var("hello world") x; 43 | regex_replace(x, {"ell", "ll"}, {"ELL", "LL"}) y; 44 | strcmp(y, "hELLo world") a; 45 | assert(a); 46 | 47 | exit("0"); 48 | } 49 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/run_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | NCD=$1 4 | USE_VALGRIND=$2 5 | 6 | if [[ -z $NCD ]] || [[ -n $USE_VALGRIND && $USE_VALGRIND != use_valgrind ]]; then 7 | echo "Usage: $0 [use_valgrind]" 8 | exit 1 9 | fi 10 | 11 | if [[ ! -e ./run_tests ]]; then 12 | echo "Must run from the tests directory" 13 | exit 1 14 | fi 15 | 16 | failed=0 17 | 18 | for file in ./*.ncd; do 19 | echo "Running: $file" 20 | if [[ $USE_VALGRIND = use_valgrind ]]; then 21 | valgrind --error-exitcode=1 --leak-check=full "$NCD" --loglevel none --config-file "$file" 22 | else 23 | "$NCD" --loglevel none --config-file "$file" 24 | fi 25 | res=$? 26 | if [[ ! $res -eq 0 ]]; then 27 | echo "FAILED" 28 | let failed+=1 29 | fi 30 | done 31 | 32 | if [[ $failed -gt 0 ]]; then 33 | echo "$failed tests FAILED" 34 | exit 1 35 | fi 36 | 37 | echo "all tests passed" 38 | exit 0 39 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/strings.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | buffer() buf; 3 | buf->append("12"); 4 | buf->append("345"); 5 | buf->append("6"); 6 | num_equal(buf, "123456") a; 7 | assert(a); 8 | 9 | var("false") check; 10 | call("test_func", {}); 11 | assert(check); 12 | 13 | buffer() buf; 14 | buf->append("test_func"); 15 | var("false") check; 16 | call(buf, {}); 17 | assert(check); 18 | 19 | concat("test_func") cnc; 20 | var("false") check; 21 | call(cnc, {}); 22 | assert(check); 23 | 24 | buffer() buf; 25 | buf->append("test_func"); 26 | var("false") check; 27 | process_manager() mgr; 28 | mgr->start(buf, {}); 29 | assert(check); 30 | 31 | buffer() buf; 32 | buf->append("/bin/echo"); 33 | runonce({buf, buf}); 34 | 35 | buffer() buf; 36 | buf->append("12"); 37 | buf->append("345"); 38 | to_string(buf) str; 39 | val_equal(str, "\"12345\"") a; 40 | assert(a); 41 | 42 | exit("0"); 43 | } 44 | 45 | template test_func { 46 | _caller.check->set("true"); 47 | } 48 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/substr.ncd: -------------------------------------------------------------------------------- 1 | process main { 2 | var("0123456789") str; 3 | concat(str) external_str; 4 | 5 | call("do_test", {"_caller.str"}); 6 | call("do_test", {"_caller.external_str"}); 7 | 8 | exit("0"); 9 | } 10 | 11 | template do_test { 12 | alias(_arg0) str; 13 | 14 | substr(str, "0") sub; 15 | val_equal(sub, "0123456789") a; 16 | assert(a); 17 | 18 | substr(str, "2") sub; 19 | val_equal(sub, "23456789") a; 20 | assert(a); 21 | 22 | substr(str, "3", "0") sub; 23 | val_equal(sub, "") a; 24 | assert(a); 25 | 26 | substr(str, "3", "6") sub; 27 | val_equal(sub, "345678") a; 28 | assert(a); 29 | 30 | substr(str, "3", "7") sub; 31 | val_equal(sub, "3456789") a; 32 | assert(a); 33 | 34 | substr(str, "3", "8") sub; 35 | val_equal(sub, "3456789") a; 36 | assert(a); 37 | } 38 | -------------------------------------------------------------------------------- /jni/badvpn/ncd/tests/value_substr.ncd: -------------------------------------------------------------------------------- 1 | process foo { 2 | value("0123456789") str; 3 | 4 | str->substr("0") sub; 5 | strcmp(sub, str) a; 6 | assert(a); 7 | 8 | str->substr("1") sub; 9 | strcmp(sub, "123456789") a; 10 | assert(a); 11 | 12 | str->substr("1", "0") sub; 13 | strcmp(sub, "") a; 14 | assert(a); 15 | 16 | str->substr("1", "9") sub; 17 | strcmp(sub, "123456789") a; 18 | assert(a); 19 | 20 | str->substr("1", "8") sub; 21 | strcmp(sub, "12345678") a; 22 | assert(a); 23 | 24 | exit("0"); 25 | } 26 | -------------------------------------------------------------------------------- /jni/badvpn/nspr_support/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(nspr_support 2 | DummyPRFileDesc.c 3 | BSSLConnection.c 4 | ) 5 | target_link_libraries(nspr_support system flow threadwork ${NSPR_LIBRARIES} ${NSS_LIBRARIES}) 6 | -------------------------------------------------------------------------------- /jni/badvpn/predicate/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(predicate 2 | BPredicate.c 3 | ${PROJECT_SOURCE_DIR}/generated/flex_BPredicate.c 4 | ${PROJECT_SOURCE_DIR}/generated/bison_BPredicate.c 5 | ) 6 | target_link_libraries(predicate system) 7 | -------------------------------------------------------------------------------- /jni/badvpn/protocol/addr.bproto: -------------------------------------------------------------------------------- 1 | // message for an AddrProto address 2 | message addr { 3 | // address type. from addr.h 4 | required uint8 type = 1; 5 | // for IPv4 and IPv6 addresses, the port (network byte order) 6 | optional data("2") ip_port = 2; 7 | // for IPv4 addresses, the IP address 8 | optional data("4") ipv4_addr = 3; 9 | // for IPv6 addresses, the IP address 10 | optional data("16") ipv6_addr = 4; 11 | }; 12 | -------------------------------------------------------------------------------- /jni/badvpn/protocol/msgproto.bproto: -------------------------------------------------------------------------------- 1 | // message for all MsgProto messages 2 | message msg { 3 | // message type, from msgproto.h 4 | required uint16 type = 1; 5 | // message payload. Is itself one of the messages below 6 | // for "youconnect", "seed" and "confirmseed" messages, 7 | // and empty for other messages 8 | required data payload = 2; 9 | }; 10 | 11 | // "youconnect" message payload 12 | message msg_youconnect { 13 | // external addresses to try; one or more msg_youconnect_addr messages 14 | required repeated data addr = 1; 15 | // encryption key if using UDP and encryption is enabled 16 | optional data key = 2; 17 | // password if using TCP 18 | optional uint64 password = 3; 19 | }; 20 | 21 | // an external address 22 | message msg_youconnect_addr { 23 | // scope name for this address 24 | required data name = 1; 25 | // address according to AddrProto 26 | required data addr = 2; 27 | }; 28 | 29 | // "seed" message payload 30 | message msg_seed { 31 | // identifier for the seed being send 32 | required uint16 seed_id = 1; 33 | // seed encryption key 34 | required data key = 2; 35 | // seed IV 36 | required data iv = 3; 37 | }; 38 | 39 | // "confirmseed" message payload 40 | message msg_confirmseed { 41 | // identifier for the seed being confirmed 42 | required uint16 seed_id = 1; 43 | }; 44 | -------------------------------------------------------------------------------- /jni/badvpn/random/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(badvpn_random 2 | BRandom2.c 3 | ) 4 | target_link_libraries(badvpn_random base) 5 | -------------------------------------------------------------------------------- /jni/badvpn/scripts/cmake: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export ROOT="" 4 | export MINGW="/home//mingw/cross_win32" 5 | 6 | export PATH="$MINGW/bin:$PATH" 7 | 8 | exec /usr/bin/cmake -DCMAKE_TOOLCHAIN_FILE="$ROOT/toolchain.cmake" "$@" 9 | -------------------------------------------------------------------------------- /jni/badvpn/scripts/copy_nss: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | NSSDIST="$1" 4 | DEST="$2" 5 | 6 | if [ -z "${NSSDIST}" ] || [ -z "${DEST}" ]; then 7 | echo "Copies a Windows build of NSS such that it can be found by the BadVPN build system" 8 | echo "Usage: $0 " 9 | exit 1 10 | fi 11 | 12 | NSSOBJ="${NSSDIST}/WINNT5.1_OPT.OBJ" 13 | 14 | set -e 15 | 16 | mkdir -p "${DEST}"/include 17 | cp -r "${NSSOBJ}/include"/* "${DEST}"/include/ 18 | cp -r "${NSSDIST}/public/nss"/* "${DEST}"/include/ 19 | mkdir -p "${DEST}"/lib 20 | cp "${NSSOBJ}/lib"/{libnspr4,libplc4,libplds4,ssl3,smime3,nss3}.lib "${DEST}"/lib/ 21 | mkdir -p "${DEST}"/bin 22 | cp "${NSSOBJ}/lib"/*.dll "${DEST}"/bin/ 23 | cp "${NSSOBJ}/bin"/*.exe "${DEST}"/bin/ 24 | -------------------------------------------------------------------------------- /jni/badvpn/scripts/toolchain.cmake: -------------------------------------------------------------------------------- 1 | SET(CMAKE_SYSTEM_NAME Windows) 2 | SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc) 3 | SET(CMAKE_FIND_ROOT_PATH $ENV{ROOT}) 4 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) 5 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 6 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 7 | -------------------------------------------------------------------------------- /jni/badvpn/security/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(security 2 | BSecurity.c 3 | BEncryption.c 4 | BHash.c 5 | BRandom.c 6 | OTPCalculator.c 7 | OTPChecker.c 8 | OTPGenerator.c 9 | ) 10 | target_link_libraries(security system threadwork ${LIBCRYPTO_LIBRARIES}) 11 | -------------------------------------------------------------------------------- /jni/badvpn/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(badvpn-server server.c) 2 | target_link_libraries(badvpn-server system flow flowextra nspr_support predicate security ${NSPR_LIBRARIES} ${NSS_LIBRARIES}) 3 | 4 | install( 5 | TARGETS badvpn-server 6 | RUNTIME DESTINATION bin 7 | ) 8 | 9 | install( 10 | FILES badvpn-server.8 11 | DESTINATION share/man/man8 12 | ) 13 | -------------------------------------------------------------------------------- /jni/badvpn/server_connection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(server_conection 2 | ServerConnection.c 3 | SCKeepaliveSource.c 4 | ) 5 | target_link_libraries(server_conection system flow flowextra nspr_support ${NSPR_LIBRARIES} ${NSS_LIBRARIES}) 6 | -------------------------------------------------------------------------------- /jni/badvpn/socksclient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(socksclient 2 | BSocksClient.c 3 | ) 4 | target_link_libraries(socksclient system flow flowextra) 5 | -------------------------------------------------------------------------------- /jni/badvpn/stringmap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(stringmap 2 | BStringMap.c 3 | ) 4 | -------------------------------------------------------------------------------- /jni/badvpn/structure/CAvl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file CAvl.h 3 | * @author Ambroz Bizjak 4 | * 5 | * @section LICENSE 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. Neither the name of the author nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef BADVPN_CAVL_H 31 | #define BADVPN_CAVL_H 32 | 33 | #include 34 | #include 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /jni/badvpn/structure/IndexedList_tree.h: -------------------------------------------------------------------------------- 1 | #define CAVL_PARAM_NAME IndexedList__Tree 2 | #define CAVL_PARAM_FEATURE_COUNTS 1 3 | #define CAVL_PARAM_FEATURE_KEYS_ARE_INDICES 1 4 | #define CAVL_PARAM_FEATURE_NOKEYS 0 5 | #define CAVL_PARAM_TYPE_ENTRY IndexedListNode 6 | #define CAVL_PARAM_TYPE_LINK IndexedList__tree_link 7 | #define CAVL_PARAM_TYPE_ARG int 8 | #define CAVL_PARAM_TYPE_COUNT uint64_t 9 | #define CAVL_PARAM_VALUE_COUNT_MAX UINT64_MAX 10 | #define CAVL_PARAM_VALUE_NULL ((IndexedList__tree_link)NULL) 11 | #define CAVL_PARAM_FUN_DEREF(arg, link) (link) 12 | #define CAVL_PARAM_MEMBER_CHILD tree_child 13 | #define CAVL_PARAM_MEMBER_BALANCE tree_balance 14 | #define CAVL_PARAM_MEMBER_PARENT tree_parent 15 | #define CAVL_PARAM_MEMBER_COUNT tree_count 16 | -------------------------------------------------------------------------------- /jni/badvpn/structure/SAvl_tree.h: -------------------------------------------------------------------------------- 1 | #define CAVL_PARAM_NAME SAvl__Tree 2 | #define CAVL_PARAM_FEATURE_COUNTS SAVL_PARAM_FEATURE_COUNTS 3 | #define CAVL_PARAM_FEATURE_KEYS_ARE_INDICES 0 4 | #define CAVL_PARAM_FEATURE_NOKEYS SAVL_PARAM_FEATURE_NOKEYS 5 | #define CAVL_PARAM_TYPE_ENTRY SAvlEntry 6 | #define CAVL_PARAM_TYPE_LINK SAvl__TreeLink 7 | #define CAVL_PARAM_TYPE_KEY SAvlKey 8 | #define CAVL_PARAM_TYPE_ARG SAvlArg 9 | #define CAVL_PARAM_TYPE_COUNT SAvlCount 10 | #define CAVL_PARAM_VALUE_COUNT_MAX SAVL_PARAM_VALUE_COUNT_MAX 11 | #define CAVL_PARAM_VALUE_NULL ((SAvl__TreeLink)NULL) 12 | #define CAVL_PARAM_FUN_DEREF(arg, link) (link) 13 | #define CAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) SAVL_PARAM_FUN_COMPARE_ENTRIES((arg), (entry1).link, (entry2).link) 14 | #define CAVL_PARAM_FUN_COMPARE_KEY_ENTRY(arg, key1, entry2) SAVL_PARAM_FUN_COMPARE_KEY_ENTRY((arg), (key1), (entry2).link) 15 | #define CAVL_PARAM_MEMBER_CHILD SAVL_PARAM_MEMBER_NODE . child 16 | #define CAVL_PARAM_MEMBER_BALANCE SAVL_PARAM_MEMBER_NODE . balance 17 | #define CAVL_PARAM_MEMBER_PARENT SAVL_PARAM_MEMBER_NODE . parent 18 | #define CAVL_PARAM_MEMBER_COUNT SAVL_PARAM_MEMBER_NODE . count 19 | -------------------------------------------------------------------------------- /jni/badvpn/system/BReactor.h: -------------------------------------------------------------------------------- 1 | #if defined(BADVPN_BREACTOR_BADVPN) + defined(BADVPN_BREACTOR_GLIB) + defined(BADVPN_BREACTOR_EMSCRIPTEN) != 1 2 | #error No reactor backend or too many reactor backens 3 | #endif 4 | 5 | #if defined(BADVPN_BREACTOR_BADVPN) 6 | #include "BReactor_badvpn.h" 7 | #elif defined(BADVPN_BREACTOR_GLIB) 8 | #include "BReactor_glib.h" 9 | #elif defined(BADVPN_BREACTOR_EMSCRIPTEN) 10 | #include "BReactor_emscripten.h" 11 | #endif 12 | -------------------------------------------------------------------------------- /jni/badvpn/system/BReactor_badvpn_timerstree.h: -------------------------------------------------------------------------------- 1 | #define CAVL_PARAM_NAME BReactor__TimersTree 2 | #define CAVL_PARAM_FEATURE_COUNTS 0 3 | #define CAVL_PARAM_FEATURE_KEYS_ARE_INDICES 0 4 | #define CAVL_PARAM_FEATURE_NOKEYS 1 5 | #define CAVL_PARAM_TYPE_ENTRY struct BSmallTimer_t 6 | #define CAVL_PARAM_TYPE_LINK BReactor_timerstree_link 7 | #define CAVL_PARAM_TYPE_ARG int 8 | #define CAVL_PARAM_VALUE_NULL ((BReactor_timerstree_link)NULL) 9 | #define CAVL_PARAM_FUN_DEREF(arg, link) (link) 10 | #define CAVL_PARAM_FUN_COMPARE_ENTRIES(arg, entry1, entry2) compare_timers((entry1).link, (entry2).link) 11 | #define CAVL_PARAM_MEMBER_CHILD u.tree_child 12 | #define CAVL_PARAM_MEMBER_BALANCE tree_balance 13 | #define CAVL_PARAM_MEMBER_PARENT tree_parent 14 | -------------------------------------------------------------------------------- /jni/badvpn/system/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(BSYSTEM_ADDITIONAL_LIBS) 2 | set(BSYSTEM_ADDITIONAL_SOURCES) 3 | 4 | if (NOT EMSCRIPTEN) 5 | list(APPEND BSYSTEM_ADDITIONAL_SOURCES 6 | BSignal.c 7 | BNetwork.c 8 | ) 9 | 10 | if (WIN32) 11 | list(APPEND BSYSTEM_ADDITIONAL_LIBS ws2_32 mswsock) 12 | list(APPEND BSYSTEM_ADDITIONAL_SOURCES 13 | BConnection_win.c 14 | BDatagram_win.c 15 | ) 16 | endif () 17 | 18 | if (NOT WIN32) 19 | list(APPEND BSYSTEM_ADDITIONAL_SOURCES 20 | BUnixSignal.c 21 | BConnection_unix.c 22 | BDatagram_unix.c 23 | BProcess.c 24 | BInputProcess.c 25 | BThreadSignal.c 26 | BLockReactor.c 27 | ) 28 | endif () 29 | endif () 30 | 31 | if (BREACTOR_BACKEND STREQUAL "badvpn") 32 | list(APPEND BSYSTEM_ADDITIONAL_SOURCES BReactor_badvpn.c) 33 | elseif (BREACTOR_BACKEND STREQUAL "glib") 34 | list(APPEND BSYSTEM_ADDITIONAL_SOURCES BReactor_glib.c) 35 | list(APPEND BSYSTEM_ADDITIONAL_LIBS ${GLIB2_LIBRARIES}) 36 | elseif (BREACTOR_BACKEND STREQUAL "emscripten") 37 | list(APPEND BSYSTEM_ADDITIONAL_SOURCES BReactor_emscripten.c) 38 | endif () 39 | 40 | set(SYSTEM_SOURCES 41 | BTime.c 42 | ${BSYSTEM_ADDITIONAL_SOURCES} 43 | ) 44 | badvpn_add_library(system "base;flow" "${BSYSTEM_ADDITIONAL_LIBS}" "${SYSTEM_SOURCES}") 45 | -------------------------------------------------------------------------------- /jni/badvpn/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(chunkbuffer2_test chunkbuffer2_test.c) 2 | 3 | add_executable(bproto_test bproto_test.c) 4 | 5 | if (BUILDING_THREADWORK) 6 | add_executable(threadwork_test threadwork_test.c) 7 | target_link_libraries(threadwork_test threadwork) 8 | endif () 9 | -------------------------------------------------------------------------------- /jni/badvpn/tests/bproto_test.bproto: -------------------------------------------------------------------------------- 1 | message msg1 { 2 | required uint16 a = 5; 3 | optional uint32 b = 6; 4 | required repeated uint64 c = 7; 5 | repeated uint16 d = 8; 6 | required uint8 e = 9; 7 | required data f = 10; 8 | required data("4") g = 11; 9 | }; 10 | -------------------------------------------------------------------------------- /jni/badvpn/threadwork/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(BADVPN_THREADWORK_EXTRA_LIBS) 2 | if (BADVPN_THREADWORK_USE_PTHREAD) 3 | list(APPEND BADVPN_THREADWORK_EXTRA_LIBS pthread) 4 | endif () 5 | 6 | add_library(threadwork BThreadWork.c) 7 | target_link_libraries(threadwork system ${BADVPN_THREADWORK_EXTRA_LIBS}) 8 | -------------------------------------------------------------------------------- /jni/badvpn/tun2socks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(badvpn-tun2socks 2 | tun2socks.c 3 | SocksUdpGwClient.c 4 | ) 5 | target_link_libraries(badvpn-tun2socks system flow tuntap lwip socksclient udpgw_client) 6 | 7 | install( 8 | TARGETS badvpn-tun2socks 9 | RUNTIME DESTINATION bin 10 | ) 11 | 12 | install( 13 | FILES badvpn-tun2socks.8 14 | DESTINATION share/man/man8 15 | ) 16 | -------------------------------------------------------------------------------- /jni/badvpn/tunctl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(badvpn-tunctl tunctl.c) 2 | 3 | install( 4 | TARGETS badvpn-tunctl 5 | RUNTIME DESTINATION bin 6 | ) 7 | -------------------------------------------------------------------------------- /jni/badvpn/tuntap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TUNTAP_ADDITIONAL_SOURCES) 2 | if (WIN32) 3 | list(APPEND TUNTAP_ADDITIONAL_SOURCES tapwin32-funcs.c) 4 | endif () 5 | 6 | set(TUNTAP_SOURCES 7 | BTap.c 8 | ${TUNTAP_ADDITIONAL_SOURCES} 9 | ) 10 | badvpn_add_library(tuntap "system;flow" "" "${TUNTAP_SOURCES}") 11 | -------------------------------------------------------------------------------- /jni/badvpn/udevmonitor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(udevmonitor 2 | NCDUdevMonitorParser.c 3 | NCDUdevMonitor.c 4 | NCDUdevCache.c 5 | NCDUdevManager.c 6 | ) 7 | target_link_libraries(udevmonitor system flow stringmap) 8 | -------------------------------------------------------------------------------- /jni/badvpn/udpgw/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(badvpn-udpgw 2 | udpgw.c 3 | ) 4 | target_link_libraries(badvpn-udpgw system flow flowextra) 5 | 6 | install( 7 | TARGETS badvpn-udpgw 8 | RUNTIME DESTINATION bin 9 | ) 10 | -------------------------------------------------------------------------------- /jni/badvpn/udpgw_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(udpgw_client UdpGwClient.c) 2 | target_link_libraries(udpgw_client system flow flowextra) 3 | -------------------------------------------------------------------------------- /jni/libancillary/COPYING: -------------------------------------------------------------------------------- 1 | Redistribution and use in source and binary forms, with or without 2 | modification, are permitted provided that the following conditions are met: 3 | 4 | 1. Redistributions of source code must retain the above copyright notice, 5 | this list of conditions and the following disclaimer. 6 | 2. Redistributions in binary form must reproduce the above copyright 7 | notice, this list of conditions and the following disclaimer in the 8 | documentation and/or other materials provided with the distribution. 9 | 3. The name of the author may not be used to endorse or promote products 10 | derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 13 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 14 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 15 | EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 16 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 17 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 18 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 19 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 20 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 21 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | -------------------------------------------------------------------------------- /jni/pdnsd/COPYING.BSD: -------------------------------------------------------------------------------- 1 | A small part of the pdnsd source is licensed under the following BSD-style 2 | license: 3 | 4 | Copyright (C) 2001 Thomas Moestl 5 | 6 | This file is part of the pdnsd package. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions 10 | are met: 11 | 1. Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 25 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 26 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /jni/pdnsd/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/jni/pdnsd/ChangeLog -------------------------------------------------------------------------------- /jni/pdnsd/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = src doc contrib 3 | 4 | EXTRA_DIST = version ChangeLog.old COPYING.BSD README.par README.par.old PKGBUILD 5 | 6 | # The sample configuration is handled in doc/Makefile.am 7 | install-data-hook: 8 | $(mkinstalldirs) "$(DESTDIR)$(cachedir)" 9 | test -f "$(DESTDIR)$(cachedir)/pdnsd.cache" || \ 10 | touch "$(DESTDIR)$(cachedir)/pdnsd.cache" 11 | if test `whoami` = "root"; then \ 12 | chown $(def_id) "$(DESTDIR)$(cachedir)/pdnsd.cache"; \ 13 | chown $(def_id) "$(DESTDIR)$(cachedir)"; \ 14 | fi 15 | chmod 0640 "$(DESTDIR)$(cachedir)/pdnsd.cache" 16 | chmod 0750 "$(DESTDIR)$(cachedir)" 17 | 18 | dist-hook: $(PACKAGE).spec.in 19 | sed -e '/^%{!?distro: %define distro /c\ 20 | %if 0%{!?distro:1}\ 21 | %if "%{_vendor}" == "redhat"\ 22 | %define distro RedHat\ 23 | %else\ 24 | %if "%{_vendor}" == "suse"\ 25 | %define distro SuSE\ 26 | %else\ 27 | %if "%{_vendor}" == "SuSE"\ 28 | %define distro SuSE\ 29 | %endif\ 30 | %endif\ 31 | %endif\ 32 | %endif' \ 33 | -e 's:[@]PACKAGE[@]:$(PACKAGE):g' \ 34 | -e 's:[@]VERSION[@]:$(VERSION):g' \ 35 | -e 's:[@]fullversion[@]:$(fullversion):g' \ 36 | -e 's:[@]packagerelease[@]:$(packagerelease):g' \ 37 | -e 's:[@]cachedir[@]:/var/cache/$(PACKAGE):g' \ 38 | -e 's:[@]def_id[@]:$(PACKAGE):g' \ 39 | $(PACKAGE).spec.in > $(distdir)/$(PACKAGE).spec 40 | 41 | -------------------------------------------------------------------------------- /jni/pdnsd/PKGBUILD.in: -------------------------------------------------------------------------------- 1 | # Package build script for Arch Linux, 2 | # contributed by Alexander Drozdov. 3 | 4 | pkgname=@PACKAGE@ 5 | pkgver=@VERSION@ 6 | pkgrel=@packagerelease@ 7 | pkgdesc="pdnsd is a proxy DNS server with permanent caching (the cache contents are written to hard disk on exit) that is designed to cope with unreachable or down DNS servers." 8 | url="http://members.home.nl/p.a.rombouts/pdnsd.html" 9 | license="GPLv3" 10 | depends=() 11 | makedepends=(glibc) 12 | conflicts=() 13 | replaces=() 14 | backup=() 15 | install= 16 | source=(http://members.home.nl/p.a.rombouts/pdnsd/releases/$pkgname-$pkgver-$pkgrel.tar.gz) 17 | md5sums=() 18 | 19 | build() { 20 | cd $startdir/src/$pkgname-$pkgver 21 | ./configure --prefix=/usr --enable-ipv6 --sysconfdir=/etc --with-distribution=ArchLinux 22 | make || return 1 23 | make DESTDIR=$startdir/pkg install 24 | } 25 | -------------------------------------------------------------------------------- /jni/pdnsd/README: -------------------------------------------------------------------------------- 1 | You can find the documentation for pdnsd in the doc/ directory. The html 2 | documentation (which I recommend) is in the doc/html/ subdirectory. 3 | The pure text documentation (which is generated automatically from the 4 | html documentation) is in doc/txt/. 5 | The following documents are available: 6 | 7 | index.html / intro.txt Overview, system requirements 8 | doc.html / manual.txt Building, installation and usage instructions 9 | faq.html / faq.txt The FAQ 10 | 11 | Share and enjoy! 12 | Thomas 13 | 14 | 15 | For news about recent changes in pdnsd the following files may be of 16 | interest to you: 17 | 18 | README.par 19 | ChangeLog 20 | NEWS 21 | 22 | Last revised: 08 July 2007 by Paul Rombouts 23 | -------------------------------------------------------------------------------- /jni/pdnsd/THANKS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/jni/pdnsd/THANKS -------------------------------------------------------------------------------- /jni/pdnsd/TODO: -------------------------------------------------------------------------------- 1 | - Implement a reference counter to ensure that newly entered records are not 2 | purged immediately (really needed?) 3 | - Perhaps do a two-step form of recursive query: first query those servers we 4 | have got cached, then (if unsuccessful) look the others up and query again. 5 | The impact of this optimisation may not be very big, because all sane servers 6 | give A records for NS records if possible. 7 | - Test for compatibility on other Unix-like Systems other than the BSDs and 8 | Linux; rewrite the functions in netdev.c and icmp.c for those OSs if 9 | necessary. Also try to get compatibility for other compilers than gcc. 10 | - Write an install rule for the Slackware start-up script. 11 | - Update the FAQ. 12 | - Implement DNSSEC support. Since version 1.2.9, pdnsd is able to cache the RR 13 | types necessary for DNSSEC, but the resolver is not yet security aware. 14 | - Implement a lookup table (hash table) for queries in progress. This would 15 | enable a thread that is resolving a query that is already being handled by 16 | another thread to wait for that other thread to finish and copy its result 17 | rather than independently query remote servers. It is very common for 18 | resolvers to resend UDP queries if they don't get a reply within a timeout 19 | period and if the answer is not yet cached, this will result in multiple 20 | threads duplicating each others work in the current implementation. 21 | -------------------------------------------------------------------------------- /jni/pdnsd/contrib/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = pdnsd_dhcp.pl dhcp2pdnsd change_pdnsd_server_ip.pl README 3 | -------------------------------------------------------------------------------- /jni/pdnsd/contrib/README: -------------------------------------------------------------------------------- 1 | Last revised: 27 July 2003 by Paul Rombouts 2 | 3 | This directory contains user-contributed scripts for use with pdnsd. 4 | So far there are: 5 | 6 | pdnsd_dhcp.pl, save_ram.pl 7 | A perl script contributed by Marko Stolle (derived from a script by 8 | Mike Stella) to watch a ISC DHCPD leases file and add local records for 9 | the hosts listed there. This makes pdnsd useable in a DHCP setup. 10 | Please look into the script for usage instructions (you will probably 11 | also need to customize some settings there). 12 | For details about save_ram.pl, please look into pdnsd_dhcp.pl 13 | 14 | dhcp2pdnsd 15 | A rc script for pdnsd, also by Marko Stolle. You might need to change 16 | it slightly to make it run with your distro. 17 | 18 | change_pdnsd_server_ip.pl 19 | A perl script contributed by Paul Rombouts for automatically updating 20 | the configuration file if the DNS server configuration has changed. 21 | For instance, you could place the following line in the script 22 | /sbin/ifup-local 23 | 24 | /usr/local/sbin/change_pdnsd_server_ip.pl isplabel "$DNS" /etc/pdnsd.conf 25 | 26 | where $DNS contains the IP addresses (in comma separated format) of the 27 | DNS servers obtained by DHCP negotiation. The perl script only 28 | overwrites /etc/pdnsd.conf if the DNS configuration has actually 29 | changed, in which case the previous configuration file is saved as 30 | /etc/pdnsd.conf.save 31 | -------------------------------------------------------------------------------- /jni/pdnsd/contrib/dhcp2pdnsd: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # dhcp2pdnsd Start/Stop DHCP to DNS update script 4 | # 5 | # chkconfig: 345 96 99 6 | # description: DHCP to DNS update script 7 | # processname: dhcp2pdnsd.pl 8 | # 9 | # $Id: dhcp2pdnsd,v 1.1 2001/03/25 20:01:34 tmm Exp $ 10 | 11 | where="/usr/local/bin/" 12 | name="pdnsd_dhcp.pl" 13 | 14 | # Source function library. 15 | . /etc/rc.d/init.d/functions 16 | 17 | # Get config. 18 | . /etc/sysconfig/network 19 | 20 | # See how we were called. 21 | case "$1" in 22 | start) 23 | $where$name > /dev/null 2> /dev/null & 24 | action "Starting DHCP to DNS update script: " /bin/true 25 | ;; 26 | stop) 27 | p=`ps h -C $name | awk '{print $1}'` 28 | [ $p -gt 0 ] 2> /dev/null && kill $p && action "Stopping DHCP to DNS update script: " /bin/true 29 | [ $p -gt 0 ] 2> /dev/null || action "Stopping DHCP to DNS update script: " /bin/false 30 | ;; 31 | status) 32 | p=`ps h -C $name | awk '{print $1}'` 33 | [ $p -gt 0 ] 2> /dev/null && echo 'running as '$p 34 | [ $p -gt 0 ] 2> /dev/null || echo 'not running' 35 | ;; 36 | restart|reload) 37 | $0 stop 38 | $0 start 39 | ;; 40 | *) 41 | echo "Usage: dhcp2pdnsd {start|stop|status|restart|reload}" 42 | exit 1 43 | esac 44 | 45 | exit 0 46 | -------------------------------------------------------------------------------- /jni/pdnsd/doc/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | man_MANS = pdnsd.8 pdnsd-ctl.8 pdnsd.conf.5 3 | 4 | # Note: pdnsd-ctl.8, pdnsd.conf.5.in, dl.html and the txt docs are handled by dist-hook rule. 5 | EXTRA_DIST = pdnsd.conf.in pdnsd.8.in \ 6 | html/dl.html.in html/doc.html html/faq.html html/index.html \ 7 | doc_makefile html/doc_makefile txt/doc_makefile \ 8 | html2confman.pl html/htmlsubst.pl 9 | 10 | # XXX: Do not insist to set the config file owner to root to avoid breaking RPM 11 | # builds 12 | install-data-hook: 13 | $(mkinstalldirs) "$(DESTDIR)$(sysconfdir)" 14 | if test `whoami` = "root"; then \ 15 | $(INSTALL) -o 0 -g 0 -m 644 pdnsd.conf "$(DESTDIR)$(sysconfdir)/pdnsd.conf.sample" ; \ 16 | else \ 17 | $(INSTALL) -m 644 pdnsd.conf "$(DESTDIR)$(sysconfdir)/pdnsd.conf.sample" ; \ 18 | fi 19 | 20 | dist-hook: doc_makefile 21 | @$(MAKE) -f doc_makefile doc 22 | cp -p --parents pdnsd-ctl.8 pdnsd.conf.5.in \ 23 | html/dl.html txt/faq.txt txt/intro.txt txt/manual.txt \ 24 | $(distdir) 25 | 26 | distclean-local: doc_makefile 27 | @$(MAKE) -f doc_makefile clean 28 | 29 | -------------------------------------------------------------------------------- /jni/pdnsd/doc/doc_makefile: -------------------------------------------------------------------------------- 1 | # This file was written by Paul Rombouts. 2 | # Because pdnsd currently has a very idiosyncratic method of building documentation 3 | # I prefer to keep the actual build rules outside of the Makefiles an ordinary user 4 | # would use to compile pdnsd and therefore I have put them into separate 'doc_makefile's. 5 | # 6 | # To rebuild pdnsd docs after you have modified something that other files depend on, 7 | # run 'make -f doc_makefile doc' in the doc/ directory. 8 | # This makefile is also invoked when you build a pdnsd distribution tarball 9 | # using 'make dist' in the toplevel pdnsd source directory. 10 | # 11 | # If anyone thinks there is a much more elegant method for building the pdnsd docs 12 | # using a conventional autoconf/automake process, please let me know. 13 | 14 | versionfile = ../version 15 | 16 | doc: pdnsd-ctl.8 pdnsd.conf.5.in html txt 17 | .PHONY: pdnsd-ctl.8 doc html txt clean 18 | 19 | pdnsd-ctl.8: 20 | @pver=`cat $(versionfile)` && \ 21 | mver=`perl -e 'while(<>) {if(/^\s*\.TH(?:\s+(?:"[^"]*"|[^"\s]+)){3}\s+"pdnsd\s+([^"]*)"/) {print "$$1\n";exit 0}} \ 22 | die "Cannot find version in $$ARGV\n"' $@` && { \ 23 | test "$$mver" = "$$pver" || { \ 24 | perl -p -i.makesave -e 's/^(\s*\.TH(?:\s+(?:"[^"]*"|[^"\s]+)){3}\s+"pdnsd\s+)[^"]*(")/$${1}'"$$pver"'$${2}/' $@ && \ 25 | echo "Updated version in $@: $$mver -> $$pver"; \ 26 | }; \ 27 | } 28 | 29 | pdnsd.conf.5.in: html/doc.html html2confman.pl 30 | perl html2confman.pl $< > $@ 31 | 32 | html txt: 33 | @cd $@ && $(MAKE) -f doc_makefile 34 | 35 | clean: 36 | @rm -fv pdnsd.conf.5.in 37 | @cd html && $(MAKE) -f doc_makefile clean 38 | @cd txt && $(MAKE) -f doc_makefile clean 39 | -------------------------------------------------------------------------------- /jni/pdnsd/doc/html/doc_makefile: -------------------------------------------------------------------------------- 1 | 2 | versionfile = ../../version 3 | arch = i686 4 | arch2 = x86_64 5 | extver = _sl6 6 | system = Scientific Linux 6.2 system 7 | 8 | doc: dl.html 9 | .PHONY: doc clean 10 | 11 | # If the existing dl.html contains '???', then certain packages were missing 12 | # during the previous build and dl.html needs to be built again. 13 | ifneq ($(shell grep -F -l -e '???' dl.html),) 14 | .PHONY: dl.html 15 | endif 16 | 17 | dl.html: %.html: %.html.in htmlsubst.pl $(versionfile) 18 | perl htmlsubst.pl version=`cat $(versionfile)` \ 19 | baseurl='http://members.home.nl/p.a.rombouts/pdnsd/' \ 20 | arch=$(arch) arch2=$(arch2) extver=$(extver) system="$(system)" $< > $@ 21 | 22 | clean: 23 | @rm -fv dl.html 24 | -------------------------------------------------------------------------------- /jni/pdnsd/doc/html/htmlsubst.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # Primitive ad-hoc script for updating pdnsd html doc files. 4 | # Written by Paul Rombouts. 5 | 6 | use strict; 7 | use integer; 8 | use POSIX qw(strftime); 9 | 10 | my %paramvals=(); 11 | 12 | while(@ARGV && $ARGV[0]=~/^([^=]*)=(.*)$/) { 13 | my $param=$1; my $val=$2; 14 | if($param =~ /^[[:alpha:]]\w*$/) { 15 | $paramvals{$param}=$val; 16 | } 17 | else {warn "Warning: invalid parameter '$param' ignored.\n"} 18 | shift @ARGV; 19 | } 20 | 21 | sub sizeof { 22 | my($arg)=@_; 23 | (my $str= $arg) =~ s/\$(?:([[:alpha:]]\w*)\b|\{([[:alpha:]]\w*)\})/ 24 | defined($paramvals{$+})?$paramvals{$+}:defined($ENV{$+})?$ENV{$+}:''/eg; 25 | my $filename=eval($str); 26 | (-f $filename) or return '???'; 27 | (((-s $filename)+1023)/1024).'kB'; 28 | } 29 | 30 | while(<>) { 31 | s/\$(?:date\b|\{date\})/strftime("%d %b %Y",localtime)/eg; 32 | s/\$sizeof\(([^()]*)\)/sizeof($1)/eg; 33 | s/\$(?:([[:alpha:]]\w*)\b|\{([[:alpha:]]\w*)\})/ 34 | defined($paramvals{$+})?$paramvals{$+}:defined($ENV{$+})?$ENV{$+}:''/eg; 35 | print; 36 | } 37 | -------------------------------------------------------------------------------- /jni/pdnsd/doc/html/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lparam/xSocks-android/1eb423d97a7d136a74e950eb96355ec912addfec/jni/pdnsd/doc/html/index.html -------------------------------------------------------------------------------- /jni/pdnsd/doc/txt/doc_makefile: -------------------------------------------------------------------------------- 1 | # Makefile for converting pdnsd html documentation to text files. 2 | # This file was based on a Makefile originally written by Thomas Moestl 3 | # and adapted by Paul Rombouts. 4 | 5 | 6 | HTML2TXT=w3m -dump -cols 80 -T text/html 7 | 8 | doc: intro.txt manual.txt faq.txt 9 | .PHONY: doc clean 10 | 11 | intro.txt: ../html/index.html 12 | sed -e 's///-->/g' ../html/index.html | $(HTML2TXT) | sed -e 's/[[:blank:]]\+$$//' > intro.txt 13 | 14 | manual.txt: ../html/doc.html 15 | sed -e 's///-->/g' ../html/doc.html | $(HTML2TXT) | sed -e 's/[[:blank:]]\+$$//' > manual.txt 16 | 17 | faq.txt: ../html/faq.html 18 | sed -e 's///-->/g' ../html/faq.html | $(HTML2TXT) | sed -e 's/[[:blank:]]\+$$//' > faq.txt 19 | 20 | clean: 21 | @rm -fv intro.txt manual.txt faq.txt 22 | -------------------------------------------------------------------------------- /jni/pdnsd/file-list.base.in: -------------------------------------------------------------------------------- 1 | %defattr(-,root,root) 2 | %doc AUTHORS THANKS COPYING COPYING.BSD ChangeLog ChangeLog.old INSTALL NEWS README README.par README.par.old TODO 3 | %config /etc/pdnsd.conf.sample 4 | %attr(750, @def_id@, @def_id@) %dir @cachedir@ 5 | %attr(640, @def_id@, @def_id@) %config @cachedir@/pdnsd.cache 6 | -------------------------------------------------------------------------------- /jni/pdnsd/src/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | sbin_PROGRAMS = pdnsd 3 | 4 | pdnsd_CFLAGS = -DCONFDIR='"$(sysconfdir)"' $(thread_CFLAGS) 5 | 6 | pdnsd_SOURCES = conf-parser.c conff.c consts.c debug.c dns.c dns_answer.c \ 7 | dns_query.c error.c helpers.c icmp.c list.c main.c netdev.c rr_types.c \ 8 | status.c servers.c thread.c cache.c hash.c conf-parser.h \ 9 | conf-keywords.h conff.h consts.h debug.h dns.h dns_answer.h \ 10 | dns_query.h error.h helpers.h icmp.h ipvers.h list.h netdev.h \ 11 | rr_types.h servers.h status.h thread.h cache.h hash.h pdnsd_assert.h \ 12 | freebsd_netinet_ip_icmp.h 13 | 14 | EXTRA_DIST = make_rr_types_h.pl rr_types.in 15 | 16 | ## Try to do this last 17 | 18 | SUBDIRS = . pdnsd-ctl rc test 19 | 20 | $(pdnsd_OBJECTS): rr_types.h 21 | 22 | rr_types.h: make_rr_types_h.pl rr_types.in 23 | perl make_rr_types_h.pl rr_types.in > rr_types.h 24 | 25 | -------------------------------------------------------------------------------- /jni/pdnsd/src/conf-parser.h: -------------------------------------------------------------------------------- 1 | /* conf-parser.h - definitions for parser of pdnsd config files. 2 | The parser was rewritten in C from scratch and doesn't require (f)lex 3 | or yacc/bison. 4 | 5 | Copyright (C) 2004,2008 Paul A. Rombouts. 6 | 7 | This file is part of the pdnsd package. 8 | 9 | pdnsd is free software; you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation; either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | pdnsd is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with pdnsd; see the file COPYING. If not, see 21 | . 22 | */ 23 | 24 | #ifndef CONF_PARSER_H 25 | #define CONF_PARSER_H 26 | 27 | int confparse(FILE* in, char *prestr, globparm_t *global, servparm_array *servers, int includedepth, char **errstr); 28 | 29 | #endif /* CONF_PARSER_H */ 30 | -------------------------------------------------------------------------------- /jni/pdnsd/src/consts.h: -------------------------------------------------------------------------------- 1 | /* consts.h - Common config constants & handling 2 | 3 | Copyright (C) 2000, 2001 Thomas Moestl 4 | Copyright (C) 2002, 2003, 2005, 2006, 2007, 2009 Paul A. Rombouts 5 | 6 | This file is part of the pdnsd package. 7 | 8 | pdnsd is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | pdnsd is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with pdnsd; see the file COPYING. If not, see 20 | . 21 | */ 22 | 23 | 24 | #ifndef CONSTS_H 25 | #define CONSTS_H 26 | 27 | #include 28 | 29 | #define C_RRTOFFS 64 30 | 31 | enum { 32 | C_ERR, 33 | C_ON, 34 | C_OFF, 35 | C_DEFAULT, 36 | C_DISCOVER, 37 | C_NONE, 38 | C_IF, 39 | C_EXEC, 40 | C_PING, 41 | C_QUERY, 42 | C_ONQUERY, 43 | C_ONTIMEOUT, 44 | UDP_ONLY, 45 | TCP_ONLY, 46 | TCP_UDP, 47 | UDP_TCP, 48 | C_DEV, 49 | C_DIALD, 50 | C_INCLUDED, 51 | C_EXCLUDED, 52 | C_SIMPLE_ONLY, 53 | C_FQDN_ONLY, 54 | C_AUTH, 55 | C_DOMAIN, 56 | C_FAIL, 57 | C_NEGATE 58 | }; 59 | 60 | typedef struct { 61 | const char *name; 62 | int val; 63 | } namevalue_t; 64 | 65 | int binsearch_keyword(const char *name, int len, const namevalue_t dic[], int range); 66 | int lookup_const(const char *name, int len); 67 | const char *const_name(int c); /* Added by Paul Rombouts */ 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /jni/pdnsd/src/dns_answer.h: -------------------------------------------------------------------------------- 1 | /* dns_answer.h - Receive and process icoming dns queries. 2 | 3 | Copyright (C) 2000 Thomas Moestl 4 | Copyright (C) 2005 Paul A. Rombouts 5 | 6 | This file is part of the pdnsd package. 7 | 8 | pdnsd is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | pdnsd is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with pdnsd; see the file COPYING. If not, see 20 | . 21 | */ 22 | 23 | 24 | #ifndef DNS_ANSWER_H 25 | #define DNS_ANSWER_H 26 | 27 | #include 28 | 29 | /* --- from main.c */ 30 | extern pthread_t main_thrid,servstat_thrid,statsock_thrid,tcps_thrid,udps_thrid; 31 | extern volatile int tcp_socket; 32 | extern volatile int udp_socket; 33 | /* --- */ 34 | 35 | int init_udp_socket(void); 36 | int init_tcp_socket(void); 37 | void start_dns_servers(void); 38 | int report_thread_stat(int f); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /jni/pdnsd/src/icmp.h: -------------------------------------------------------------------------------- 1 | /* icmp.h - Server response tests using ICMP echo requests 2 | Copyright (C) 2000 Thomas Moestl 3 | Copyright (C) 2007 Paul A. Rombouts 4 | 5 | This file is part of the pdnsd package. 6 | 7 | pdnsd is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | pdnsd is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with pdnsd; see the file COPYING. If not, see 19 | . 20 | */ 21 | 22 | 23 | #ifndef ICMP_H 24 | #define ICMP_H 25 | 26 | 27 | #include 28 | #include "ipvers.h" 29 | 30 | volatile extern int ping_isocket; 31 | volatile extern int ping6_isocket; 32 | 33 | /* initialize a socket for pinging */ 34 | void init_ping_socket(void); 35 | 36 | /* 37 | * This is a classical ping routine. 38 | * timeout in 10ths of seconds, rep is the repetition count. 39 | */ 40 | 41 | int ping(pdnsd_a *addr, int timeout, int rep); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /jni/pdnsd/src/netdev.h: -------------------------------------------------------------------------------- 1 | /* netdev.h - Test network devices for existence and status 2 | Copyright (C) 2000 Thomas Moestl 3 | 4 | This file is part of the pdnsd package. 5 | 6 | pdnsd is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | pdnsd is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with pdnsd; see the file COPYING. If not, see 18 | . 19 | */ 20 | 21 | 22 | #ifndef _NETDEV_H_ 23 | #define _NETDEV_H_ 24 | 25 | #include 26 | #include "ipvers.h" 27 | 28 | int if_up(char *devname); 29 | int dev_up(char *ifname, char *devname); 30 | int is_local_addr(pdnsd_a *a); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /jni/pdnsd/src/pdnsd-ctl/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | sbin_PROGRAMS = pdnsd-ctl 3 | 4 | pdnsd_ctl_SOURCES = pdnsd-ctl.c 5 | pdnsd_ctl_LDADD = rr_types.o 6 | pdnsd_ctl_DEPENDENCIES = rr_types.o 7 | 8 | # These are Symlinks we want to have in the package 9 | #EXTRA_DIST = rr_types.h 10 | 11 | pdnsd-ctl.o rr_types.o: ../rr_types.h 12 | 13 | ../rr_types.h: ../make_rr_types_h.pl ../rr_types.in 14 | perl ../make_rr_types_h.pl ../rr_types.in > ../rr_types.h 15 | 16 | rr_types.o: %.o: ../%.c 17 | $(COMPILE) -DCLIENT_ONLY -c $< 18 | 19 | -------------------------------------------------------------------------------- /jni/pdnsd/src/rc/ArchLinux/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | install-exec-local: 3 | if [ "$(distribution)" = "ArchLinux" ] ; then \ 4 | $(mkinstalldirs) "$(DESTDIR)/etc/rc.d"; \ 5 | $(INSTALL_SCRIPT) $(srcdir)/pdnsd "$(DESTDIR)/etc/rc.d/pdnsd";\ 6 | fi 7 | 8 | -------------------------------------------------------------------------------- /jni/pdnsd/src/rc/ArchLinux/pdnsd.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . /etc/rc.conf 4 | . /etc/rc.d/functions 5 | 6 | PID=`pidof -o %PPID @prefix@/sbin/pdnsd` 7 | 8 | start() { 9 | stat_busy "Starting PDNSD" 10 | [ -z "$PID" ] && @prefix@/sbin/pdnsd -d -c /etc/pdnsd.conf 11 | if [ $? -gt 0 ]; then 12 | stat_fail 13 | else 14 | add_daemon pdnsd 15 | stat_done 16 | fi 17 | } 18 | 19 | stop() { 20 | stat_busy "Stopping PDNSD" 21 | [ ! -z "$PID" ] && kill $PID &> /dev/null 22 | if [ $? -gt 0 ]; then 23 | stat_fail 24 | else 25 | rm_daemon pdnsd 26 | stat_done 27 | fi 28 | } 29 | 30 | case "$1" in 31 | start) 32 | start 33 | ;; 34 | stop) 35 | stop 36 | ;; 37 | restart) 38 | $0 stop 39 | sleep 2 40 | $0 start 41 | ;; 42 | *) 43 | echo "usage: $0 {start|stop|restart}" 44 | esac 45 | exit 0 46 | -------------------------------------------------------------------------------- /jni/pdnsd/src/rc/Debian/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | install-exec-local: 3 | if [ "$(distribution)" = "Debian" ] ; then \ 4 | CURDIR=`pwd`; \ 5 | $(mkinstalldirs) "$(DESTDIR)/etc/init.d"; \ 6 | $(INSTALL_SCRIPT) $(srcdir)/pdnsd "$(DESTDIR)/etc/init.d"; \ 7 | update-rc.d pdnsd defaults 19 ;\ 8 | fi 9 | -------------------------------------------------------------------------------- /jni/pdnsd/src/rc/Debian/pdnsd.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # This script was written and contributed by Markus Mohr, and 5 | # slightly modified by me for version 1.0.6 (which obviously 6 | # broke it some way). I then applied a set of corrections 7 | # by Markus Mohr. 8 | # 9 | # Carsten Block has patched this with some magic so that 10 | # the actual script is generated by configure, and that 11 | # the pdnsd user is determined from pdnsd.conf 12 | # I changed this a little to use the --pdnsd-user option 13 | # of pdnsd to determine the run_as user. 14 | # 15 | 16 | PATH=/sbin:/bin:/usr/sbin:/usr/bin 17 | 18 | test -x @prefix@/sbin/pdnsd || exit 0 19 | 20 | case "$1" in 21 | start) 22 | # Check if cache dir exists and recreate if neccessary 23 | test -d @cachedir@ || mkdir @cachedir@ 24 | RUNAS=`@prefix@/sbin/pdnsd --pdnsd-user` || echo -n " failed" 25 | [ -z "$RUNAS" ] && RUNAS=nobody 26 | chown $RUNAS @cachedir@ 27 | echo -n "Starting domain name service: pdnsd" 28 | start-stop-daemon --start --quiet --pidfile /var/run/pdnsd.pid --name pdnsd \ 29 | --exec @prefix@/sbin/pdnsd -- --daemon -p /var/run/pdnsd.pid \ 30 | || echo -n " failed" 31 | echo "." 32 | ;; 33 | 34 | stop) 35 | echo -n "Stopping domain name service: pdnsd" 36 | start-stop-daemon --stop --quiet --pidfile /var/run/pdnsd.pid --name pdnsd --exec @prefix@/sbin/pdnsd \ 37 | || echo -n " failed" 38 | echo "." 39 | ;; 40 | 41 | restart) 42 | $0 stop 43 | $0 start 44 | ;; 45 | 46 | *) 47 | echo "Usage: /etc/init.d/pdnsd {start|stop|restart}" >&2 48 | exit 1 49 | ;; 50 | esac 51 | 52 | exit 0 53 | -------------------------------------------------------------------------------- /jni/pdnsd/src/rc/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = RedHat SuSE Debian Slackware ArchLinux 3 | 4 | EXTRA_DIST = README 5 | 6 | -------------------------------------------------------------------------------- /jni/pdnsd/src/rc/RedHat/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | # no need to create links. 'chkconfig' will take care of this. 3 | # In the spec case, chkconfig is called during rpm install 4 | install-exec-local: 5 | if [ "$(distribution)" = "RedHat" ] ; then \ 6 | $(mkinstalldirs) "$(DESTDIR)/etc/rc.d/init.d"; \ 7 | $(INSTALL_SCRIPT) $(srcdir)/pdnsd "$(DESTDIR)/etc/rc.d/init.d/pdnsd"; \ 8 | if [ "$(specbuild)" = "no" ] ; then \ 9 | /sbin/chkconfig --add pdnsd; \ 10 | fi \ 11 | fi 12 | 13 | -------------------------------------------------------------------------------- /jni/pdnsd/src/rc/Slackware/Makefile.am: -------------------------------------------------------------------------------- 1 | # TODO: write an install rule for the Slackware start-up script. 2 | 3 | install-exec-local: 4 | -------------------------------------------------------------------------------- /jni/pdnsd/src/rc/Slackware/rc.pdnsd.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # /etc/rc.d/rc.pdnsd 4 | # 5 | # Starts the Proxy DNS Daemon 6 | # 7 | # description: Proxy DNS Daemon 8 | # processname: pdnsd 9 | # config: /etc/pdnsd.conf 10 | # distribution: Slackware 11 | # author: Nikola Kotur 12 | # 13 | # Additional info: 14 | # 1) put these lines in the /etc/rc.d/rc.M: 15 | # if [ -x /etc/rc.d/rc.pdnsd ]; then 16 | # /etc/rc.d/rc.pdnsd start 17 | # fi 18 | # 19 | # 2) put these lines in the /etc/rc.d/rc.6 and /etc/rc.d/rc.K: 20 | # if [ -x /etc/rc.d/rc.pdnsd ]; then 21 | # /etc/rc.d/rc.pdnsd stop 22 | # fi 23 | 24 | 25 | test -x @prefix@/sbin/pdnsd || exit 0 26 | [ -f @sysconfdir@/pdnsd.conf ] || exit 1 27 | 28 | RETVAL=0 29 | 30 | start() { 31 | echo -n "Starting pdnsd... " 32 | RETVAL=$? 33 | @prefix@/sbin/pdnsd -d 34 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pdnsd 35 | echo ' OK' 36 | } 37 | 38 | stop() { 39 | echo -n "Shutting down pdnsd... " 40 | killall pdnsd 41 | RETVAL=$? 42 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/pdnsd 43 | echo ' OK' 44 | } 45 | 46 | restart() { 47 | stop 48 | start 49 | } 50 | 51 | condrestart() { 52 | [ -e /var/lock/subsys/pdnsd ] && restart 53 | return 0 54 | } 55 | 56 | case "$1" in 57 | start) 58 | start 59 | ;; 60 | stop) 61 | stop 62 | ;; 63 | reload|restart) 64 | restart 65 | ;; 66 | condrestart) 67 | condrestart 68 | ;; 69 | *) 70 | echo $"Usage: $0 {start|stop|restart|condrestart|reload}" 71 | RETVAL=1 72 | esac 73 | 74 | exit $RETVAL 75 | -------------------------------------------------------------------------------- /jni/pdnsd/src/rc/SuSE/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | install-exec-local: 3 | if [ "$(distribution)" = "SuSE" ] ; then \ 4 | CURDIR=`pwd`; \ 5 | $(mkinstalldirs) "$(DESTDIR)/sbin/init.d"; \ 6 | $(INSTALL_SCRIPT) $(srcdir)/pdnsd "$(DESTDIR)/sbin/init.d/pdnsd"; \ 7 | $(mkinstalldirs) "$(DESTDIR)/sbin/init.d/rc2.d"; \ 8 | cd "$(DESTDIR)/sbin/init.d/rc2.d"; \ 9 | ln -fs ../pdnsd K34pdnsd; ln -s ../pdnsd S11pdnsd; \ 10 | cd $$CURDIR ; \ 11 | $(mkinstalldirs) "$(DESTDIR)/sbin/init.d/rc3.d"; \ 12 | cd "$(DESTDIR)/sbin/init.d/rc3.d"; \ 13 | ln -fs ../pdnsd K34pdnsd; ln -s ../pdnsd S11pdnsd; \ 14 | cd $$CURDIR ; \ 15 | grep "START_PDNSD" "$(DESTDIR)/etc/rc.config" > /dev/null ; \ 16 | if [ $$? -eq 1 ] ; then \ 17 | echo -e "\n\n#\n# Set to yes to start pdnsd at boot time\n#\nSTART_PDNSD=yes" >> /etc/rc.config ; \ 18 | fi \ 19 | fi 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /jni/pdnsd/src/sort_namevalues.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | my %dic; 6 | my $maxkeylen=0; 7 | 8 | while(<>) { 9 | if(/"(\w+)".*?(\w+)/) { 10 | my $key=$1; my $val=$2; 11 | if($dic{$key}) {die "The key \"$key\" does not have a unique value.\n"} 12 | $dic{$key}=$val; 13 | if(length($key)>$maxkeylen) {$maxkeylen=length($key)} 14 | } 15 | else {die "Can't find key-value pair in following line:\n$_\n"} 16 | } 17 | 18 | my $linenr=0; 19 | foreach my $key (sort(keys %dic)) { 20 | if($linenr++) {print ",\n"} 21 | printf("\t{%-*s%s}",$maxkeylen+4,"\"$key\",",$dic{$key}); 22 | } 23 | print "\n"; 24 | 25 | exit 26 | -------------------------------------------------------------------------------- /jni/pdnsd/src/test/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | .PHONY: all clean distclean 3 | 4 | noinst_PROGRAMS = if_up is_local_addr tping random 5 | 6 | ## Dirty trick: I demand that these objects be built; then, with the knowledge 7 | ## that the object files will end up here, I redefine the link chain. 8 | 9 | TESTADDSRC= 10 | #TESTADDSRC= netdev.c error.c thread.c helpers.c icmp.c 11 | TESTDEPS = netdev.o error.o thread.o helpers.o icmp.o 12 | 13 | TESTOBJS = netdev.o error.o thread.o helpers.o icmp.o 14 | 15 | if_up_SOURCES = if_up.c $(TESTADDSRC) 16 | if_up_LDADD = $(TESTOBJS) @thread_CFLAGS@ 17 | if_up_DEPENDENCIES = $(TESTDEPS) 18 | 19 | is_local_addr_SOURCES = is_local_addr.c $(TESTADDSRC) 20 | is_local_addr_LDADD = $(TESTOBJS) @thread_CFLAGS@ 21 | is_local_addr_DEPENDENCIES = $(TESTDEPS) 22 | 23 | tping_SOURCES = tping.c $(TESTADDSRC) 24 | tping_LDADD = $(TESTOBJS) @thread_CFLAGS@ 25 | tping_DEPENDENCIES = $(TESTDEPS) 26 | 27 | random_SOURCES = random.c $(TESTADDSRC) 28 | random_LDADD = $(TESTOBJS) @thread_CFLAGS@ 29 | random_DEPENDENCIES = $(TESTDEPS) 30 | 31 | # These are Symlinks we want to have in the package 32 | #EXTRA_DIST = conff.h error.h helpers.h icmp.h ipvers.h netdev.h thread.h cacheing 33 | 34 | $(TESTOBJS): %.o: ../%.c 35 | $(COMPILE) @thread_CFLAGS@ -c $< 36 | -------------------------------------------------------------------------------- /jni/pdnsd/src/test/if_up.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "../helpers.h" 6 | #include "../conff.h" 7 | #include "../netdev.h" 8 | 9 | short int daemon_p=0; 10 | #if DEBUG>0 11 | short int debug_p=0; 12 | #endif 13 | short int verbosity=VERBOSITY; 14 | #if defined(ENABLE_IPV4) && defined(ENABLE_IPV6) 15 | short int run_ipv4=DEFAULT_IPV4; 16 | #endif 17 | #ifdef ENABLE_IPV6 18 | struct in6_addr ipv4_6_prefix; 19 | #endif 20 | pthread_t main_thrid,servstat_thrid; 21 | volatile int signal_interrupt; 22 | #if DEBUG>0 23 | FILE *dbg_file; 24 | #endif 25 | globparm_t global; 26 | 27 | 28 | int main(int argc, char *argv[]) 29 | { 30 | if (argc!=2) { 31 | printf("Usage: %s \n",argv[0]); 32 | exit(1); 33 | } 34 | printf("if_up: %s - %s\n",argv[1],if_up(argv[1])?"up":"down"); 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /jni/pdnsd/src/test/is_local_addr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "../helpers.h" 6 | #include "../conff.h" 7 | #include "../netdev.h" 8 | #include "../ipvers.h" 9 | 10 | short int daemon_p=0; 11 | #if DEBUG>0 12 | short int debug_p=0; 13 | #endif 14 | short int verbosity=VERBOSITY; 15 | #if defined(ENABLE_IPV4) && defined(ENABLE_IPV6) 16 | short int run_ipv4=DEFAULT_IPV4; 17 | #endif 18 | #ifdef ENABLE_IPV6 19 | struct in6_addr ipv4_6_prefix; 20 | #endif 21 | pthread_t main_thrid,servstat_thrid; 22 | volatile int signal_interrupt; 23 | #if DEBUG>0 24 | FILE *dbg_file; 25 | #endif 26 | globparm_t global; 27 | 28 | 29 | int main(int argc, char *argv[]) 30 | { 31 | pdnsd_a a; 32 | 33 | if (argc!=2) { 34 | printf("Usage: %s
\n",argv[0]); 35 | exit(1); 36 | } 37 | #ifdef ENABLE_IPV4 38 | if (inet_aton(argv[1],&a.ipv4)) { 39 | # ifdef ENABLE_IPV6 40 | run_ipv4=1; 41 | # endif 42 | printf("is %s a local addr: %s\n",argv[1],is_local_addr(&a)?"yes":"no"); 43 | return 0; 44 | } 45 | #endif 46 | #ifdef ENABLE_IPV6 47 | if (inet_pton(AF_INET6,argv[1],&a.ipv6)) { 48 | # ifdef ENABLE_IPV4 49 | run_ipv4=0; 50 | # endif 51 | printf("is %s a local addr: %s\n",argv[1],is_local_addr(&a)?"yes":"no"); 52 | return 0; 53 | } 54 | #endif 55 | printf("Adress invalid.\n"); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /jni/pdnsd/src/test/random.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "../helpers.h" 6 | #include "../conff.h" 7 | 8 | short int daemon_p=0; 9 | #if DEBUG>0 10 | short int debug_p=0; 11 | #endif 12 | short int verbosity=VERBOSITY; 13 | #if defined(ENABLE_IPV4) && defined(ENABLE_IPV6) 14 | short int run_ipv4=DEFAULT_IPV4; 15 | #endif 16 | #ifdef ENABLE_IPV6 17 | struct in6_addr ipv4_6_prefix; 18 | #endif 19 | pthread_t main_thrid,servstat_thrid; 20 | volatile int signal_interrupt; 21 | #if DEBUG>0 22 | FILE *dbg_file; 23 | #endif 24 | globparm_t global; 25 | 26 | 27 | int main(void) 28 | { 29 | init_rng(); 30 | printf("%i\n",(int)get_rand16()); 31 | free_rng(); 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /jni/pdnsd/src/test/tping.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "../helpers.h" 6 | #include "../conff.h" 7 | #include "../icmp.h" 8 | #include "../ipvers.h" 9 | 10 | short int daemon_p=0; 11 | #if DEBUG>0 12 | short int debug_p=0; 13 | #endif 14 | short int verbosity=VERBOSITY; 15 | #if defined(ENABLE_IPV4) && defined(ENABLE_IPV6) 16 | short int run_ipv4=DEFAULT_IPV4; 17 | #endif 18 | #ifdef ENABLE_IPV6 19 | struct in6_addr ipv4_6_prefix; 20 | #endif 21 | pthread_t main_thrid,servstat_thrid; 22 | volatile int signal_interrupt; 23 | #if DEBUG>0 24 | FILE *dbg_file; 25 | #endif 26 | globparm_t global; 27 | 28 | 29 | int main(int argc, char *argv[]) 30 | { 31 | pdnsd_a a; 32 | 33 | if (argc!=2) { 34 | printf("Usage: %s
\n",argv[0]); 35 | exit(1); 36 | } 37 | #ifdef ENABLE_IPV4 38 | if (inet_aton(argv[1],&a.ipv4)) { 39 | # ifdef ENABLE_IPV6 40 | run_ipv4=1; 41 | # endif 42 | init_ping_socket(); 43 | printf("ping (v4) echo from %s: %i\n",argv[1],ping(&a,100,2)); 44 | return 0; 45 | } 46 | #endif 47 | #ifdef ENABLE_IPV6 48 | if (inet_pton(AF_INET6,argv[1],&a.ipv6)) { 49 | # ifdef ENABLE_IPV4 50 | run_ipv4=0; 51 | # endif 52 | init_ping_socket(); 53 | printf("ping (v6) echo from %s: %i\n",argv[1],ping(&a,100,2)); 54 | return 0; 55 | } 56 | #endif 57 | printf("Adress invalid.\n"); 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /jni/pdnsd/version: -------------------------------------------------------------------------------- 1 | 1.2.9b-par 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------