├── .gitignore
├── LICENSE
├── README.md
├── app
├── build.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── aidl
│ └── net
│ │ └── typeblog
│ │ └── socks
│ │ └── IVpnService.aidl
│ ├── build-jni.sh
│ ├── groovy
│ └── net
│ │ └── typeblog
│ │ └── socks
│ │ ├── BootReceiver.groovy
│ │ ├── MainActivity.groovy
│ │ ├── ProfileFragment.groovy
│ │ ├── SocksVpnService.groovy
│ │ └── util
│ │ ├── Constants.groovy
│ │ ├── Profile.groovy
│ │ ├── ProfileFactory.groovy
│ │ ├── ProfileManager.groovy
│ │ ├── Routes.groovy
│ │ └── Utility.groovy
│ ├── java
│ └── net
│ │ └── typeblog
│ │ └── socks
│ │ └── System.java
│ ├── 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
│ └── res
│ ├── drawable-xxhdpi
│ └── ic_launcher.png
│ ├── layout
│ ├── action_switch.xml
│ └── main.xml
│ ├── menu
│ └── main.xml
│ ├── values
│ ├── arrays.xml
│ ├── pdnsd.xml
│ ├── simpleroute.xml
│ ├── strings.xml
│ └── styles.xml
│ └── xml
│ └── settings.xml
├── build.gradle
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | obj
3 | libs
4 | assets
5 | .gradle
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | SocksDroid
2 | ---
3 | SOCKS5 client for Android 5.0+ making use of the `VpnService` API and `tun2socks` so that it works without root permission (unlike ProxyDroid).
4 |
5 | Most of the JNI code are imported from `shadowsocks-android` project because they have already done most of the work.
6 |
7 | ### THIS IS NOT A SHADOWSOCKS CLIENT! SOCKS5 IS NOT SHADOWSOCKS!
8 |
9 | UDP Forwarding
10 | ---
11 | As `tun2socks` does not support UDP associate but has its own implementation of UDP forwarding `badvpn-udpgw`, so it is needed that the udpgw daemon run on remote server to use UDP forwarding.
12 |
13 | On remote server
14 |
15 | ```
16 | badvpn-udpgw --listen-addr 127.0.0.1:7300
17 | ```
18 |
19 | And set `UDP Gateway` in this app to `127.0.0.1:7300`
20 |
21 | DNS
22 | ---
23 | If the server does not run `udpgw`, DNS lookups can also be processed in this app.
24 |
25 | It makes use of the TCP DNS feature of `pdnsd`. You just set a DNS server that supports TCP DNS in this app, and all DNS requests will be transformed into TCP queries.
26 |
27 | Routing
28 | ---
29 | The app has an embedded list of non-Chinese IPs. Chinese users can make use of it for best experience in bypassing GFW.
30 |
31 | GFW
32 | ---
33 | Note that SOCKS5 is currently blocked by the GFW, which means Chinese users cannot connect to any SOCKS5 servers outside China.
34 |
35 | But there are still solutions. For example, use `stunnel` to wrap the SOCKS5 connection with SSL. See my project stunnel-android for usage on Android.
36 |
37 | License
38 | ---
39 | This project is licensed under GNU General Public License Version 3 or later.
40 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'groovyx.grooid.groovy-android'
3 |
4 | android {
5 | compileSdkVersion 23
6 | buildToolsVersion "21.1.2"
7 |
8 | defaultConfig {
9 | applicationId "net.typeblog.socks"
10 | minSdkVersion 21
11 | targetSdkVersion 22
12 | versionCode 10
13 | versionName "1.0.1"
14 | }
15 |
16 | sourceSets.main {
17 | jni.srcDirs = []
18 | jniLibs.srcDir 'libs'
19 | }
20 |
21 | buildTypes {
22 | release {
23 |
24 | }
25 | }
26 | }
27 |
28 | dependencies {
29 | compile fileTree(dir: 'libs', include: ['*.jar'])
30 | compile 'org.codehaus.groovy:groovy:2.4.3:grooid'
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/aidl/net/typeblog/socks/IVpnService.aidl:
--------------------------------------------------------------------------------
1 | package net.typeblog.socks;
2 |
3 | interface IVpnService
4 | {
5 | boolean isRunning();
6 | void stop();
7 | }
8 |
--------------------------------------------------------------------------------
/app/src/main/build-jni.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm -rf assets
4 | rm -rf ../../libs
5 |
6 | ndk-build
7 |
8 | for p in armeabi-v7a arm64-v8a x86 mips; do
9 | mkdir -p assets/$p
10 | cp libs/$p/{tun2socks,pdnsd} assets/$p/
11 | done
12 |
13 | rm -rf libs/*/{tun2socks,pdnsd}
14 | mv libs ../../
15 |
--------------------------------------------------------------------------------
/app/src/main/groovy/net/typeblog/socks/BootReceiver.groovy:
--------------------------------------------------------------------------------
1 | package net.typeblog.socks
2 |
3 | import android.content.BroadcastReceiver
4 | import android.content.Context
5 | import android.content.Intent
6 | import android.net.VpnService
7 | import android.util.Log
8 |
9 | import net.typeblog.socks.util.Profile
10 | import net.typeblog.socks.util.ProfileManager
11 | import net.typeblog.socks.util.Utility
12 | import static net.typeblog.socks.BuildConfig.DEBUG
13 |
14 | public class BootReceiver extends BroadcastReceiver {
15 | private static final String TAG = 'BootReceiver'
16 |
17 | @Override void onReceive(Context context, Intent intent) {
18 | def p = ProfileManager.getInstance(context).getDefault()
19 |
20 | if (p.autoConnect && !VpnService.prepare(context)) {
21 |
22 | if (DEBUG) {
23 | Log.d(TAG, "starting VPN service on boot")
24 | }
25 |
26 | Utility.startVpn(context, p)
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/groovy/net/typeblog/socks/MainActivity.groovy:
--------------------------------------------------------------------------------
1 | package net.typeblog.socks
2 |
3 | import android.app.Activity
4 | import android.content.Intent
5 | import android.net.VpnService
6 | import android.os.Bundle
7 |
8 | import net.typeblog.socks.util.Utility
9 | import static net.typeblog.socks.util.Constants.*
10 |
11 | public class MainActivity extends Activity {
12 | @Override void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | contentView = R.layout.main
15 |
16 | Utility.extractFile(this)
17 |
18 | fragmentManager.beginTransaction().replace(R.id.frame, new ProfileFragment()).commit()
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/groovy/net/typeblog/socks/util/Constants.groovy:
--------------------------------------------------------------------------------
1 | package net.typeblog.socks.util
2 |
3 | public class Constants
4 | {
5 | public static final String DIR = "/data/data/net.typeblog.socks/files"
6 |
7 | public static final String ABI_DEFAULT = "armeabi-v7a"
8 |
9 | public static final String ROUTE_ALL = "all",
10 | ROUTE_CHN = "chn"
11 |
12 | public static final String INTENT_PREFIX = "SOCKS",
13 | INTENT_NAME = INTENT_PREFIX + "NAME",
14 | INTENT_SERVER = INTENT_PREFIX + "SERV",
15 | INTENT_PORT = INTENT_PREFIX + "PORT",
16 | INTENT_USERNAME = INTENT_PREFIX + "UNAME",
17 | INTENT_PASSWORD = INTENT_PREFIX + "PASSWD",
18 | INTENT_ROUTE = INTENT_PREFIX + "ROUTE",
19 | INTENT_DNS = INTENT_PREFIX + "DNS",
20 | INTENT_DNS_PORT = INTENT_PREFIX + "DNSPORT",
21 | INTENT_PER_APP = INTENT_PREFIX + "PERAPP",
22 | INTENT_APP_BYPASS = INTENT_PREFIX + "APPBYPASS",
23 | INTENT_APP_LIST = INTENT_PREFIX + "APPLIST",
24 | INTENT_IPV6_PROXY = INTENT_PREFIX + "IPV6",
25 | INTENT_UDP_GW = INTENT_PREFIX + "UDPGW"
26 |
27 | public static final String PREF = "profile",
28 | PREF_PROFILE = "profile",
29 | PREF_LAST_PROFILE = "last_profile",
30 | PREF_SERVER_IP = "server_ip",
31 | PREF_SERVER_PORT = "server_port",
32 | PREF_IPV6_PROXY = "ipv6_proxy",
33 | PREF_UDP_PROXY = "udp_proxy",
34 | PREF_UDP_GW = "udp_gw",
35 | PREF_AUTH_USERPW = "auth_userpw",
36 | PREF_AUTH_USERNAME = "auth_username",
37 | PREF_AUTH_PASSWORD = "auth_password",
38 | PREF_ADV_ROUTE = "adv_route",
39 | PREF_ADV_DNS = "adv_dns",
40 | PREF_ADV_DNS_PORT = "adv_dns_port",
41 | PREF_ADV_PER_APP = "adv_per_app",
42 | PREF_ADV_APP_BYPASS = "adv_app_bypass",
43 | PREF_ADV_APP_LIST = "adv_app_list",
44 | PREF_ADV_AUTO_CONNECT = "adv_auto_connect"
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/groovy/net/typeblog/socks/util/ProfileFactory.groovy:
--------------------------------------------------------------------------------
1 | package net.typeblog.socks.util
2 |
3 | import android.content.Context
4 | import android.content.SharedPreferences
5 |
6 | import java.lang.ref.WeakReference
7 |
8 | class ProfileFactory {
9 | private static ProfileFactory sInstance
10 |
11 | public static final ProfileFactory getInstance(Context context, SharedPreferences pref) {
12 | if (sInstance == null) {
13 | sInstance = new ProfileFactory(context, pref)
14 | }
15 |
16 | sInstance
17 | }
18 |
19 | private Context mContext
20 | private SharedPreferences mPref
21 | private Map> mMap = [:]
22 |
23 | private ProfileFactory(Context context, SharedPreferences pref) {
24 | mContext = context
25 | mPref = pref
26 | }
27 |
28 | public Profile getProfile(String name) {
29 | WeakReference p = mMap[name]
30 |
31 | if (!p || !p.get()) {
32 | p = new WeakReference(new Profile(mContext, mPref, name))
33 | mMap[name] = p
34 | }
35 |
36 | p.get()
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/groovy/net/typeblog/socks/util/Routes.groovy:
--------------------------------------------------------------------------------
1 | package net.typeblog.socks.util
2 |
3 | import android.content.Context
4 | import android.net.VpnService
5 |
6 | import net.typeblog.socks.R
7 | import static net.typeblog.socks.util.Constants.*
8 |
9 | class Routes {
10 | static void addRoutes(Context context, VpnService.Builder builder, String name) {
11 | String[] routes = null;
12 | switch (name) {
13 | case ROUTE_ALL:
14 | routes = ["0.0.0.0/0"]
15 | break
16 | case ROUTE_CHN:
17 | routes = context.resources.getStringArray(R.array.simple_route)
18 | break
19 | default:
20 | routes = ["0.0.0.0/0"]
21 | break
22 | }
23 |
24 | routes.each {
25 | String[] cidr = it.split("/");
26 |
27 | // Cannot handle 127.0.0.0/8
28 | if (cidr.length == 2 && !cidr[0].startsWith("127")) {
29 | builder.addRoute(cidr[0], cidr[1].toInteger());
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/net/typeblog/socks/System.java:
--------------------------------------------------------------------------------
1 | package net.typeblog.socks;
2 |
3 | public class System
4 | {
5 | static {
6 | java.lang.System.loadLibrary("system");
7 | }
8 |
9 | public static native void exec(String cmd);
10 | public static native String getABI();
11 | public static native int sendfd(int fd);
12 | public static native void jniclose(int fd);
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_ABI := armeabi-v7a arm64-v8a mips x86
2 | APP_PLATFORM := android-21
3 | APP_STL := stlport_static
4 | NDK_TOOLCHAIN_VERSION := 4.9
5 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/arpprobe/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_library(arpprobe BArpProbe.c)
2 | target_link_libraries(arpprobe base system flow)
3 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/flooder/flooder.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file flooder.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 | // name of the program
31 | #define PROGRAM_NAME "flooder"
32 |
33 | // server output buffer size
34 | #define SERVER_BUFFER_MIN_PACKETS 200
35 |
36 | // maximum number of peers to flood
37 | #define MAX_FLOODS 64
38 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/flowextra/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_library(flowextra
2 | PacketPassInactivityMonitor.c
3 | KeepaliveIO.c
4 | )
5 | target_link_libraries(flowextra flow system)
6 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/lwip/CHANGELOG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PeterCxy/SocksDroid/d572359ac55757e7956ff4806fea3fda70e8887f/app/src/main/jni/badvpn/lwip/CHANGELOG
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/lwip/lwip-base-version:
--------------------------------------------------------------------------------
1 | 666e84eef281d0059377d0f5029c1c550488f829
2 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/lwip/src/core/ipv6/README:
--------------------------------------------------------------------------------
1 | IPv6 support in lwIP is very experimental.
2 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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.
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/lwip/test/unit/core/test_pbuf.c:
--------------------------------------------------------------------------------
1 | #include "test_pbuf.h"
2 |
3 | #include "lwip/pbuf.h"
4 | #include "lwip/stats.h"
5 |
6 | #if !LWIP_STATS || !MEM_STATS ||!MEMP_STATS
7 | #error "This tests needs MEM- and MEMP-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 | pbuf_setup(void)
17 | {
18 | }
19 |
20 | static void
21 | pbuf_teardown(void)
22 | {
23 | }
24 |
25 |
26 | /* Test functions */
27 |
28 | /** Call pbuf_copy on a pbuf with zero length */
29 | START_TEST(test_pbuf_copy_zero_pbuf)
30 | {
31 | struct pbuf *p1, *p2, *p3;
32 | err_t err;
33 | LWIP_UNUSED_ARG(_i);
34 |
35 | fail_unless(lwip_stats.mem.used == 0);
36 | fail_unless(lwip_stats.memp[MEMP_PBUF_POOL].used == 0);
37 |
38 | p1 = pbuf_alloc(PBUF_RAW, 1024, PBUF_RAM);
39 | fail_unless(p1 != NULL);
40 | fail_unless(p1->ref == 1);
41 |
42 | p2 = pbuf_alloc(PBUF_RAW, 2, PBUF_POOL);
43 | fail_unless(p2 != NULL);
44 | fail_unless(p2->ref == 1);
45 | p2->len = p2->tot_len = 0;
46 |
47 | pbuf_cat(p1, p2);
48 | fail_unless(p1->ref == 1);
49 | fail_unless(p2->ref == 1);
50 |
51 | p3 = pbuf_alloc(PBUF_RAW, p1->tot_len, PBUF_POOL);
52 | err = pbuf_copy(p3, p1);
53 | fail_unless(err == ERR_VAL);
54 |
55 | pbuf_free(p1);
56 | pbuf_free(p3);
57 | fail_unless(lwip_stats.mem.used == 0);
58 |
59 | fail_unless(lwip_stats.mem.used == 0);
60 | fail_unless(lwip_stats.memp[MEMP_PBUF_POOL].used == 0);
61 | }
62 | END_TEST
63 |
64 |
65 | /** Create the suite including all tests for this module */
66 | Suite *
67 | pbuf_suite(void)
68 | {
69 | TFun tests[] = {
70 | test_pbuf_copy_zero_pbuf
71 | };
72 | return create_suite("PBUF", tests, sizeof(tests)/sizeof(TFun), pbuf_setup, pbuf_teardown);
73 | }
74 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/misc/array_length.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file array_length.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_ARRAY_LENGTH
31 | #define BADVPN_ARRAY_LENGTH
32 |
33 | #define B_ARRAY_LENGTH(arr) (sizeof((arr)) / sizeof((arr)[0]))
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/ncd/NCDSugar.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file NCDSugar.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_NCDSUGAR_H
31 | #define BADVPN_NCDSUGAR_H
32 |
33 | #include
34 | #include
35 |
36 | int NCDSugar_Desugar (NCDProgram *prog) WARN_UNUSED;
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/ncd/include_linux_input.c:
--------------------------------------------------------------------------------
1 | #include
2 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/ncd/tests/include_included.ncdi:
--------------------------------------------------------------------------------
1 | include_guard "include_included"
2 |
3 | template incl_tmpl {
4 | var("good") x;
5 | }
6 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/ncd/tests/include_included2.ncdi:
--------------------------------------------------------------------------------
1 | include_guard "include_included2"
2 |
3 | template incl_tmpl2 {
4 | var("good2") x;
5 | }
6 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/random/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_library(badvpn_random
2 | BRandom2.c
3 | )
4 | target_link_libraries(badvpn_random base)
5 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/socksclient/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_library(socksclient
2 | BSocksClient.c
3 | )
4 | target_link_libraries(socksclient system flow flowextra)
5 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/stringmap/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_library(stringmap
2 | BStringMap.c
3 | )
4 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/structure/CHash.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file CHash.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_CHASH_H
31 | #define BADVPN_CHASH_H
32 |
33 | #include
34 |
35 | #include
36 | #include
37 | #include
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/structure/SLinkedList.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file SLinkedList.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_SLINKEDLIST_H
31 | #define BADVPN_SLINKEDLIST_H
32 |
33 | #include
34 |
35 | #include
36 | #include
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/system/BNetwork.h:
--------------------------------------------------------------------------------
1 | /**
2 | * @file BNetwork.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_SYSTEM_BNETWORK_H
31 | #define BADVPN_SYSTEM_BNETWORK_H
32 |
33 | int BNetwork_GlobalInit (void);
34 | void BNetwork_Assert (void);
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/system/BTime.c:
--------------------------------------------------------------------------------
1 | /**
2 | * @file BTime.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 | #ifndef BADVPN_PLUGIN
33 | struct _BTime_global btime_global = {
34 | #ifndef NDEBUG
35 | 0
36 | #endif
37 | };
38 | #endif
39 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/badvpn/udpgw_client/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_library(udpgw_client UdpGwClient.c)
2 | target_link_libraries(udpgw_client system flow flowextra)
3 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/pdnsd/ChangeLog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PeterCxy/SocksDroid/d572359ac55757e7956ff4806fea3fda70e8887f/app/src/main/jni/pdnsd/ChangeLog
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/pdnsd/THANKS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PeterCxy/SocksDroid/d572359ac55757e7956ff4806fea3fda70e8887f/app/src/main/jni/pdnsd/THANKS
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/pdnsd/contrib/Makefile.am:
--------------------------------------------------------------------------------
1 |
2 | EXTRA_DIST = pdnsd_dhcp.pl dhcp2pdnsd change_pdnsd_server_ip.pl README
3 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/pdnsd/doc/html/index.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PeterCxy/SocksDroid/d572359ac55757e7956ff4806fea3fda70e8887f/app/src/main/jni/pdnsd/doc/html/index.html
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/pdnsd/src/pdnsd_assert.h:
--------------------------------------------------------------------------------
1 | /* This include file was added by Paul A. Rombouts.
2 | I had terrible difficulties with cyclic dependencies of the include files
3 | written by Thomas Moestl. The only way I knew how to break the cycle was to
4 | put some declarations in a seperate file.
5 |
6 | Copyright (C) 2000, 2001 Thomas Moestl
7 | Copyright (C) 2002 Paul A. Rombouts
8 |
9 | This file is part of the pdnsd package.
10 |
11 | pdnsd is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published by
13 | the Free Software Foundation; either version 3 of the License, or
14 | (at your option) any later version.
15 |
16 | pdnsd is distributed in the hope that it will be useful,
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 | GNU General Public License for more details.
20 |
21 | You should have received a copy of the GNU General Public License
22 | along with pdnsd; see the file COPYING. If not, see
23 | .
24 | */
25 |
26 | #ifndef PDNSD_ASSERT_H
27 | #define PDNSD_ASSERT_H
28 |
29 | /* Originally in helpers.h */
30 |
31 | /* format string checking for printf-like functions */
32 | #ifdef __GNUC__
33 | #define printfunc(fmt, firstva) __attribute__((__format__(__printf__, fmt, firstva)))
34 | #else
35 | #define printfunc(fmt, firstva)
36 | #endif
37 |
38 | void pdnsd_exit(void);
39 |
40 |
41 | /*
42 | * Assert macro, used in some places. For now, it should be always defined, not
43 | * only in the DEBUG case, to be on the safe side security-wise.
44 | */
45 | #define PDNSD_ASSERT(cond, msg) \
46 | { if (!(cond)) { \
47 | log_error("%s:%d: %s", __FILE__, __LINE__, msg); \
48 | pdnsd_exit(); \
49 | } }
50 |
51 | #endif
52 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/pdnsd/src/rc/Makefile.am:
--------------------------------------------------------------------------------
1 |
2 | SUBDIRS = RedHat SuSE Debian Slackware ArchLinux
3 |
4 | EXTRA_DIST = README
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/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 |
--------------------------------------------------------------------------------
/app/src/main/jni/pdnsd/version:
--------------------------------------------------------------------------------
1 | 1.2.9b-par
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PeterCxy/SocksDroid/d572359ac55757e7956ff4806fea3fda70e8887f/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/layout/action_switch.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @string/adv_route_all
5 | - @string/adv_route_non_chn
6 |
7 |
8 |
9 | - all
10 | - chn
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/values/pdnsd.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | global {
5 | perm_cache=1024;
6 | cache_dir="/data/data/net.typeblog.socks/files";
7 | server_port = 8091;
8 | server_ip = 0.0.0.0;
9 | query_method=tcp_only;
10 | min_ttl=15m;
11 | max_ttl=1w;
12 | timeout=10;
13 | daemon=on;
14 | pid_file="/data/data/net.typeblog.socks/files/pdnsd.pid";
15 | }
16 |
17 | server {
18 | label= "upstream";
19 | ip = %s;
20 | port = %d;
21 | uptest = none;
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 | }
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/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 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:1.0.0'
10 | classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6'
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | jcenter()
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------