├── .gitignore ├── CMakeLists.txt ├── Doxyfile ├── Makefile ├── README.md ├── contrib └── epee │ ├── LICENSE.txt │ ├── README.md │ ├── demo │ ├── .gitignore │ ├── CMakeLists.txt │ ├── README.txt │ ├── demo_http_server │ │ ├── demo_http_server.cpp │ │ ├── demo_http_server.h │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h │ ├── demo_levin_server │ │ ├── demo_levin_server.cpp │ │ ├── demo_levin_server.h │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h │ ├── generate_gcc.sh │ ├── generate_vc_proj.bat │ └── iface │ │ └── transport_defs.h │ ├── include │ ├── ado_db_helper.h │ ├── console_handler.h │ ├── copyable_atomic.h │ ├── file_io_utils.h │ ├── global_stream_operators.h │ ├── gzip_encoding.h │ ├── hmac-md5.h │ ├── include_base_utils.h │ ├── math_helper.h │ ├── md5_l.h │ ├── md5_l.inl │ ├── md5global.h │ ├── misc_language.h │ ├── misc_log_ex.h │ ├── misc_os_dependent.h │ ├── net │ │ ├── abstract_tcp_server.h │ │ ├── abstract_tcp_server2.h │ │ ├── abstract_tcp_server2.inl │ │ ├── abstract_tcp_server_cp.h │ │ ├── abstract_tcp_server_cp.inl │ │ ├── http_base.h │ │ ├── http_client.h │ │ ├── http_client_abstract_invoke.h │ │ ├── http_client_base.h │ │ ├── http_client_via_api_helper.h │ │ ├── http_protocol_handler.h │ │ ├── http_protocol_handler.inl │ │ ├── http_server_cp.h │ │ ├── http_server_cp2.h │ │ ├── http_server_handlers_map2.h │ │ ├── http_server_impl_base.h │ │ ├── http_server_thread_per_connect.h │ │ ├── jsonrpc_protocol_handler.h │ │ ├── jsonrpc_server_handlers_map.h │ │ ├── jsonrpc_server_impl_base.h │ │ ├── jsonrpc_structs.h │ │ ├── levin_base.h │ │ ├── levin_client.h │ │ ├── levin_client.inl │ │ ├── levin_client_async.h │ │ ├── levin_client_async.inl │ │ ├── levin_helper.h │ │ ├── levin_protocol_handler.h │ │ ├── levin_protocol_handler_async.h │ │ ├── levin_server_cp.h │ │ ├── levin_server_cp2.h │ │ ├── local_ip.h │ │ ├── multiprotocols_server.h │ │ ├── munin_connection_handler.h │ │ ├── munin_node_server.h │ │ ├── net_helper.h │ │ ├── net_parse_helpers.h │ │ ├── net_utils_base.h │ │ ├── protocol_switcher.h │ │ ├── rpc_method_name.h │ │ ├── smtp.h │ │ ├── smtp.inl │ │ └── smtp_helper.h │ ├── pragma_comp_defs.h │ ├── profile_tools.h │ ├── reg_exp_definer.h │ ├── reg_utils.h │ ├── serialization │ │ ├── enableable.h │ │ ├── keyvalue_serialization.h │ │ ├── keyvalue_serialization_overloads.h │ │ └── serialize_base.h │ ├── service_impl_base.h │ ├── sha1.h │ ├── sha1.inl │ ├── soci_helper.h │ ├── static_initializer.h │ ├── storages │ │ ├── activity_notifier.h │ │ ├── crypted_storage.h │ │ ├── gzipped_inmemstorage.h │ │ ├── http_abstract_invoke.h │ │ ├── levin_abstract_invoke2.h │ │ ├── parserse_base_utils.h │ │ ├── portable_storage.h │ │ ├── portable_storage_base.h │ │ ├── portable_storage_from_bin.h │ │ ├── portable_storage_from_json.h │ │ ├── portable_storage_template_helper.h │ │ ├── portable_storage_to_bin.h │ │ ├── portable_storage_to_json.h │ │ └── portable_storage_val_converters.h │ ├── string_coding.h │ ├── string_tools.h │ ├── syncobj.h │ ├── time_helper.h │ ├── tiny_ini.h │ ├── to_nonconst_iterator.h │ ├── warnings.h │ ├── winobj.h │ └── zlib_helper.h │ └── tests │ ├── .gitignore │ ├── data │ └── storages │ │ ├── invalid_storage_1.bin │ │ ├── invalid_storage_2.bin │ │ ├── invalid_storage_3.bin │ │ ├── invalid_storage_4.bin │ │ └── valid_storage.bin │ ├── generate_vc_proj.bat │ └── src │ ├── CMakeLists.txt │ ├── misc │ └── test_math.h │ ├── net │ └── test_net.h │ ├── storages │ ├── portable_storages_test.h │ └── storage_tests.h │ └── tests.cpp ├── external ├── CMakeLists.txt └── miniupnpc │ ├── CMakeLists.txt │ ├── Changelog.txt │ ├── LICENSE │ ├── MANIFEST.in │ ├── Makefile │ ├── Makefile.mingw │ ├── README │ ├── VERSION │ ├── apiversions.txt │ ├── codelength.h │ ├── connecthostport.c │ ├── connecthostport.h │ ├── external-ip.sh │ ├── igd_desc_parse.c │ ├── igd_desc_parse.h │ ├── java │ ├── JavaBridgeTest.java │ ├── testjava.bat │ └── testjava.sh │ ├── listdevices.c │ ├── man3 │ └── miniupnpc.3 │ ├── mingw32make.bat │ ├── minihttptestserver.c │ ├── minisoap.c │ ├── minisoap.h │ ├── minissdpc.c │ ├── minissdpc.h │ ├── miniupnpc.c │ ├── miniupnpc.def │ ├── miniupnpc.h │ ├── miniupnpc_declspec.h │ ├── miniupnpcmodule.c │ ├── miniupnpcstrings.h.cmake │ ├── miniupnpcstrings.h.in │ ├── miniupnpctypes.h │ ├── miniwget.c │ ├── miniwget.h │ ├── minixml.c │ ├── minixml.h │ ├── minixmlvalid.c │ ├── msvc │ ├── miniupnpc.sln │ ├── miniupnpc.vcproj │ └── upnpc-static.vcproj │ ├── portlistingparse.c │ ├── portlistingparse.h │ ├── pymoduletest.py │ ├── pymoduletest3.py │ ├── receivedata.c │ ├── receivedata.h │ ├── setup.py │ ├── setupmingw32.py │ ├── testdesc │ ├── linksys_WAG200G_desc.values │ ├── linksys_WAG200G_desc.xml │ ├── new_LiveBox_desc.values │ └── new_LiveBox_desc.xml │ ├── testigddescparse.c │ ├── testminiwget.c │ ├── testminiwget.sh │ ├── testminixml.c │ ├── testportlistingparse.c │ ├── testreplyparse │ ├── DeletePortMapping.namevalue │ ├── DeletePortMapping.xml │ ├── GetExternalIPAddress.namevalue │ ├── GetExternalIPAddress.xml │ ├── GetSpecificPortMappingEntryReq.namevalue │ ├── GetSpecificPortMappingEntryReq.xml │ ├── GetSpecificPortMappingEntryResp.namevalue │ ├── GetSpecificPortMappingEntryResp.xml │ ├── SetDefaultConnectionService.namevalue │ ├── SetDefaultConnectionService.xml │ └── readme.txt │ ├── testupnpigd.py │ ├── testupnpreplyparse.c │ ├── testupnpreplyparse.sh │ ├── updateminiupnpcstrings.sh │ ├── upnpc.c │ ├── upnpcommands.c │ ├── upnpcommands.h │ ├── upnpdev.c │ ├── upnpdev.h │ ├── upnperrors.c │ ├── upnperrors.h │ ├── upnpreplyparse.c │ ├── upnpreplyparse.h │ └── wingenminiupnpcstrings.c ├── include ├── INode.h └── IWallet.h ├── src ├── CMakeLists.txt ├── common │ ├── base58.cpp │ ├── base58.h │ ├── boost_serialization_helper.h │ ├── command_line.cpp │ ├── command_line.h │ ├── int-util.h │ ├── pod-class.h │ ├── unordered_containers_boost_serialization.h │ ├── util.cpp │ ├── util.h │ └── varint.h ├── connectivity_tool │ └── conn_tool.cpp ├── crypto │ ├── aesb.c │ ├── aesb.h │ ├── blake256.c │ ├── blake256.h │ ├── chacha8.c │ ├── chacha8.h │ ├── crypto-ops-data.c │ ├── crypto-ops.c │ ├── crypto-ops.h │ ├── crypto.cpp │ ├── crypto.h │ ├── electrum-words.cpp │ ├── electrum-words.h │ ├── generic-ops.h │ ├── groestl.c │ ├── groestl.h │ ├── groestl_tables.h │ ├── hash-extra-blake.c │ ├── hash-extra-groestl.c │ ├── hash-extra-jh.c │ ├── hash-extra-skein.c │ ├── hash-ops.h │ ├── hash.c │ ├── hash.h │ ├── initializer.h │ ├── jh.c │ ├── jh.h │ ├── keccak.c │ ├── keccak.h │ ├── oaes_config.h │ ├── oaes_lib.c │ ├── oaes_lib.h │ ├── random.c │ ├── random.h │ ├── skein.c │ ├── skein.h │ ├── skein_port.h │ ├── slow-hash.c │ └── tree-hash.c ├── cryptonote_config.h ├── cryptonote_core │ ├── account.cpp │ ├── account.h │ ├── account_boost_serialization.h │ ├── blockchain_storage.cpp │ ├── blockchain_storage.h │ ├── blockchain_storage_boost_serialization.h │ ├── checkpoints.cpp │ ├── checkpoints.h │ ├── checkpoints_create.h │ ├── connection_context.h │ ├── cryptonote_basic.h │ ├── cryptonote_basic_impl.cpp │ ├── cryptonote_basic_impl.h │ ├── cryptonote_boost_serialization.h │ ├── cryptonote_core.cpp │ ├── cryptonote_core.h │ ├── cryptonote_format_utils.cpp │ ├── cryptonote_format_utils.h │ ├── cryptonote_stat_info.h │ ├── difficulty.cpp │ ├── difficulty.h │ ├── miner.cpp │ ├── miner.h │ ├── tx_extra.h │ ├── tx_pool.cpp │ ├── tx_pool.h │ └── verification_context.h ├── cryptonote_protocol │ ├── blobdatatype.h │ ├── cryptonote_protocol_defs.h │ ├── cryptonote_protocol_handler.h │ ├── cryptonote_protocol_handler.inl │ └── cryptonote_protocol_handler_common.h ├── daemon │ ├── daemon.cpp │ └── daemon_commands_handler.h ├── miner │ ├── simpleminer.cpp │ ├── simpleminer.h │ ├── simpleminer_protocol_defs.h │ └── target_helper.h ├── p2p │ ├── net_node.h │ ├── net_node.inl │ ├── net_node_common.h │ ├── net_peerlist.h │ ├── net_peerlist_boost_serialization.h │ ├── p2p_networks.h │ ├── p2p_protocol_defs.h │ └── stdafx.h ├── platform │ ├── mingw │ │ └── alloca.h │ └── msc │ │ ├── alloca.h │ │ ├── inline_c.h │ │ ├── stdbool.h │ │ └── sys │ │ └── param.h ├── ringct │ ├── CMakeLists.txt │ ├── rctCryptoOps.c │ ├── rctCryptoOps.h │ ├── rctOps.cpp │ ├── rctOps.h │ ├── rctSigs.cpp │ ├── rctSigs.h │ ├── rctTypes.cpp │ └── rctTypes.h ├── rpc │ ├── core_rpc_server.cpp │ ├── core_rpc_server.h │ ├── core_rpc_server_commands_defs.h │ └── core_rpc_server_error_codes.h ├── serialization │ ├── binary_archive.h │ ├── binary_utils.h │ ├── crypto.h │ ├── debug_archive.h │ ├── json_archive.h │ ├── json_utils.h │ ├── serialization.h │ ├── string.h │ ├── variant.h │ └── vector.h ├── simplewallet │ ├── password_container.cpp │ ├── password_container.h │ ├── simplewallet.cpp │ └── simplewallet.h ├── version.cmake ├── version.h.in └── wallet │ ├── wallet2.cpp │ ├── wallet2.h │ ├── wallet_errors.h │ ├── wallet_rpc_server.cpp │ ├── wallet_rpc_server.h │ ├── wallet_rpc_server_commands_defs.h │ └── wallet_rpc_server_error_codes.h ├── tests ├── CMakeLists.txt ├── core_proxy │ ├── core_proxy.cpp │ └── core_proxy.h ├── core_tests │ ├── block_reward.cpp │ ├── block_reward.h │ ├── block_validation.cpp │ ├── block_validation.h │ ├── chain_split_1.cpp │ ├── chain_split_1.h │ ├── chain_switch_1.cpp │ ├── chain_switch_1.h │ ├── chaingen.cpp │ ├── chaingen.h │ ├── chaingen001.cpp │ ├── chaingen_main.cpp │ ├── chaingen_tests_list.h │ ├── double_spend.cpp │ ├── double_spend.h │ ├── double_spend.inl │ ├── integer_overflow.cpp │ ├── integer_overflow.h │ ├── ring_signature_1.cpp │ ├── ring_signature_1.h │ ├── transaction_tests.cpp │ ├── transaction_tests.h │ ├── tx_validation.cpp │ └── tx_validation.h ├── crypto │ ├── crypto-ops-data.c │ ├── crypto-ops.c │ ├── crypto-tests.h │ ├── crypto.cpp │ ├── hash.c │ ├── main.cpp │ ├── random.c │ └── tests.txt ├── cryptolib.pl ├── cryptotest.pl ├── daemon_tests │ ├── CMakeLists.txt │ └── transfers.cpp ├── data │ ├── account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb │ ├── account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f │ ├── account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486 │ └── account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe ├── difficulty │ ├── data.txt │ ├── difficulty.cpp │ └── generate-data ├── functional_tests │ ├── main.cpp │ ├── transactions_flow_test.cpp │ ├── transactions_flow_test.h │ ├── transactions_generation_from_blockchain.cpp │ └── transactions_generation_from_blockchain.h ├── gtest │ ├── CMakeLists.txt │ ├── cmake │ │ └── internal_utils.cmake │ ├── include │ │ └── gtest │ │ │ ├── gtest-death-test.h │ │ │ ├── gtest-message.h │ │ │ ├── gtest-param-test.h │ │ │ ├── gtest-param-test.h.pump │ │ │ ├── gtest-printers.h │ │ │ ├── gtest-spi.h │ │ │ ├── gtest-test-part.h │ │ │ ├── gtest-typed-test.h │ │ │ ├── gtest.h │ │ │ ├── gtest_pred_impl.h │ │ │ ├── gtest_prod.h │ │ │ └── internal │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-linked_ptr.h │ │ │ ├── gtest-param-util-generated.h │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ ├── gtest-tuple.h │ │ │ ├── gtest-tuple.h.pump │ │ │ ├── gtest-type-util.h │ │ │ └── gtest-type-util.h.pump │ └── src │ │ ├── gtest-all.cc │ │ ├── gtest-death-test.cc │ │ ├── gtest-filepath.cc │ │ ├── gtest-internal-inl.h │ │ ├── gtest-port.cc │ │ ├── gtest-printers.cc │ │ ├── gtest-test-part.cc │ │ ├── gtest-typed-test.cc │ │ ├── gtest.cc │ │ └── gtest_main.cc ├── hash-target.cpp ├── hash │ ├── main.cpp │ ├── tests-extra-blake.txt │ ├── tests-extra-groestl.txt │ ├── tests-extra-jh.txt │ ├── tests-extra-skein.txt │ ├── tests-fast.txt │ ├── tests-slow-2m.txt │ └── tests-tree.txt ├── io.h ├── net_load_tests │ ├── clt.cpp │ ├── net_load_tests.h │ └── srv.cpp ├── performance_tests │ ├── check_ring_signature.h │ ├── cn_slow_hash.h │ ├── construct_tx.h │ ├── derive_public_key.h │ ├── derive_secret_key.h │ ├── generate_key_derivation.h │ ├── generate_key_image.h │ ├── generate_key_image_helper.h │ ├── is_out_to_acc.h │ ├── main.cpp │ ├── multi_tx_test_base.h │ ├── performance_tests.h │ ├── performance_utils.h │ └── single_tx_test_base.h └── unit_tests │ ├── base58.cpp │ ├── block_reward.cpp │ ├── chacha8.cpp │ ├── checkpoints.cpp │ ├── decompose_amount_into_digits.cpp │ ├── epee_boosted_tcp_server.cpp │ ├── epee_levin_protocol_handler_async.cpp │ ├── get_xtype_from_string.cpp │ ├── main.cpp │ ├── mul_div.cpp │ ├── parse_amount.cpp │ ├── serialization.cpp │ ├── test_format_utils.cpp │ ├── test_peerlist.cpp │ ├── test_protocol_pack.cpp │ └── unit_tests_utils.h └── utils ├── .gitignore ├── munin_plugins ├── alt_blocks_count ├── difficulty ├── grey_peerlist_size ├── height ├── incoming_connections_count ├── outgoing_connections_count ├── tx_count ├── tx_pool_size └── white_peerlist_size └── test-static-assert.c /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /doc 3 | /build 4 | /tags 5 | 6 | # vim swap files 7 | *.swp 8 | *.swo 9 | TAGS 10 | !TAGS/ 11 | tags 12 | !tags/ 13 | gtags.files 14 | GTAGS 15 | GRTAGS 16 | GPATH 17 | cscope.files 18 | cscope.out 19 | cscope.in.out 20 | cscope.po.out 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: all-release 2 | 3 | cmake-debug: 4 | mkdir -p build/debug 5 | cd build/debug && cmake -D CMAKE_BUILD_TYPE=Debug ../.. 6 | 7 | build-debug: cmake-debug 8 | cd build/debug && $(MAKE) 9 | 10 | test-debug: build-debug 11 | cd build/debug && $(MAKE) test 12 | 13 | all-debug: build-debug 14 | 15 | cmake-release: 16 | mkdir -p build/release 17 | cd build/release && cmake -D CMAKE_BUILD_TYPE=Release ../.. 18 | 19 | build-release: cmake-release 20 | cd build/release && $(MAKE) 21 | 22 | test-release: build-release 23 | cd build/release && $(MAKE) test 24 | 25 | all-release: build-release 26 | 27 | clean: 28 | @echo "WARNING: Back-up your wallet if it exists within ./build!" ; \ 29 | read -r -p "This will destroy the build directory, continue (y/N)?: " CONTINUE; \ 30 | [ $$CONTINUE = "y" ] || [ $$CONTINUE = "Y" ] || (echo "Exiting."; exit 1;) 31 | rm -rf build 32 | 33 | tags: 34 | ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest 35 | 36 | .PHONY: all cmake-debug build-debug test-debug all-debug cmake-release build-release test-release all-release clean tags 37 | -------------------------------------------------------------------------------- /contrib/epee/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL Andrey N. Sabelnikov BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /contrib/epee/README.md: -------------------------------------------------------------------------------- 1 | epee - is a small library of helpers, wrappers, tools and and so on, used to make my life easier. -------------------------------------------------------------------------------- /contrib/epee/demo/.gitignore: -------------------------------------------------------------------------------- 1 | /build/* 2 | -------------------------------------------------------------------------------- /contrib/epee/demo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | set(Boost_USE_MULTITHREADED ON) 3 | #set(Boost_DEBUG 1) 4 | find_package(Boost COMPONENTS system filesystem thread date_time chrono regex ) 5 | 6 | include_directories( ${Boost_INCLUDE_DIRS} ) 7 | 8 | 9 | IF (MSVC) 10 | add_definitions( "/W3 /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /nologo /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /bigobj" ) 11 | ELSE() 12 | # set stuff for other systems 13 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-reorder -D_GNU_SOURCE") 14 | ENDIF() 15 | 16 | 17 | include_directories(.) 18 | include_directories(../include) 19 | include_directories(iface) 20 | 21 | 22 | # Add folders to filters 23 | file(GLOB_RECURSE LEVIN_GENERAL_SECTION RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 24 | ${CMAKE_CURRENT_SOURCE_DIR}/demo_levin_server/*.h 25 | ${CMAKE_CURRENT_SOURCE_DIR}/demo_levin_server/*.inl 26 | ${CMAKE_CURRENT_SOURCE_DIR}/demo_levin_server/*.cpp) 27 | 28 | file(GLOB_RECURSE HTTP_GENERAL_SECTION RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 29 | ${CMAKE_CURRENT_SOURCE_DIR}/demo_http_server/*.h 30 | ${CMAKE_CURRENT_SOURCE_DIR}/demo_http_server/*.inl 31 | ${CMAKE_CURRENT_SOURCE_DIR}/demo_http_server/*.cpp) 32 | 33 | 34 | 35 | source_group(general FILES ${LEVIN_GENERAL_SECTION} FILES ${HTTP_GENERAL_SECTION}) 36 | #source_group(general FILES ${HTTP_GENERAL_SECTION}) 37 | 38 | add_executable(demo_http_server ${HTTP_GENERAL_SECTION} ) 39 | add_executable(demo_levin_server ${LEVIN_GENERAL_SECTION} ) 40 | 41 | target_link_libraries( demo_http_server ${Boost_LIBRARIES} ) 42 | target_link_libraries( demo_levin_server ${Boost_LIBRARIES} ) 43 | 44 | IF (NOT WIN32) 45 | target_link_libraries (demo_http_server rt) 46 | target_link_libraries (demo_levin_server rt) 47 | ENDIF() 48 | 49 | 50 | -------------------------------------------------------------------------------- /contrib/epee/demo/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/contrib/epee/demo/README.txt -------------------------------------------------------------------------------- /contrib/epee/demo/demo_http_server/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // demo_http_server.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /contrib/epee/demo/demo_http_server/stdafx.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | #pragma once 29 | 30 | #include "targetver.h" 31 | 32 | 33 | #include 34 | 35 | 36 | #define BOOST_FILESYSTEM_VERSION 3 37 | #define ENABLE_RELEASE_LOGGING 38 | #include "misc_log_ex.h" 39 | 40 | 41 | -------------------------------------------------------------------------------- /contrib/epee/demo/demo_http_server/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // The following macros define the minimum required platform. The minimum required platform 4 | // is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run 5 | // your application. The macros work by enabling all features available on platform versions up to and 6 | // including the version specified. 7 | 8 | // Modify the following defines if you have to target a platform prior to the ones specified below. 9 | // Refer to MSDN for the latest info on corresponding values for different platforms. 10 | #ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. 11 | #define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. 12 | #endif 13 | 14 | -------------------------------------------------------------------------------- /contrib/epee/demo/demo_levin_server/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | 29 | #include "stdafx.h" 30 | 31 | -------------------------------------------------------------------------------- /contrib/epee/demo/demo_levin_server/stdafx.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | #pragma once 29 | 30 | #include "targetver.h" 31 | 32 | 33 | #include 34 | 35 | 36 | #define BOOST_FILESYSTEM_VERSION 3 37 | #define ENABLE_RELEASE_LOGGING 38 | #include "log_opt_defs.h" 39 | #include "misc_log_ex.h" 40 | 41 | 42 | -------------------------------------------------------------------------------- /contrib/epee/demo/demo_levin_server/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // The following macros define the minimum required platform. The minimum required platform 4 | // is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run 5 | // your application. The macros work by enabling all features available on platform versions up to and 6 | // including the version specified. 7 | 8 | // Modify the following defines if you have to target a platform prior to the ones specified below. 9 | // Refer to MSDN for the latest info on corresponding values for different platforms. 10 | #ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. 11 | #define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. 12 | #endif 13 | 14 | -------------------------------------------------------------------------------- /contrib/epee/demo/generate_gcc.sh: -------------------------------------------------------------------------------- 1 | mkdir build 2 | cd build 3 | cmake .. 4 | #cmake -DBOOST_ROOT=/usr/local/proj/boost_1_49_0 -DBOOST_LIBRARYDIR=/usr/local/proj/boost_1_49_0/stage/lib .. 5 | -------------------------------------------------------------------------------- /contrib/epee/demo/generate_vc_proj.bat: -------------------------------------------------------------------------------- 1 | mkdir build 2 | 3 | cd build 4 | 5 | cmake "-DBoost_USE_STATIC_LIBS=TRUE" -G "Visual Studio 11 Win64" .. 6 | cd .. 7 | pause -------------------------------------------------------------------------------- /contrib/epee/include/copyable_atomic.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | #pragma once 28 | 29 | #include 30 | 31 | namespace epee 32 | { 33 | class copyable_atomic: public std::atomic 34 | { 35 | public: 36 | copyable_atomic() 37 | {}; 38 | copyable_atomic(const copyable_atomic& a):std::atomic(a.load()) 39 | {} 40 | copyable_atomic& operator= (const copyable_atomic& a) 41 | { 42 | store(a.load()); 43 | return *this; 44 | } 45 | uint32_t operator++() 46 | { 47 | return std::atomic::operator++(); 48 | } 49 | uint32_t operator++(int fake) 50 | { 51 | return std::atomic::operator++(fake); 52 | } 53 | }; 54 | } -------------------------------------------------------------------------------- /contrib/epee/include/global_stream_operators.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | #pragma once 29 | 30 | std::stringstream& operator<<(std::stringstream& out, const std::wstring& ws) 31 | { 32 | std::string as = string_encoding::convert_to_ansii(ws); 33 | out << as; 34 | return out; 35 | } 36 | -------------------------------------------------------------------------------- /contrib/epee/include/include_base_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | #pragma once 28 | 29 | #define BOOST_FILESYSTEM_VERSION 3 30 | #define ENABLE_RELEASE_LOGGING 31 | 32 | #include "misc_log_ex.h" 33 | 34 | 35 | -------------------------------------------------------------------------------- /contrib/epee/include/net/http_server_cp.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | 29 | 30 | #ifndef _HTTP_SERVER_CP_H_ 31 | #define _HTTP_SERVER_CP_H_ 32 | 33 | #include "abstract_tcp_server_cp.h" 34 | #include "http_server.h" 35 | namespace epee 36 | { 37 | namespace net_utils 38 | { 39 | typedef cp_server_impl cp_http_server_file_system; 40 | typedef cp_server_impl cp_http_server_custum_handling; 41 | } 42 | } 43 | 44 | 45 | 46 | #endif 47 | 48 | 49 | -------------------------------------------------------------------------------- /contrib/epee/include/net/http_server_cp2.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | 29 | 30 | #ifndef _HTTP_SERVER_CP2_H_ 31 | #define _HTTP_SERVER_CP2_H_ 32 | 33 | #include "abstract_tcp_server2.h" 34 | #include "http_protocol_handler.h" 35 | namespace epee 36 | { 37 | namespace net_utils 38 | { 39 | typedef boosted_tcp_server > boosted_http_server_file_system; 40 | typedef boosted_tcp_server > boosted_http_server_custum_handling; 41 | } 42 | } 43 | 44 | 45 | #endif 46 | 47 | 48 | -------------------------------------------------------------------------------- /contrib/epee/include/net/http_server_thread_per_connect.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | 29 | #ifndef _HTTP_SERVER_CP_H_ 30 | #define _HTTP_SERVER_CP_H_ 31 | 32 | #include "abstract_tcp_server.h" 33 | #include "http_server.h" 34 | 35 | namespace epee 36 | { 37 | namespace net_utils 38 | { 39 | typedef abstract_tcp_server mt_http_server_file_system; 40 | typedef abstract_tcp_server mt_http_server_custum_handling; 41 | 42 | } 43 | } 44 | 45 | 46 | #endif 47 | 48 | 49 | -------------------------------------------------------------------------------- /contrib/epee/include/net/levin_client_async.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/contrib/epee/include/net/levin_client_async.inl -------------------------------------------------------------------------------- /contrib/epee/include/net/levin_server_cp.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | 29 | 30 | #ifndef _HTTP_SERVER_CP_H_ 31 | #define _HTTP_SERVER_CP_H_ 32 | 33 | #include "abstract_tcp_server_cp.h" 34 | #include "levin_protocol_handler.h" 35 | namespace epee 36 | { 37 | namespace net_utils 38 | { 39 | typedef cp_server_impl cp_levin_server; 40 | } 41 | } 42 | 43 | 44 | 45 | #endif 46 | 47 | 48 | -------------------------------------------------------------------------------- /contrib/epee/include/net/levin_server_cp2.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | 29 | #ifndef _HTTP_SERVER_CP_H_ 30 | #define _HTTP_SERVER_CP_H_ 31 | 32 | #include "abstract_tcp_server2.h" 33 | #include "levin_protocol_handler.h" 34 | #include "levin_protocol_handler_async.h" 35 | 36 | namespace epee 37 | { 38 | namespace net_utils 39 | { 40 | typedef boosted_tcp_server > boosted_levin_server; 41 | typedef boosted_tcp_server > boosted_levin_async_server; 42 | } 43 | } 44 | 45 | 46 | 47 | #endif 48 | 49 | 50 | -------------------------------------------------------------------------------- /contrib/epee/include/net/local_ip.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/contrib/epee/include/net/local_ip.h -------------------------------------------------------------------------------- /contrib/epee/include/net/multiprotocols_server.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | 29 | #ifndef _MULTIPROTOCOLS_SERVER_H_ 30 | #define _MULTIPROTOCOLS_SERVER_H_ 31 | 32 | //#include "abstract_tcp_server_cp.h" 33 | #include "protocol_switcher.h" 34 | #include "abstract_tcp_server2.h" 35 | 36 | namespace epee 37 | { 38 | namespace net_utils 39 | { 40 | //typedef cp_server_impl multiprotocol_server; 41 | typedef boosted_tcp_server boosted_multiprotocol_server; 42 | } 43 | } 44 | 45 | 46 | #endif //_MULTIPROTOCOLS_SERVER_H_ 47 | 48 | -------------------------------------------------------------------------------- /contrib/epee/include/net/munin_node_server.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | 29 | #ifndef _MUNIN_NODE_SERVER_H_ 30 | #define _MUNIN_NODE_SERVER_H_ 31 | 32 | #include 33 | //#include "net_utils_base.h" 34 | #include "munin_connection_handler.h" 35 | //#include "abstract_tcp_server.h" 36 | //#include "abstract_tcp_server_cp.h" 37 | #include "abstract_tcp_server2.h" 38 | namespace epee 39 | { 40 | namespace net_utils 41 | { 42 | namespace munin 43 | { 44 | typedef boosted_tcp_server munin_node_server; 45 | //typedef cp_server_impl munin_node_cp_server; 46 | } 47 | } 48 | } 49 | #endif//!_MUNIN_NODE_SERVER_H_ -------------------------------------------------------------------------------- /contrib/epee/include/net/rpc_method_name.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | 28 | #pragma once 29 | 30 | 31 | #define RPC_METHOD_NAME(name) static inline const char* methodname(){return name;} -------------------------------------------------------------------------------- /contrib/epee/include/pragma_comp_defs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__GNUC__) 4 | #define PRAGMA_WARNING_PUSH _Pragma("GCC diagnostic push") 5 | #define PRAGMA_WARNING_POP _Pragma("GCC diagnostic pop") 6 | #define PRAGMA_WARNING_DISABLE_VS(w) 7 | #define PRAGMA_GCC(w) _Pragma(w) 8 | #elif defined(_MSC_VER) 9 | #define PRAGMA_WARNING_PUSH __pragma(warning( push )) 10 | #define PRAGMA_WARNING_POP __pragma(warning( pop )) 11 | #define PRAGMA_WARNING_DISABLE_VS(w) __pragma( warning ( disable: w )) 12 | //#define PRAGMA_WARNING_DISABLE_GCC(w) 13 | #define PRAGMA_GCC(w) 14 | #endif 15 | -------------------------------------------------------------------------------- /contrib/epee/include/serialization/enableable.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 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 Andrey N. Sabelnikov 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 COPYRIGHT OWNER 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 | // 26 | 27 | #pragma once 28 | 29 | namespace epee 30 | { 31 | 32 | template 33 | struct enableable 34 | { 35 | t_obj v; 36 | bool enabled; 37 | 38 | enableable() 39 | : v(t_obj()), enabled(true) 40 | { // construct from defaults 41 | } 42 | 43 | enableable(const t_obj& _v) 44 | : v(_v), enabled(true) 45 | { // construct from specified values 46 | } 47 | 48 | enableable(const enableable& _v) 49 | : v(_v.v), enabled(_v.enabled) 50 | { // construct from specified values 51 | } 52 | }; 53 | } -------------------------------------------------------------------------------- /contrib/epee/include/serialization/serialize_base.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | -------------------------------------------------------------------------------- /contrib/epee/include/warnings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(_MSC_VER) 4 | 5 | #define PUSH_WARNINGS __pragma(warning(push)) 6 | #define POP_WARNINGS __pragma(warning(pop)) 7 | #define DISABLE_VS_WARNINGS(w) __pragma(warning(disable: w)) 8 | #define DISABLE_GCC_WARNING(w) 9 | #define DISABLE_CLANG_WARNING(w) 10 | #define DISABLE_GCC_AND_CLANG_WARNING(w) 11 | 12 | #else 13 | 14 | #include 15 | 16 | #define PUSH_WARNINGS _Pragma("GCC diagnostic push") 17 | #define POP_WARNINGS _Pragma("GCC diagnostic pop") 18 | #define DISABLE_VS_WARNINGS(w) 19 | 20 | #if defined(__clang__) 21 | #define DISABLE_GCC_WARNING(w) 22 | #define DISABLE_CLANG_WARNING DISABLE_GCC_AND_CLANG_WARNING 23 | #else 24 | #define DISABLE_GCC_WARNING DISABLE_GCC_AND_CLANG_WARNING 25 | #define DISABLE_CLANG_WARNING(w) 26 | #endif 27 | 28 | #define DISABLE_GCC_AND_CLANG_WARNING(w) _Pragma(BOOST_PP_STRINGIZE(GCC diagnostic ignored BOOST_PP_STRINGIZE(-W##w))) 29 | 30 | #endif -------------------------------------------------------------------------------- /contrib/epee/tests/.gitignore: -------------------------------------------------------------------------------- 1 | /build/* 2 | -------------------------------------------------------------------------------- /contrib/epee/tests/data/storages/invalid_storage_1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/contrib/epee/tests/data/storages/invalid_storage_1.bin -------------------------------------------------------------------------------- /contrib/epee/tests/data/storages/invalid_storage_2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/contrib/epee/tests/data/storages/invalid_storage_2.bin -------------------------------------------------------------------------------- /contrib/epee/tests/data/storages/invalid_storage_3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/contrib/epee/tests/data/storages/invalid_storage_3.bin -------------------------------------------------------------------------------- /contrib/epee/tests/data/storages/invalid_storage_4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/contrib/epee/tests/data/storages/invalid_storage_4.bin -------------------------------------------------------------------------------- /contrib/epee/tests/data/storages/valid_storage.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/contrib/epee/tests/data/storages/valid_storage.bin -------------------------------------------------------------------------------- /contrib/epee/tests/generate_vc_proj.bat: -------------------------------------------------------------------------------- 1 | mkdir build 2 | cd build 3 | cmake "-DBoost_USE_STATIC_LIBS=TRUE" -G "Visual Studio 11 Win64" ../src 4 | cd .. 5 | pause -------------------------------------------------------------------------------- /contrib/epee/tests/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | cmake_minimum_required(VERSION 2.8) 3 | 4 | set(Boost_USE_MULTITHREADED ON) 5 | 6 | include_directories(.) 7 | include_directories(../../include) 8 | 9 | find_package(Boost COMPONENTS system filesystem thread date_time chrono regex) 10 | include_directories( ${Boost_INCLUDE_DIRS} ) 11 | 12 | IF (MSVC) 13 | add_definitions( "/W3 /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /nologo /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /bigobj" ) 14 | include_directories(SYSTEM platform/msvc) 15 | ELSE() 16 | # set stuff for other systems 17 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall -Werror") 18 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Werror -Wno-reorder") 19 | ENDIF() 20 | 21 | 22 | # Add folders to filters 23 | file(GLOB_RECURSE SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 24 | ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp 25 | ${CMAKE_CURRENT_SOURCE_DIR}/*.inl 26 | ${CMAKE_CURRENT_SOURCE_DIR}/*.h) 27 | 28 | source_group(general FILES ${SRC}) 29 | 30 | 31 | add_executable(tests ${SRC} ) 32 | target_link_libraries( tests ${Boost_LIBRARIES} ) 33 | 34 | -------------------------------------------------------------------------------- /contrib/epee/tests/src/tests.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "include_base_utils.h" 3 | #include "storages/storage_tests.h" 4 | #include "misc/test_math.h" 5 | #include "storages/portable_storages_test.h" 6 | #include "net/test_net.h" 7 | 8 | using namespace epee; 9 | 10 | int main(int argc, char* argv[]) 11 | { 12 | 13 | string_tools::set_module_name_and_folder(argv[0]); 14 | 15 | //set up logging options 16 | log_space::get_set_log_detalisation_level(true, LOG_LEVEL_2); 17 | log_space::log_singletone::add_logger(LOGGER_CONSOLE, NULL, NULL); 18 | log_space::log_singletone::add_logger(LOGGER_FILE, 19 | log_space::log_singletone::get_default_log_file().c_str(), 20 | log_space::log_singletone::get_default_log_folder().c_str()); 21 | 22 | 23 | string_tools::command_line_params_a start_params; 24 | string_tools::parse_commandline(start_params, argc, argv); 25 | std::string tests_data_path; 26 | string_tools::get_xparam_from_command_line(start_params, std::string("/tests_folder"), tests_data_path); 27 | 28 | if(string_tools::have_in_command_line(start_params, std::string("/run_net_tests"))) 29 | { 30 | if(!tests::do_run_test_server()) 31 | { 32 | LOG_ERROR("net tests failed"); 33 | return 1; 34 | } 35 | if(!tests::do_run_test_server_async_connect() ) 36 | { 37 | LOG_ERROR("net tests failed"); 38 | return 1; 39 | } 40 | }else if(string_tools::have_in_command_line(start_params, std::string("/run_unit_tests"))) 41 | { 42 | if(!tests::test_median()) 43 | { 44 | LOG_ERROR("median test failed"); 45 | return 1; 46 | } 47 | 48 | 49 | if(!tests::test_storages(tests_data_path)) 50 | { 51 | LOG_ERROR("storage test failed"); 52 | return 1; 53 | } 54 | }else if(string_tools::have_in_command_line(start_params, std::string("/run_portable_storage_test"))) 55 | { 56 | tests::test_portable_storages(tests_data_path); 57 | } 58 | return 1; 59 | } -------------------------------------------------------------------------------- /external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(UPNPC_BUILD_STATIC ON CACHE BOOL "Build static library") 2 | set(UPNPC_BUILD_SHARED OFF CACHE BOOL "Build shared library") 3 | set(UPNPC_BUILD_TESTS OFF CACHE BOOL "Build test executables") 4 | add_subdirectory(miniupnpc) 5 | 6 | set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") 7 | if(MSVC) 8 | set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") 9 | elseif(NOT MSVC) 10 | set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") 11 | endif() 12 | -------------------------------------------------------------------------------- /external/miniupnpc/LICENSE: -------------------------------------------------------------------------------- 1 | MiniUPnPc 2 | Copyright (c) 2005-2016, Thomas BERNARD 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | * 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 | * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | 28 | -------------------------------------------------------------------------------- /external/miniupnpc/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README 2 | include miniupnpcmodule.c 3 | include setup.py 4 | include *.h 5 | include libminiupnpc.a 6 | -------------------------------------------------------------------------------- /external/miniupnpc/README: -------------------------------------------------------------------------------- 1 | Project: miniupnp 2 | Project web page: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 3 | github: https://github.com/miniupnp/miniupnp 4 | freecode: http://freecode.com/projects/miniupnp 5 | Author: Thomas Bernard 6 | Copyright (c) 2005-2016 Thomas Bernard 7 | This software is subject to the conditions detailed in the 8 | LICENSE file provided within this distribution. 9 | 10 | 11 | * miniUPnP Client - miniUPnPc * 12 | 13 | To compile, simply run 'gmake' (could be 'make' on your system). 14 | Under win32, to compile with MinGW, type "mingw32make.bat". 15 | MS Visual C solution and project files are supplied in the msvc/ subdirectory. 16 | 17 | The compilation is known to work under linux, FreeBSD, 18 | OpenBSD, MacOS X, AmigaOS and cygwin. 19 | The official AmigaOS4.1 SDK was used for AmigaOS4 and GeekGadgets for AmigaOS3. 20 | upx (http://upx.sourceforge.net) is used to compress the win32 .exe files. 21 | 22 | To install the library and headers on the system use : 23 | > su 24 | > make install 25 | > exit 26 | 27 | alternatively, to install into a specific location, use : 28 | > INSTALLPREFIX=/usr/local make install 29 | 30 | upnpc.c is a sample client using the libminiupnpc. 31 | To use the libminiupnpc in your application, link it with 32 | libminiupnpc.a (or .so) and use the following functions found in miniupnpc.h, 33 | upnpcommands.h and miniwget.h : 34 | - upnpDiscover() 35 | - UPNP_GetValidIGD() 36 | - miniwget() 37 | - parserootdesc() 38 | - GetUPNPUrls() 39 | - UPNP_* (calling UPNP methods) 40 | 41 | Note : use #include etc... for the includes 42 | and -lminiupnpc for the link 43 | 44 | Discovery process is speeded up when MiniSSDPd is running on the machine. 45 | 46 | 47 | * Python module * 48 | 49 | you can build a python module with 'make pythonmodule' 50 | and install it with 'make installpythonmodule'. 51 | setup.py (and setupmingw32.py) are included in the distribution. 52 | 53 | 54 | Feel free to contact me if you have any problem : 55 | e-mail : miniupnp@free.fr 56 | 57 | If you are using libminiupnpc in your application, please 58 | send me an email ! 59 | 60 | For any question, you can use the web forum : 61 | http://miniupnp.tuxfamily.org/forum/ 62 | 63 | Bugs should be reported on github : 64 | https://github.com/miniupnp/miniupnp/issues 65 | -------------------------------------------------------------------------------- /external/miniupnpc/VERSION: -------------------------------------------------------------------------------- 1 | 2.0 2 | -------------------------------------------------------------------------------- /external/miniupnpc/codelength.h: -------------------------------------------------------------------------------- 1 | /* $Id: codelength.h,v 1.3 2011/07/30 13:10:05 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas BERNARD 4 | * copyright (c) 2005-2015 Thomas Bernard 5 | * This software is subjet to the conditions detailed in the 6 | * provided LICENCE file. */ 7 | #ifndef CODELENGTH_H_INCLUDED 8 | #define CODELENGTH_H_INCLUDED 9 | 10 | /* Encode length by using 7bit per Byte : 11 | * Most significant bit of each byte specifies that the 12 | * following byte is part of the code */ 13 | 14 | /* n : unsigned 15 | * p : unsigned char * 16 | */ 17 | #define DECODELENGTH(n, p) n = 0; \ 18 | do { n = (n << 7) | (*p & 0x7f); } \ 19 | while((*(p++)&0x80) && (n<(1<<25))); 20 | 21 | /* n : unsigned 22 | * READ : function/macro to read one byte (unsigned char) 23 | */ 24 | #define DECODELENGTH_READ(n, READ) \ 25 | n = 0; \ 26 | do { \ 27 | unsigned char c; \ 28 | READ(c); \ 29 | n = (n << 7) | (c & 0x07f); \ 30 | if(!(c&0x80)) break; \ 31 | } while(n<(1<<25)); 32 | 33 | /* n : unsigned 34 | * p : unsigned char * 35 | * p_limit : unsigned char * 36 | */ 37 | #define DECODELENGTH_CHECKLIMIT(n, p, p_limit) \ 38 | n = 0; \ 39 | do { \ 40 | if((p) >= (p_limit)) break; \ 41 | n = (n << 7) | (*(p) & 0x7f); \ 42 | } while((*((p)++)&0x80) && (n<(1<<25))); 43 | 44 | 45 | /* n : unsigned 46 | * p : unsigned char * 47 | */ 48 | #define CODELENGTH(n, p) if(n>=268435456) *(p++) = (n >> 28) | 0x80; \ 49 | if(n>=2097152) *(p++) = (n >> 21) | 0x80; \ 50 | if(n>=16384) *(p++) = (n >> 14) | 0x80; \ 51 | if(n>=128) *(p++) = (n >> 7) | 0x80; \ 52 | *(p++) = n & 0x7f; 53 | 54 | #endif /* CODELENGTH_H_INCLUDED */ 55 | -------------------------------------------------------------------------------- /external/miniupnpc/connecthostport.h: -------------------------------------------------------------------------------- 1 | /* $Id: connecthostport.h,v 1.2 2012/06/23 22:32:33 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2010-2012 Thomas Bernard 6 | * This software is subjects to the conditions detailed 7 | * in the LICENCE file provided within this distribution */ 8 | #ifndef CONNECTHOSTPORT_H_INCLUDED 9 | #define CONNECTHOSTPORT_H_INCLUDED 10 | 11 | /* connecthostport() 12 | * return a socket connected (TCP) to the host and port 13 | * or -1 in case of error */ 14 | int connecthostport(const char * host, unsigned short port, 15 | unsigned int scope_id); 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /external/miniupnpc/external-ip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $Id: external-ip.sh,v 1.1 2010/08/05 12:57:41 nanard Exp $ 3 | # (c) 2010 Reuben Hawkins 4 | upnpc -s | grep ExternalIPAddress | sed 's/[^0-9\.]//g' 5 | -------------------------------------------------------------------------------- /external/miniupnpc/igd_desc_parse.h: -------------------------------------------------------------------------------- 1 | /* $Id: igd_desc_parse.h,v 1.12 2014/11/17 17:19:13 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * http://miniupnp.free.fr/ 4 | * Author : Thomas Bernard 5 | * Copyright (c) 2005-2014 Thomas Bernard 6 | * This software is subject to the conditions detailed in the 7 | * LICENCE file provided in this distribution. 8 | * */ 9 | #ifndef IGD_DESC_PARSE_H_INCLUDED 10 | #define IGD_DESC_PARSE_H_INCLUDED 11 | 12 | /* Structure to store the result of the parsing of UPnP 13 | * descriptions of Internet Gateway Devices */ 14 | #define MINIUPNPC_URL_MAXSIZE (128) 15 | struct IGDdatas_service { 16 | char controlurl[MINIUPNPC_URL_MAXSIZE]; 17 | char eventsuburl[MINIUPNPC_URL_MAXSIZE]; 18 | char scpdurl[MINIUPNPC_URL_MAXSIZE]; 19 | char servicetype[MINIUPNPC_URL_MAXSIZE]; 20 | /*char devicetype[MINIUPNPC_URL_MAXSIZE];*/ 21 | }; 22 | 23 | struct IGDdatas { 24 | char cureltname[MINIUPNPC_URL_MAXSIZE]; 25 | char urlbase[MINIUPNPC_URL_MAXSIZE]; 26 | char presentationurl[MINIUPNPC_URL_MAXSIZE]; 27 | int level; 28 | /*int state;*/ 29 | /* "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1" */ 30 | struct IGDdatas_service CIF; 31 | /* "urn:schemas-upnp-org:service:WANIPConnection:1" 32 | * "urn:schemas-upnp-org:service:WANPPPConnection:1" */ 33 | struct IGDdatas_service first; 34 | /* if both WANIPConnection and WANPPPConnection are present */ 35 | struct IGDdatas_service second; 36 | /* "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1" */ 37 | struct IGDdatas_service IPv6FC; 38 | /* tmp */ 39 | struct IGDdatas_service tmp; 40 | }; 41 | 42 | void IGDstartelt(void *, const char *, int); 43 | void IGDendelt(void *, const char *, int); 44 | void IGDdata(void *, const char *, int); 45 | #ifdef DEBUG 46 | void printIGD(struct IGDdatas *); 47 | #endif /* DEBUG */ 48 | 49 | #endif /* IGD_DESC_PARSE_H_INCLUDED */ 50 | -------------------------------------------------------------------------------- /external/miniupnpc/java/testjava.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set JAVA=java 3 | set JAVAC=javac 4 | REM notice the semicolon for Windows. Write once, run ... oh nevermind 5 | set CP=miniupnpc_win32.jar;. 6 | 7 | %JAVAC% -cp "%CP%" JavaBridgeTest.java || exit 1 8 | %JAVA% -cp "%CP%" JavaBridgeTest 12345 UDP || exit 1 9 | -------------------------------------------------------------------------------- /external/miniupnpc/java/testjava.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | JAVA=java 4 | JAVAC=javac 5 | CP=$(for i in *.jar; do echo -n $i:; done). 6 | 7 | $JAVAC -cp $CP JavaBridgeTest.java || exit 1 8 | $JAVA -cp $CP JavaBridgeTest 12345 UDP || exit 1 9 | -------------------------------------------------------------------------------- /external/miniupnpc/mingw32make.bat: -------------------------------------------------------------------------------- 1 | @mingw32-make -f Makefile.mingw %1 2 | @if errorlevel 1 goto end 3 | @if not exist upnpc-static.exe goto end 4 | @strip upnpc-static.exe 5 | @upx --best upnpc-static.exe 6 | @strip upnpc-shared.exe 7 | @upx --best upnpc-shared.exe 8 | :end 9 | -------------------------------------------------------------------------------- /external/miniupnpc/minisoap.h: -------------------------------------------------------------------------------- 1 | /* $Id: minisoap.h,v 1.4 2010/04/12 20:39:41 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2005 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided in this distribution. */ 7 | #ifndef MINISOAP_H_INCLUDED 8 | #define MINISOAP_H_INCLUDED 9 | 10 | /*int httpWrite(int, const char *, int, const char *);*/ 11 | int soapPostSubmit(int, const char *, const char *, unsigned short, 12 | const char *, const char *, const char *); 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /external/miniupnpc/minissdpc.h: -------------------------------------------------------------------------------- 1 | /* $Id: minissdpc.h,v 1.6 2015/09/18 12:45:16 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2005-2015 Thomas Bernard 6 | * This software is subjects to the conditions detailed 7 | * in the LICENCE file provided within this distribution */ 8 | #ifndef MINISSDPC_H_INCLUDED 9 | #define MINISSDPC_H_INCLUDED 10 | 11 | #include "miniupnpc_declspec.h" 12 | #include "upnpdev.h" 13 | 14 | /* error codes : */ 15 | #define MINISSDPC_SUCCESS (0) 16 | #define MINISSDPC_UNKNOWN_ERROR (-1) 17 | #define MINISSDPC_SOCKET_ERROR (-101) 18 | #define MINISSDPC_MEMORY_ERROR (-102) 19 | #define MINISSDPC_INVALID_INPUT (-103) 20 | #define MINISSDPC_INVALID_SERVER_REPLY (-104) 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #if !(defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__)) 27 | 28 | MINIUPNP_LIBSPEC struct UPNPDev * 29 | getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath, int * error); 30 | 31 | MINIUPNP_LIBSPEC int 32 | connectToMiniSSDPD(const char * socketpath); 33 | 34 | MINIUPNP_LIBSPEC int 35 | disconnectFromMiniSSDPD(int fd); 36 | 37 | MINIUPNP_LIBSPEC int 38 | requestDevicesFromMiniSSDPD(int fd, const char * devtype); 39 | 40 | MINIUPNP_LIBSPEC struct UPNPDev * 41 | receiveDevicesFromMiniSSDPD(int fd, int * error); 42 | 43 | #endif /* !(defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__)) */ 44 | 45 | MINIUPNP_LIBSPEC struct UPNPDev * 46 | ssdpDiscoverDevices(const char * const deviceTypes[], 47 | int delay, const char * multicastif, 48 | int localport, 49 | int ipv6, unsigned char ttl, 50 | int * error, 51 | int searchalltypes); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpc.def: -------------------------------------------------------------------------------- 1 | LIBRARY 2 | ; miniupnpc library 3 | miniupnpc 4 | 5 | EXPORTS 6 | ; miniupnpc 7 | upnpDiscover 8 | freeUPNPDevlist 9 | parserootdesc 10 | UPNP_GetValidIGD 11 | UPNP_GetIGDFromUrl 12 | GetUPNPUrls 13 | FreeUPNPUrls 14 | ; miniwget 15 | miniwget 16 | miniwget_getaddr 17 | ; upnpcommands 18 | UPNP_GetTotalBytesSent 19 | UPNP_GetTotalBytesReceived 20 | UPNP_GetTotalPacketsSent 21 | UPNP_GetTotalPacketsReceived 22 | UPNP_GetStatusInfo 23 | UPNP_GetConnectionTypeInfo 24 | UPNP_GetExternalIPAddress 25 | UPNP_GetLinkLayerMaxBitRates 26 | UPNP_AddPortMapping 27 | UPNP_AddAnyPortMapping 28 | UPNP_DeletePortMapping 29 | UPNP_DeletePortMappingRange 30 | UPNP_GetPortMappingNumberOfEntries 31 | UPNP_GetSpecificPortMappingEntry 32 | UPNP_GetGenericPortMappingEntry 33 | UPNP_GetListOfPortMappings 34 | UPNP_AddPinhole 35 | UPNP_CheckPinholeWorking 36 | UPNP_UpdatePinhole 37 | UPNP_GetPinholePackets 38 | UPNP_DeletePinhole 39 | UPNP_GetFirewallStatus 40 | UPNP_GetOutboundPinholeTimeout 41 | ; upnperrors 42 | strupnperror 43 | ; portlistingparse 44 | ParsePortListing 45 | FreePortListing 46 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpc_declspec.h: -------------------------------------------------------------------------------- 1 | #ifndef MINIUPNPC_DECLSPEC_H_INCLUDED 2 | #define MINIUPNPC_DECLSPEC_H_INCLUDED 3 | 4 | #if defined(_WIN32) && !defined(MINIUPNP_STATICLIB) 5 | /* for windows dll */ 6 | #ifdef MINIUPNP_EXPORTS 7 | #define MINIUPNP_LIBSPEC __declspec(dllexport) 8 | #else 9 | #define MINIUPNP_LIBSPEC __declspec(dllimport) 10 | #endif 11 | #else 12 | #if defined(__GNUC__) && __GNUC__ >= 4 13 | /* fix dynlib for OS X 10.9.2 and Apple LLVM version 5.0 */ 14 | #define MINIUPNP_LIBSPEC __attribute__ ((visibility ("default"))) 15 | #else 16 | #define MINIUPNP_LIBSPEC 17 | #endif 18 | #endif 19 | 20 | #endif /* MINIUPNPC_DECLSPEC_H_INCLUDED */ 21 | 22 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpcstrings.h.cmake: -------------------------------------------------------------------------------- 1 | #ifndef MINIUPNPCSTRINGS_H_INCLUDED 2 | #define MINIUPNPCSTRINGS_H_INCLUDED 3 | 4 | #define OS_STRING "${CMAKE_SYSTEM_NAME}" 5 | #define MINIUPNPC_VERSION_STRING "${MINIUPNPC_VERSION}" 6 | 7 | #if 0 8 | /* according to "UPnP Device Architecture 1.0" */ 9 | #define UPNP_VERSION_STRING "UPnP/1.0" 10 | #else 11 | /* according to "UPnP Device Architecture 1.1" */ 12 | #define UPNP_VERSION_STRING "UPnP/1.1" 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpcstrings.h.in: -------------------------------------------------------------------------------- 1 | /* $Id: miniupnpcstrings.h.in,v 1.6 2014/11/04 22:31:55 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2005-2014 Thomas Bernard 6 | * This software is subjects to the conditions detailed 7 | * in the LICENCE file provided within this distribution */ 8 | #ifndef MINIUPNPCSTRINGS_H_INCLUDED 9 | #define MINIUPNPCSTRINGS_H_INCLUDED 10 | 11 | #define OS_STRING "OS/version" 12 | #define MINIUPNPC_VERSION_STRING "version" 13 | 14 | #if 0 15 | /* according to "UPnP Device Architecture 1.0" */ 16 | #define UPNP_VERSION_STRING "UPnP/1.0" 17 | #else 18 | /* according to "UPnP Device Architecture 1.1" */ 19 | #define UPNP_VERSION_STRING "UPnP/1.1" 20 | #endif 21 | 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpctypes.h: -------------------------------------------------------------------------------- 1 | /* $Id: miniupnpctypes.h,v 1.1 2011/02/15 11:10:40 nanard Exp $ */ 2 | /* Miniupnp project : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2011 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided within this distribution */ 7 | #ifndef MINIUPNPCTYPES_H_INCLUDED 8 | #define MINIUPNPCTYPES_H_INCLUDED 9 | 10 | #if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) 11 | #define UNSIGNED_INTEGER unsigned long long 12 | #define STRTOUI strtoull 13 | #else 14 | #define UNSIGNED_INTEGER unsigned int 15 | #define STRTOUI strtoul 16 | #endif 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /external/miniupnpc/miniwget.h: -------------------------------------------------------------------------------- 1 | /* $Id: miniwget.h,v 1.12 2016/01/24 17:24:36 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2005-2016 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided in this distribution. 7 | * */ 8 | #ifndef MINIWGET_H_INCLUDED 9 | #define MINIWGET_H_INCLUDED 10 | 11 | #include "miniupnpc_declspec.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | MINIUPNP_LIBSPEC void * getHTTPResponse(int s, int * size, int * status_code); 18 | 19 | MINIUPNP_LIBSPEC void * miniwget(const char *, int *, unsigned int, int *); 20 | 21 | MINIUPNP_LIBSPEC void * miniwget_getaddr(const char *, int *, char *, int, unsigned int, int *); 22 | 23 | int parseURL(const char *, char *, unsigned short *, char * *, unsigned int *); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /external/miniupnpc/minixml.h: -------------------------------------------------------------------------------- 1 | /* $Id: minixml.h,v 1.6 2006/11/30 11:47:21 nanard Exp $ */ 2 | /* minimal xml parser 3 | * 4 | * Project : miniupnp 5 | * Website : http://miniupnp.free.fr/ 6 | * Author : Thomas Bernard 7 | * Copyright (c) 2005 Thomas Bernard 8 | * This software is subject to the conditions detailed in the 9 | * LICENCE file provided in this distribution. 10 | * */ 11 | #ifndef MINIXML_H_INCLUDED 12 | #define MINIXML_H_INCLUDED 13 | #define IS_WHITE_SPACE(c) ((c==' ') || (c=='\t') || (c=='\r') || (c=='\n')) 14 | 15 | /* if a callback function pointer is set to NULL, 16 | * the function is not called */ 17 | struct xmlparser { 18 | const char *xmlstart; 19 | const char *xmlend; 20 | const char *xml; /* pointer to current character */ 21 | int xmlsize; 22 | void * data; 23 | void (*starteltfunc) (void *, const char *, int); 24 | void (*endeltfunc) (void *, const char *, int); 25 | void (*datafunc) (void *, const char *, int); 26 | void (*attfunc) (void *, const char *, int, const char *, int); 27 | }; 28 | 29 | /* parsexml() 30 | * the xmlparser structure must be initialized before the call 31 | * the following structure members have to be initialized : 32 | * xmlstart, xmlsize, data, *func 33 | * xml is for internal usage, xmlend is computed automatically */ 34 | void parsexml(struct xmlparser *); 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /external/miniupnpc/msvc/miniupnpc.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniupnpc", "miniupnpc.vcproj", "{D28CE435-CB33-4BAE-8A52-C6EF915956F5}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upnpc-static", "upnpc-static.vcproj", "{469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5} = {D28CE435-CB33-4BAE-8A52-C6EF915956F5} 9 | EndProjectSection 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Debug|Win32.Build.0 = Debug|Win32 19 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Release|Win32.ActiveCfg = Release|Win32 20 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Release|Win32.Build.0 = Release|Win32 21 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Debug|Win32.ActiveCfg = Debug|Win32 22 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Debug|Win32.Build.0 = Debug|Win32 23 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Release|Win32.ActiveCfg = Release|Win32 24 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Release|Win32.Build.0 = Release|Win32 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /external/miniupnpc/msvc/miniupnpc.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/external/miniupnpc/msvc/miniupnpc.vcproj -------------------------------------------------------------------------------- /external/miniupnpc/msvc/upnpc-static.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/external/miniupnpc/msvc/upnpc-static.vcproj -------------------------------------------------------------------------------- /external/miniupnpc/portlistingparse.h: -------------------------------------------------------------------------------- 1 | /* $Id: portlistingparse.h,v 1.10 2014/11/01 10:37:32 nanard Exp $ */ 2 | /* MiniUPnP project 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * (c) 2011-2015 Thomas Bernard 5 | * This software is subject to the conditions detailed 6 | * in the LICENCE file provided within the distribution */ 7 | #ifndef PORTLISTINGPARSE_H_INCLUDED 8 | #define PORTLISTINGPARSE_H_INCLUDED 9 | 10 | #include "miniupnpc_declspec.h" 11 | /* for the definition of UNSIGNED_INTEGER */ 12 | #include "miniupnpctypes.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /* sample of PortMappingEntry : 19 | 20 | 202.233.2.1 21 | 2345 22 | TCP 23 | 2345 24 | 192.168.1.137 25 | 1 26 | dooom 27 | 345 28 | 29 | */ 30 | typedef enum { PortMappingEltNone, 31 | PortMappingEntry, NewRemoteHost, 32 | NewExternalPort, NewProtocol, 33 | NewInternalPort, NewInternalClient, 34 | NewEnabled, NewDescription, 35 | NewLeaseTime } portMappingElt; 36 | 37 | struct PortMapping { 38 | struct PortMapping * l_next; /* list next element */ 39 | UNSIGNED_INTEGER leaseTime; 40 | unsigned short externalPort; 41 | unsigned short internalPort; 42 | char remoteHost[64]; 43 | char internalClient[64]; 44 | char description[64]; 45 | char protocol[4]; 46 | unsigned char enabled; 47 | }; 48 | 49 | struct PortMappingParserData { 50 | struct PortMapping * l_head; /* list head */ 51 | portMappingElt curelt; 52 | }; 53 | 54 | MINIUPNP_LIBSPEC void 55 | ParsePortListing(const char * buffer, int bufsize, 56 | struct PortMappingParserData * pdata); 57 | 58 | MINIUPNP_LIBSPEC void 59 | FreePortListing(struct PortMappingParserData * pdata); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /external/miniupnpc/pymoduletest3.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python3 2 | # MiniUPnP project 3 | # Author : Thomas Bernard 4 | # This Sample code is public domain. 5 | # website : http://miniupnp.tuxfamily.org/ 6 | 7 | # import the python miniupnpc module 8 | import miniupnpc 9 | import sys 10 | 11 | # create the object 12 | u = miniupnpc.UPnP() 13 | print('inital(default) values :') 14 | print(' discoverdelay', u.discoverdelay) 15 | print(' lanaddr', u.lanaddr) 16 | print(' multicastif', u.multicastif) 17 | print(' minissdpdsocket', u.minissdpdsocket) 18 | u.discoverdelay = 200; 19 | #u.minissdpdsocket = '../minissdpd/minissdpd.sock' 20 | # discovery process, it usualy takes several seconds (2 seconds or more) 21 | print('Discovering... delay=%ums' % u.discoverdelay) 22 | print(u.discover(), 'device(s) detected') 23 | # select an igd 24 | try: 25 | u.selectigd() 26 | except Exception as e: 27 | print('Exception :', e) 28 | sys.exit(1) 29 | # display information about the IGD and the internet connection 30 | print('local ip address :', u.lanaddr) 31 | print('external ip address :', u.externalipaddress()) 32 | print(u.statusinfo(), u.connectiontype()) 33 | 34 | #print u.addportmapping(64000, 'TCP', 35 | # '192.168.1.166', 63000, 'port mapping test', '') 36 | #print u.deleteportmapping(64000, 'TCP') 37 | 38 | port = 0 39 | proto = 'UDP' 40 | # list the redirections : 41 | i = 0 42 | while True: 43 | p = u.getgenericportmapping(i) 44 | if p==None: 45 | break 46 | print(i, p) 47 | (port, proto, (ihost,iport), desc, c, d, e) = p 48 | #print port, desc 49 | i = i + 1 50 | 51 | print(u.getspecificportmapping(port, proto)) 52 | 53 | -------------------------------------------------------------------------------- /external/miniupnpc/receivedata.h: -------------------------------------------------------------------------------- 1 | /* $Id: receivedata.h,v 1.3 2012/06/23 22:34:47 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2011-2012 Thomas Bernard 6 | * This software is subjects to the conditions detailed 7 | * in the LICENCE file provided within this distribution */ 8 | #ifndef RECEIVEDATA_H_INCLUDED 9 | #define RECEIVEDATA_H_INCLUDED 10 | 11 | /* Reads data from the specified socket. 12 | * Returns the number of bytes read if successful, zero if no bytes were 13 | * read or if we timed out. Returns negative if there was an error. */ 14 | int receivedata(int socket, 15 | char * data, int length, 16 | int timeout, unsigned int * scope_id); 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /external/miniupnpc/setup.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # vim: tabstop=8 shiftwidth=8 expandtab 3 | # $Id: setup.py,v 1.9 2012/05/23 08:50:10 nanard Exp $ 4 | # the MiniUPnP Project (c) 2007-2014 Thomas Bernard 5 | # http://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/ 6 | # 7 | # python script to build the miniupnpc module under unix 8 | # 9 | # replace libminiupnpc.a by libminiupnpc.so for shared library usage 10 | try: 11 | from setuptools import setup, Extension 12 | except ImportError: 13 | from distutils.core import setup, Extension 14 | from distutils import sysconfig 15 | sysconfig.get_config_vars()["OPT"] = '' 16 | sysconfig.get_config_vars()["CFLAGS"] = '' 17 | setup(name="miniupnpc", 18 | version=open('VERSION').read().strip(), 19 | author='Thomas BERNARD', 20 | author_email='miniupnp@free.fr', 21 | license=open('LICENSE').read(), 22 | url='http://miniupnp.free.fr/', 23 | description='miniUPnP client', 24 | ext_modules=[ 25 | Extension(name="miniupnpc", sources=["miniupnpcmodule.c"], 26 | extra_objects=["libminiupnpc.a"]) 27 | ]) 28 | 29 | -------------------------------------------------------------------------------- /external/miniupnpc/setupmingw32.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # vim: tabstop=8 shiftwidth=8 expandtab 3 | # $Id: setupmingw32.py,v 1.8 2012/05/23 08:50:10 nanard Exp $ 4 | # the MiniUPnP Project (c) 2007-2014 Thomas Bernard 5 | # http://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/ 6 | # 7 | # python script to build the miniupnpc module under windows (using mingw32) 8 | # 9 | try: 10 | from setuptools import setup, Extension 11 | except ImportError: 12 | from distutils.core import setup, Extension 13 | from distutils import sysconfig 14 | sysconfig.get_config_vars()["OPT"] = '' 15 | sysconfig.get_config_vars()["CFLAGS"] = '' 16 | setup(name="miniupnpc", 17 | version=open('VERSION').read().strip(), 18 | author='Thomas BERNARD', 19 | author_email='miniupnp@free.fr', 20 | license=open('LICENSE').read(), 21 | url='http://miniupnp.free.fr/', 22 | description='miniUPnP client', 23 | ext_modules=[ 24 | Extension(name="miniupnpc", sources=["miniupnpcmodule.c"], 25 | libraries=["ws2_32", "iphlpapi"], 26 | extra_objects=["libminiupnpc.a"]) 27 | ]) 28 | 29 | -------------------------------------------------------------------------------- /external/miniupnpc/testdesc/linksys_WAG200G_desc.values: -------------------------------------------------------------------------------- 1 | # values for linksys_WAG200G_desc.xml 2 | 3 | CIF: 4 | servicetype = urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1 5 | controlurl = /upnp/control/WANCommonIFC1 6 | eventsuburl = /upnp/event/WANCommonIFC1 7 | scpdurl = /cmnicfg.xml 8 | 9 | first: 10 | servicetype = urn:schemas-upnp-org:service:WANPPPConnection:1 11 | controlurl = /upnp/control/WANPPPConn1 12 | eventsuburl = /upnp/event/WANPPPConn1 13 | scpdurl = /pppcfg.xml 14 | 15 | -------------------------------------------------------------------------------- /external/miniupnpc/testdesc/new_LiveBox_desc.values: -------------------------------------------------------------------------------- 1 | # values for new_LiveBox_desc.xml 2 | 3 | CIF: 4 | servicetype = urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1 5 | controlurl = /87895a19/upnp/control/WANCommonIFC1 6 | eventsuburl = /87895a19/upnp/control/WANCommonIFC1 7 | scpdurl = /87895a19/gateicfgSCPD.xml 8 | 9 | first: 10 | servicetype = urn:schemas-upnp-org:service:WANPPPConnection:2 11 | controlurl = /87895a19/upnp/control/WANIPConn1 12 | eventsuburl = /87895a19/upnp/control/WANIPConn1 13 | scpdurl = /87895a19/gateconnSCPD_PPP.xml 14 | 15 | IPv6FC: 16 | servicetype = urn:schemas-upnp-org:service:WANIPv6FirewallControl:1 17 | controlurl = /87895a19/upnp/control/WANIPv6FwCtrl1 18 | eventsuburl = /87895a19/upnp/control/WANIPv6FwCtrl1 19 | scpdurl = /87895a19/wanipv6fwctrlSCPD.xml 20 | 21 | -------------------------------------------------------------------------------- /external/miniupnpc/testminiwget.c: -------------------------------------------------------------------------------- 1 | /* $Id: testminiwget.c,v 1.5 2016/01/24 17:24:36 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2005-2016 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided in this distribution. 7 | * */ 8 | #include 9 | #include 10 | #include "miniwget.h" 11 | 12 | /** 13 | * This program uses the miniwget / miniwget_getaddr function 14 | * from miniwget.c in order to retreive a web ressource using 15 | * a GET HTTP method, and store it in a file. 16 | */ 17 | int main(int argc, char * * argv) 18 | { 19 | void * data; 20 | int size, writtensize; 21 | FILE *f; 22 | char addr[64]; 23 | int status_code = -1; 24 | 25 | if(argc < 3) { 26 | fprintf(stderr, "Usage:\t%s url file\n", argv[0]); 27 | fprintf(stderr, "Example:\t%s http://www.google.com/ out.html\n", argv[0]); 28 | return 1; 29 | } 30 | data = miniwget_getaddr(argv[1], &size, addr, sizeof(addr), 0, &status_code); 31 | if(!data || (status_code != 200)) { 32 | if(data) free(data); 33 | fprintf(stderr, "Error %d fetching %s\n", status_code, argv[1]); 34 | return 1; 35 | } 36 | printf("local address : %s\n", addr); 37 | printf("got %d bytes\n", size); 38 | f = fopen(argv[2], "wb"); 39 | if(!f) { 40 | fprintf(stderr, "Cannot open file %s for writing\n", argv[2]); 41 | free(data); 42 | return 1; 43 | } 44 | writtensize = fwrite(data, 1, size, f); 45 | if(writtensize != size) { 46 | fprintf(stderr, "Could only write %d bytes out of %d to %s\n", 47 | writtensize, size, argv[2]); 48 | } else { 49 | printf("%d bytes written to %s\n", writtensize, argv[2]); 50 | } 51 | fclose(f); 52 | free(data); 53 | return 0; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /external/miniupnpc/testminixml.c: -------------------------------------------------------------------------------- 1 | /* $Id: testminixml.c,v 1.10 2014/11/17 17:19:13 nanard Exp $ 2 | * MiniUPnP project 3 | * Website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * Author : Thomas Bernard. 5 | * Copyright (c) 2005-2014 Thomas Bernard 6 | * 7 | * testminixml.c 8 | * test program for the "minixml" functions. 9 | */ 10 | #include 11 | #include 12 | #include 13 | #include "minixml.h" 14 | #include "igd_desc_parse.h" 15 | 16 | /* ---------------------------------------------------------------------- */ 17 | void printeltname1(void * d, const char * name, int l) 18 | { 19 | int i; 20 | (void)d; 21 | printf("element "); 22 | for(i=0;i 2 | 123 3 | TCP 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetExternalIPAddress.namevalue: -------------------------------------------------------------------------------- 1 | NewExternalIPAddress=1.2.3.4 2 | 3 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetExternalIPAddress.xml: -------------------------------------------------------------------------------- 1 | 1.2.3.4 2 | 3 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.namevalue: -------------------------------------------------------------------------------- 1 | NewProtocol=UDP 2 | NewExternalPort=12345 3 | NewRemoteHost= 4 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.xml: -------------------------------------------------------------------------------- 1 | 2 | 12345UDP 3 | 4 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.namevalue: -------------------------------------------------------------------------------- 1 | NewInternalPort=12345 2 | NewInternalClient=192.168.10.110 3 | NewEnabled=1 4 | NewPortMappingDescription=libminiupnpc 5 | NewLeaseDuration=0 6 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.xml: -------------------------------------------------------------------------------- 1 | 12345192.168.10.1101libminiupnpc0 2 | 3 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/SetDefaultConnectionService.namevalue: -------------------------------------------------------------------------------- 1 | NewDefaultConnectionService=uuid:c6c05a33-f704-48df-9910-e099b3471d81:WANConnectionDevice:1,INVALID_SERVICE_ID 2 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/SetDefaultConnectionService.xml: -------------------------------------------------------------------------------- 1 | uuid:c6c05a33-f704-48df-9910-e099b3471d81:WANConnectionDevice:1,INVALID_SERVICE_ID 2 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains files used for validation of upnpreplyparse.c code. 2 | 3 | Each .xml file to parse should give the results which are in the .namevalue 4 | file. 5 | 6 | A .namevalue file contain name=value lines. 7 | 8 | -------------------------------------------------------------------------------- /external/miniupnpc/testupnpreplyparse.c: -------------------------------------------------------------------------------- 1 | /* $Id: testupnpreplyparse.c,v 1.4 2014/01/27 11:45:19 nanard Exp $ */ 2 | /* MiniUPnP project 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * (c) 2006-2014 Thomas Bernard 5 | * This software is subject to the conditions detailed 6 | * in the LICENCE file provided within the distribution */ 7 | #include 8 | #include 9 | #include 10 | #include "upnpreplyparse.h" 11 | 12 | int 13 | test_parsing(const char * buf, int len, FILE * f) 14 | { 15 | char line[1024]; 16 | struct NameValueParserData pdata; 17 | int ok = 1; 18 | ParseNameValue(buf, len, &pdata); 19 | /* check result */ 20 | if(f != NULL) 21 | { 22 | while(fgets(line, sizeof(line), f)) 23 | { 24 | char * value; 25 | char * equal; 26 | char * parsedvalue; 27 | int l; 28 | l = strlen(line); 29 | while((l > 0) && ((line[l-1] == '\r') || (line[l-1] == '\n'))) 30 | line[--l] = '\0'; 31 | /* skip empty lines */ 32 | if(l == 0) 33 | continue; 34 | equal = strchr(line, '='); 35 | if(equal == NULL) 36 | { 37 | fprintf(stderr, "Warning, line does not contain '=' : %s\n", line); 38 | continue; 39 | } 40 | *equal = '\0'; 41 | value = equal + 1; 42 | parsedvalue = GetValueFromNameValueList(&pdata, line); 43 | if((parsedvalue == NULL) || (strcmp(parsedvalue, value) != 0)) 44 | { 45 | fprintf(stderr, "Element <%s> : expecting value '%s', got '%s'\n", 46 | line, value, parsedvalue ? parsedvalue : ""); 47 | ok = 0; 48 | } 49 | } 50 | } 51 | ClearNameValueList(&pdata); 52 | return ok; 53 | } 54 | 55 | int main(int argc, char * * argv) 56 | { 57 | FILE * f; 58 | char buffer[4096]; 59 | int l; 60 | int ok; 61 | 62 | if(argc<2) 63 | { 64 | fprintf(stderr, "Usage: %s file.xml [file.namevalues]\n", argv[0]); 65 | return 1; 66 | } 67 | f = fopen(argv[1], "r"); 68 | if(!f) 69 | { 70 | fprintf(stderr, "Error : can not open file %s\n", argv[1]); 71 | return 2; 72 | } 73 | l = fread(buffer, 1, sizeof(buffer)-1, f); 74 | fclose(f); 75 | f = NULL; 76 | buffer[l] = '\0'; 77 | if(argc > 2) 78 | { 79 | f = fopen(argv[2], "r"); 80 | if(!f) 81 | { 82 | fprintf(stderr, "Error : can not open file %s\n", argv[2]); 83 | return 2; 84 | } 85 | } 86 | #ifdef DEBUG 87 | DisplayNameValueList(buffer, l); 88 | #endif 89 | ok = test_parsing(buffer, l, f); 90 | if(f) 91 | { 92 | fclose(f); 93 | } 94 | return ok ? 0 : 3; 95 | } 96 | 97 | -------------------------------------------------------------------------------- /external/miniupnpc/testupnpreplyparse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for f in testreplyparse/*.xml ; do 4 | bf="`dirname $f`/`basename $f .xml`" 5 | if ./testupnpreplyparse $f $bf.namevalue ; then 6 | echo "$f : passed" 7 | else 8 | echo "$f : FAILED" 9 | exit 1 10 | fi 11 | done 12 | 13 | exit 0 14 | 15 | -------------------------------------------------------------------------------- /external/miniupnpc/updateminiupnpcstrings.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # $Id: updateminiupnpcstrings.sh,v 1.7 2011/01/04 11:41:53 nanard Exp $ 3 | # project miniupnp : http://miniupnp.free.fr/ 4 | # (c) 2009 Thomas Bernard 5 | 6 | FILE=miniupnpcstrings.h 7 | TMPFILE=miniupnpcstrings.h.tmp 8 | TEMPLATE_FILE=${FILE}.in 9 | 10 | # detecting the OS name and version 11 | OS_NAME=`uname -s` 12 | OS_VERSION=`uname -r` 13 | if [ -f /etc/debian_version ]; then 14 | OS_NAME=Debian 15 | OS_VERSION=`cat /etc/debian_version` 16 | fi 17 | # use lsb_release (Linux Standard Base) when available 18 | LSB_RELEASE=`which lsb_release` 19 | if [ 0 -eq $? -a -x "${LSB_RELEASE}" ]; then 20 | OS_NAME=`${LSB_RELEASE} -i -s` 21 | OS_VERSION=`${LSB_RELEASE} -r -s` 22 | case $OS_NAME in 23 | Debian) 24 | #OS_VERSION=`${LSB_RELEASE} -c -s` 25 | ;; 26 | Ubuntu) 27 | #OS_VERSION=`${LSB_RELEASE} -c -s` 28 | ;; 29 | esac 30 | fi 31 | 32 | # on AmigaOS 3, uname -r returns "unknown", so we use uname -v 33 | if [ "$OS_NAME" = "AmigaOS" ]; then 34 | if [ "$OS_VERSION" = "unknown" ]; then 35 | OS_VERSION=`uname -v` 36 | fi 37 | fi 38 | 39 | echo "Detected OS [$OS_NAME] version [$OS_VERSION]" 40 | MINIUPNPC_VERSION=`cat VERSION` 41 | echo "MiniUPnPc version [${MINIUPNPC_VERSION}]" 42 | 43 | EXPR="s|OS_STRING \".*\"|OS_STRING \"${OS_NAME}/${OS_VERSION}\"|" 44 | #echo $EXPR 45 | test -f ${FILE}.in 46 | echo "setting OS_STRING macro value to ${OS_NAME}/${OS_VERSION} in $FILE." 47 | sed -e "$EXPR" < $TEMPLATE_FILE > $TMPFILE 48 | 49 | EXPR="s|MINIUPNPC_VERSION_STRING \".*\"|MINIUPNPC_VERSION_STRING \"${MINIUPNPC_VERSION}\"|" 50 | echo "setting MINIUPNPC_VERSION_STRING macro value to ${MINIUPNPC_VERSION} in $FILE." 51 | sed -e "$EXPR" < $TMPFILE > $FILE 52 | rm $TMPFILE 53 | 54 | -------------------------------------------------------------------------------- /external/miniupnpc/upnpdev.c: -------------------------------------------------------------------------------- 1 | /* $Id: upnpdev.c,v 1.1 2015/08/28 12:14:19 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Web : http://miniupnp.free.fr/ 4 | * Author : Thomas BERNARD 5 | * copyright (c) 2005-2015 Thomas Bernard 6 | * This software is subjet to the conditions detailed in the 7 | * provided LICENSE file. */ 8 | #include 9 | #include "upnpdev.h" 10 | 11 | /* freeUPNPDevlist() should be used to 12 | * free the chained list returned by upnpDiscover() */ 13 | void freeUPNPDevlist(struct UPNPDev * devlist) 14 | { 15 | struct UPNPDev * next; 16 | while(devlist) 17 | { 18 | next = devlist->pNext; 19 | free(devlist); 20 | devlist = next; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /external/miniupnpc/upnpdev.h: -------------------------------------------------------------------------------- 1 | /* $Id: upnpdev.h,v 1.1 2015/08/28 12:14:19 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Web : http://miniupnp.free.fr/ 4 | * Author : Thomas BERNARD 5 | * copyright (c) 2005-2015 Thomas Bernard 6 | * This software is subjet to the conditions detailed in the 7 | * provided LICENSE file. */ 8 | #ifndef UPNPDEV_H_INCLUDED 9 | #define UPNPDEV_H_INCLUDED 10 | 11 | #include "miniupnpc_declspec.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | struct UPNPDev { 18 | struct UPNPDev * pNext; 19 | char * descURL; 20 | char * st; 21 | unsigned int scope_id; 22 | char * usn; 23 | char buffer[3]; 24 | }; 25 | 26 | /* freeUPNPDevlist() 27 | * free list returned by upnpDiscover() */ 28 | MINIUPNP_LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist); 29 | 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | 36 | #endif /* UPNPDEV_H_INCLUDED */ 37 | -------------------------------------------------------------------------------- /external/miniupnpc/upnperrors.h: -------------------------------------------------------------------------------- 1 | /* $Id: upnperrors.h,v 1.2 2008/07/02 23:31:15 nanard Exp $ */ 2 | /* (c) 2007-2015 Thomas Bernard 3 | * All rights reserved. 4 | * MiniUPnP Project. 5 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 6 | * This software is subjet to the conditions detailed in the 7 | * provided LICENCE file. */ 8 | #ifndef UPNPERRORS_H_INCLUDED 9 | #define UPNPERRORS_H_INCLUDED 10 | 11 | #include "miniupnpc_declspec.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /* strupnperror() 18 | * Return a string description of the UPnP error code 19 | * or NULL for undefinded errors */ 20 | MINIUPNP_LIBSPEC const char * strupnperror(int err); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /external/miniupnpc/upnpreplyparse.h: -------------------------------------------------------------------------------- 1 | /* $Id: upnpreplyparse.h,v 1.19 2014/10/27 16:33:19 nanard Exp $ */ 2 | /* MiniUPnP project 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * (c) 2006-2013 Thomas Bernard 5 | * This software is subject to the conditions detailed 6 | * in the LICENCE file provided within the distribution */ 7 | 8 | #ifndef UPNPREPLYPARSE_H_INCLUDED 9 | #define UPNPREPLYPARSE_H_INCLUDED 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | struct NameValue { 16 | struct NameValue * l_next; 17 | char name[64]; 18 | char value[128]; 19 | }; 20 | 21 | struct NameValueParserData { 22 | struct NameValue * l_head; 23 | char curelt[64]; 24 | char * portListing; 25 | int portListingLength; 26 | int topelt; 27 | const char * cdata; 28 | int cdatalen; 29 | }; 30 | 31 | /* ParseNameValue() */ 32 | void 33 | ParseNameValue(const char * buffer, int bufsize, 34 | struct NameValueParserData * data); 35 | 36 | /* ClearNameValueList() */ 37 | void 38 | ClearNameValueList(struct NameValueParserData * pdata); 39 | 40 | /* GetValueFromNameValueList() */ 41 | char * 42 | GetValueFromNameValueList(struct NameValueParserData * pdata, 43 | const char * Name); 44 | 45 | #if 0 46 | /* GetValueFromNameValueListIgnoreNS() */ 47 | char * 48 | GetValueFromNameValueListIgnoreNS(struct NameValueParserData * pdata, 49 | const char * Name); 50 | #endif 51 | 52 | /* DisplayNameValueList() */ 53 | #ifdef DEBUG 54 | void 55 | DisplayNameValueList(char * buffer, int bufsize); 56 | #endif 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_definitions(-DMINIUPNP_STATICLIB) 2 | 3 | file(GLOB_RECURSE COMMON common/*) 4 | file(GLOB_RECURSE CRYPTO crypto/*) 5 | file(GLOB_RECURSE CRYPTONOTE_CORE cryptonote_core/*) 6 | file(GLOB_RECURSE CRYPTONOTE_PROTOCOL cryptonote_protocol/*) 7 | file(GLOB_RECURSE DAEMON daemon/*) 8 | file(GLOB_RECURSE P2P p2p/*) 9 | file(GLOB_RECURSE RPC rpc/*) 10 | file(GLOB_RECURSE SIMPLEWALLET simplewallet/*) 11 | file(GLOB_RECURSE CONN_TOOL connectivity_tool/*) 12 | file(GLOB_RECURSE WALLET wallet/*) 13 | file(GLOB_RECURSE MINER miner/*) 14 | file(GLOB_RECURSE RINGCT ringct/*) 15 | 16 | source_group(common FILES ${COMMON}) 17 | source_group(crypto FILES ${CRYPTO}) 18 | source_group(cryptonote_core FILES ${CRYPTONOTE_CORE}) 19 | source_group(cryptonote_protocol FILES ${CRYPTONOTE_PROTOCOL}) 20 | source_group(daemon FILES ${DAEMON}) 21 | source_group(p2p FILES ${P2P}) 22 | source_group(rpc FILES ${RPC}) 23 | source_group(ringct FILES ${RINGCT}) 24 | source_group(simplewallet FILES ${SIMPLEWALLET}) 25 | source_group(connectivity-tool FILES ${CONN_TOOL}) 26 | source_group(wallet FILES ${WALLET}) 27 | source_group(simpleminer FILES ${MINER}) 28 | 29 | add_library(ringct ${RINGCT}) 30 | add_library(common ${COMMON}) 31 | add_library(crypto ${CRYPTO}) 32 | add_library(cryptonote_core ${CRYPTONOTE_CORE}) 33 | add_executable(daemon ${DAEMON} ${P2P} ${CRYPTONOTE_PROTOCOL}) 34 | add_executable(connectivity_tool ${CONN_TOOL}) 35 | add_executable(simpleminer ${MINER}) 36 | target_link_libraries(daemon rpc cryptonote_core crypto common ringct libminiupnpc-static ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) 37 | target_link_libraries(connectivity_tool cryptonote_core crypto common ringct ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) 38 | target_link_libraries(simpleminer cryptonote_core crypto common ringct ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) 39 | add_library(rpc ${RPC}) 40 | add_library(wallet ${WALLET}) 41 | add_executable(simplewallet ${SIMPLEWALLET} ) 42 | target_link_libraries(simplewallet wallet rpc cryptonote_core crypto common ringct libminiupnpc-static ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) 43 | add_dependencies(daemon version) 44 | add_dependencies(rpc version) 45 | add_dependencies(simplewallet version) 46 | 47 | set_property(TARGET common crypto cryptonote_core rpc wallet PROPERTY FOLDER "libs") 48 | set_property(TARGET daemon simplewallet connectivity_tool simpleminer PROPERTY FOLDER "prog") 49 | set_property(TARGET daemon PROPERTY OUTPUT_NAME "aeond") 50 | -------------------------------------------------------------------------------- /src/common/base58.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include 34 | #include 35 | 36 | namespace tools 37 | { 38 | namespace base58 39 | { 40 | std::string encode(const std::string& data); 41 | bool decode(const std::string& enc, std::string& data); 42 | 43 | std::string encode_addr(uint64_t tag, const std::string& data); 44 | bool decode_addr(std::string addr, uint64_t& tag, std::string& data); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/common/command_line.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include "command_line.h" 32 | #include "string_tools.h" 33 | 34 | namespace command_line 35 | { 36 | std::string input_line(const std::string& prompt) 37 | { 38 | std::cout << prompt; 39 | 40 | std::string buf; 41 | std::getline(std::cin, buf); 42 | 43 | return epee::string_tools::trim(buf); 44 | 45 | } 46 | 47 | const arg_descriptor arg_help = {"help", "Produce help message"}; 48 | const arg_descriptor arg_version = {"version", "Output version information"}; 49 | const arg_descriptor arg_data_dir = {"data-dir", "Specify data directory"}; 50 | } 51 | -------------------------------------------------------------------------------- /src/common/pod-class.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | // FIXME: Why is this ifdef needed? Hopefully making it struct won't break things. 34 | 35 | /* 36 | #if defined(_MSC_VER) 37 | #define POD_CLASS struct 38 | #else 39 | #define POD_CLASS class 40 | #endif 41 | */ 42 | 43 | #define POD_CLASS struct 44 | -------------------------------------------------------------------------------- /src/crypto/aesb.c: -------------------------------------------------------------------------------- 1 | /* 2 | --------------------------------------------------------------------------- 3 | Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved. 4 | 5 | The redistribution and use of this software (with or without changes) 6 | is allowed without the payment of fees or royalties provided that: 7 | 8 | source code distributions include the above copyright notice, this 9 | list of conditions and the following disclaimer; 10 | 11 | binary distributions include the above copyright notice, this list 12 | of conditions and the following disclaimer in their documentation. 13 | 14 | This software is provided 'as is' with no explicit or implied warranties 15 | in respect of its operation, including, but not limited to, correctness 16 | and fitness for purpose. 17 | --------------------------------------------------------------------------- 18 | Issue Date: 20/12/2007 19 | */ 20 | 21 | #include 22 | 23 | #include "aesb.h" 24 | 25 | #if defined(__cplusplus) 26 | extern "C" 27 | { 28 | #endif 29 | 30 | d_4(uint32_t, t_dec(f,n), sb_data, u0, u1, u2, u3); 31 | 32 | void aesb_pseudo_round(const uint8_t *in, uint8_t *out, uint8_t *expandedKey) 33 | { 34 | uint32_t b0[4], b1[4]; 35 | const uint32_t *kp = (uint32_t *) expandedKey; 36 | state_in(b0, in); 37 | 38 | round(fwd_rnd, b1, b0, kp); 39 | round(fwd_rnd, b0, b1, kp + 1 * N_COLS); 40 | round(fwd_rnd, b1, b0, kp + 2 * N_COLS); 41 | round(fwd_rnd, b0, b1, kp + 3 * N_COLS); 42 | round(fwd_rnd, b1, b0, kp + 4 * N_COLS); 43 | round(fwd_rnd, b0, b1, kp + 5 * N_COLS); 44 | round(fwd_rnd, b1, b0, kp + 6 * N_COLS); 45 | round(fwd_rnd, b0, b1, kp + 7 * N_COLS); 46 | round(fwd_rnd, b1, b0, kp + 8 * N_COLS); 47 | round(fwd_rnd, b0, b1, kp + 9 * N_COLS); 48 | 49 | state_out(out, b0); 50 | } 51 | 52 | 53 | #if defined(__cplusplus) 54 | } 55 | #endif 56 | -------------------------------------------------------------------------------- /src/crypto/hash-extra-blake.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include 32 | #include 33 | 34 | #include "blake256.h" 35 | 36 | void hash_extra_blake(const void *data, size_t length, char *hash) { 37 | blake256_hash((uint8_t*)hash, data, length); 38 | } 39 | -------------------------------------------------------------------------------- /src/crypto/hash-extra-groestl.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include 32 | #include 33 | 34 | #include "groestl.h" 35 | 36 | void hash_extra_groestl(const void *data, size_t length, char *hash) { 37 | groestl(data, length * 8, (uint8_t*)hash); 38 | } 39 | -------------------------------------------------------------------------------- /src/crypto/hash-extra-jh.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include "jh.h" 37 | #include "hash-ops.h" 38 | 39 | void hash_extra_jh(const void *data, size_t length, char *hash) { 40 | int r = jh_hash(HASH_SIZE * 8, data, 8 * length, (uint8_t*)hash); 41 | assert(SUCCESS == r); 42 | } 43 | -------------------------------------------------------------------------------- /src/crypto/hash-extra-skein.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include 32 | #include 33 | 34 | #include "hash-ops.h" 35 | #include "skein.h" 36 | 37 | void hash_extra_skein(const void *data, size_t length, char *hash) { 38 | int r = skein_hash(8 * HASH_SIZE, data, 8 * length, (uint8_t*)hash); 39 | assert(SKEIN_SUCCESS == r); 40 | } 41 | -------------------------------------------------------------------------------- /src/crypto/hash.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #include "hash-ops.h" 36 | #include "keccak.h" 37 | 38 | void hash_permutation(union hash_state *state) { 39 | keccakf((uint64_t*)state, 24); 40 | } 41 | 42 | void hash_process(union hash_state *state, const uint8_t *buf, size_t count) { 43 | keccak1600(buf, count, (uint8_t*)state); 44 | } 45 | 46 | void cn_fast_hash(const void *data, size_t length, char *hash) { 47 | union hash_state state; 48 | hash_process(&state, data, length); 49 | memcpy(hash, &state, HASH_SIZE); 50 | } 51 | -------------------------------------------------------------------------------- /src/crypto/jh.h: -------------------------------------------------------------------------------- 1 | /*This program gives the 64-bit optimized bitslice implementation of JH using ANSI C 2 | 3 | -------------------------------- 4 | Performance 5 | 6 | Microprocessor: Intel CORE 2 processor (Core 2 Duo Mobile T6600 2.2GHz) 7 | Operating System: 64-bit Ubuntu 10.04 (Linux kernel 2.6.32-22-generic) 8 | Speed for long message: 9 | 1) 45.8 cycles/byte compiler: Intel C++ Compiler 11.1 compilation option: icc -O2 10 | 2) 56.8 cycles/byte compiler: gcc 4.4.3 compilation option: gcc -O3 11 | 12 | -------------------------------- 13 | Last Modified: January 16, 2011 14 | */ 15 | #pragma once 16 | 17 | typedef unsigned char BitSequence; 18 | typedef unsigned long long DataLength; 19 | typedef enum {SUCCESS = 0, FAIL = 1, BAD_HASHLEN = 2} HashReturn; 20 | 21 | HashReturn jh_hash(int hashbitlen, const BitSequence *data, DataLength databitlen, BitSequence *hashval); 22 | -------------------------------------------------------------------------------- /src/crypto/keccak.h: -------------------------------------------------------------------------------- 1 | // keccak.h 2 | // 19-Nov-11 Markku-Juhani O. Saarinen 3 | 4 | #ifndef KECCAK_H 5 | #define KECCAK_H 6 | 7 | #include 8 | #include 9 | 10 | #ifndef KECCAK_ROUNDS 11 | #define KECCAK_ROUNDS 24 12 | #endif 13 | 14 | #ifndef ROTL64 15 | #define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y)))) 16 | #endif 17 | 18 | // compute a keccak hash (md) of given byte length from "in" 19 | int keccak(const uint8_t *in, int inlen, uint8_t *md, int mdlen); 20 | 21 | // update the state 22 | void keccakf(uint64_t st[25], int norounds); 23 | 24 | void keccak1600(const uint8_t *in, int inlen, uint8_t *md); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/crypto/oaes_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * OpenAES License 4 | * --------------------------------------------------------------------------- 5 | * Copyright (c) 2012, Nabil S. Al Ramli, www.nalramli.com 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * - 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * 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) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | * --------------------------------------------------------------------------- 29 | */ 30 | 31 | #ifndef _OAES_CONFIG_H 32 | #define _OAES_CONFIG_H 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | //#ifndef OAES_HAVE_ISAAC 39 | //#define OAES_HAVE_ISAAC 1 40 | //#endif // OAES_HAVE_ISAAC 41 | 42 | //#ifndef OAES_DEBUG 43 | //#define OAES_DEBUG 0 44 | //#endif // OAES_DEBUG 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif // _OAES_CONFIG_H 51 | -------------------------------------------------------------------------------- /src/crypto/random.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include 34 | 35 | void generate_random_bytes(size_t n, void *result); 36 | -------------------------------------------------------------------------------- /src/crypto/skein.h: -------------------------------------------------------------------------------- 1 | #ifndef _SKEIN_H_ 2 | #define _SKEIN_H_ 1 3 | /************************************************************************** 4 | ** 5 | ** Interface declarations and internal definitions for Skein hashing. 6 | ** 7 | ** Source code author: Doug Whiting, 2008. 8 | ** 9 | ** This algorithm and source code is released to the public domain. 10 | ** 11 | *************************************************************************** 12 | ** 13 | ** The following compile-time switches may be defined to control some 14 | ** tradeoffs between speed, code size, error checking, and security. 15 | ** 16 | ** The "default" note explains what happens when the switch is not defined. 17 | ** 18 | ** SKEIN_DEBUG -- make callouts from inside Skein code 19 | ** to examine/display intermediate values. 20 | ** [default: no callouts (no overhead)] 21 | ** 22 | ** SKEIN_ERR_CHECK -- how error checking is handled inside Skein 23 | ** code. If not defined, most error checking 24 | ** is disabled (for performance). Otherwise, 25 | ** the switch value is interpreted as: 26 | ** 0: use assert() to flag errors 27 | ** 1: return SKEIN_FAIL to flag errors 28 | ** 29 | ***************************************************************************/ 30 | #include "skein_port.h" /* get platform-specific definitions */ 31 | 32 | typedef enum 33 | { 34 | SKEIN_SUCCESS = 0, /* return codes from Skein calls */ 35 | SKEIN_FAIL = 1, 36 | SKEIN_BAD_HASHLEN = 2 37 | } 38 | HashReturn; 39 | 40 | typedef size_t DataLength; /* bit count type */ 41 | typedef u08b_t BitSequence; /* bit stream type */ 42 | 43 | /* "all-in-one" call */ 44 | HashReturn skein_hash(int hashbitlen, const BitSequence *data, 45 | DataLength databitlen, BitSequence *hashval); 46 | 47 | #endif /* ifndef _SKEIN_H_ */ 48 | -------------------------------------------------------------------------------- /src/cryptonote_core/checkpoints.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | #include 33 | #include "cryptonote_basic_impl.h" 34 | 35 | 36 | namespace cryptonote 37 | { 38 | class checkpoints 39 | { 40 | public: 41 | checkpoints(); 42 | bool add_checkpoint(uint64_t height, const std::string& hash_str); 43 | bool is_in_checkpoint_zone(uint64_t height) const; 44 | bool check_block(uint64_t height, const crypto::hash& h) const; 45 | bool check_block(uint64_t height, const crypto::hash& h, bool& is_a_checkpoint) const; 46 | bool is_alternative_block_allowed(uint64_t blockchain_height, uint64_t block_height) const; 47 | 48 | private: 49 | std::map m_points; 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /src/cryptonote_core/cryptonote_stat_info.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | #include "serialization/keyvalue_serialization.h" 33 | 34 | 35 | namespace cryptonote 36 | { 37 | struct core_stat_info 38 | { 39 | uint64_t tx_pool_size; 40 | uint64_t blockchain_height; 41 | uint64_t mining_speed; 42 | uint64_t alternative_blocks; 43 | std::string top_block_id_str; 44 | 45 | BEGIN_KV_SERIALIZE_MAP() 46 | KV_SERIALIZE(tx_pool_size) 47 | KV_SERIALIZE(blockchain_height) 48 | KV_SERIALIZE(mining_speed) 49 | KV_SERIALIZE(alternative_blocks) 50 | KV_SERIALIZE(top_block_id_str) 51 | END_KV_SERIALIZE_MAP() 52 | }; 53 | } 54 | -------------------------------------------------------------------------------- /src/cryptonote_core/difficulty.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include 34 | #include 35 | 36 | #include "crypto/hash.h" 37 | 38 | namespace cryptonote 39 | { 40 | typedef std::uint64_t difficulty_type; 41 | 42 | bool check_hash(const crypto::hash &hash, difficulty_type difficulty); 43 | // difficulty_type next_difficulty(std::vector timestamps, std::vector cumulative_difficulties); 44 | difficulty_type next_difficulty(std::vector timestamps, std::vector cumulative_difficulties, size_t height); 45 | } 46 | -------------------------------------------------------------------------------- /src/cryptonote_protocol/blobdatatype.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | namespace cryptonote 34 | { 35 | typedef std::string blobdata; 36 | } 37 | -------------------------------------------------------------------------------- /src/miner/target_helper.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | #include "cryptonote_core/difficulty.h" 33 | 34 | 35 | namespace mining 36 | { 37 | inline uint32_t get_target_for_difficulty(cryptonote::difficulty_type difficulty) 38 | { 39 | if(!difficulty) 40 | return 0xffffffff; 41 | return 0xffffffff/static_cast(difficulty); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/p2p/net_peerlist_boost_serialization.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | namespace boost 34 | { 35 | namespace serialization 36 | { 37 | //BOOST_CLASS_VERSION(odetool::net_adress, 1) 38 | template 39 | inline void serialize(Archive &a, nodetool::net_address& na, const ver_type ver) 40 | { 41 | a & na.ip; 42 | a & na.port; 43 | } 44 | 45 | 46 | template 47 | inline void serialize(Archive &a, nodetool::peerlist_entry& pl, const ver_type ver) 48 | { 49 | a & pl.adr; 50 | a & pl.id; 51 | a & pl.last_seen; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/p2p/p2p_networks.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | namespace nodetool 34 | { 35 | const static boost::uuids::uuid MONERO_NETWORK = { {0x32 ,0x32, 0xF3, 0x91 , 0x81, 0x18 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x10} }; //Bender's nightmare 36 | } 37 | -------------------------------------------------------------------------------- /src/p2p/stdafx.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include "targetver.h" 34 | 35 | 36 | #if !defined(__GNUC__) 37 | #define _CRTDBG_MAP_ALLOC 38 | #include 39 | #include 40 | #endif 41 | 42 | 43 | 44 | #include 45 | 46 | 47 | #define BOOST_FILESYSTEM_VERSION 3 48 | #define ENABLE_RELEASE_LOGGING 49 | #include "log_opt_defs.h" 50 | #include "misc_log_ex.h" 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/platform/mingw/alloca.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include 34 | -------------------------------------------------------------------------------- /src/platform/msc/alloca.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #define alloca(size) _alloca(size) 34 | -------------------------------------------------------------------------------- /src/platform/msc/inline_c.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #ifndef __cplusplus 34 | #define inline __inline 35 | #endif 36 | -------------------------------------------------------------------------------- /src/platform/msc/stdbool.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #if !defined(__cplusplus) 34 | 35 | typedef int bool; 36 | #define true 1 37 | #define false 0 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/platform/msc/sys/param.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #define LITTLE_ENDIAN 1234 34 | #define BIG_ENDIAN 4321 35 | #define PDP_ENDIAN 3412 36 | #define BYTE_ORDER LITTLE_ENDIAN 37 | -------------------------------------------------------------------------------- /src/ringct/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016, The Monero Project 2 | # 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without modification, are 6 | # permitted provided that the following conditions are met: 7 | # 8 | # 1. Redistributions of source code must retain the above copyright notice, this list of 9 | # conditions and the following disclaimer. 10 | # 11 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | # of conditions and the following disclaimer in the documentation and/or other 13 | # materials provided with the distribution. 14 | # 15 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | # used to endorse or promote products derived from this software without specific 17 | # prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | set(ringct_sources 30 | rctOps.cpp 31 | rctSigs.cpp 32 | rctTypes.cpp 33 | rctCryptoOps.c) 34 | 35 | set(ringct_headers) 36 | 37 | set(ringct_private_headers 38 | rctOps.h 39 | rctSigs.h 40 | rctTypes.h) 41 | 42 | monero_private_headers(ringct 43 | ${crypto_private_headers}) 44 | monero_add_library(ringct 45 | ${ringct_sources} 46 | ${ringct_headers} 47 | ${ringct_private_headers}) 48 | target_link_libraries(ringct 49 | PUBLIC 50 | common 51 | crypto 52 | cryptonote_basic 53 | PRIVATE 54 | ${EXTRA_LIBRARIES}) 55 | -------------------------------------------------------------------------------- /src/ringct/rctCryptoOps.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2016, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | extern "C" { 34 | #include "crypto/crypto-ops.h" 35 | } 36 | 37 | void sc_reduce32copy(unsigned char * scopy, const unsigned char *s); 38 | -------------------------------------------------------------------------------- /src/rpc/core_rpc_server_error_codes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | 34 | #define CORE_RPC_ERROR_CODE_WRONG_PARAM -1 35 | #define CORE_RPC_ERROR_CODE_TOO_BIG_HEIGHT -2 36 | #define CORE_RPC_ERROR_CODE_TOO_BIG_RESERVE_SIZE -3 37 | #define CORE_RPC_ERROR_CODE_WRONG_WALLET_ADDRESS -4 38 | #define CORE_RPC_ERROR_CODE_INTERNAL_ERROR -5 39 | #define CORE_RPC_ERROR_CODE_WRONG_BLOCKBLOB -6 40 | #define CORE_RPC_ERROR_CODE_BLOCK_NOT_ACCEPTED -7 41 | #define CORE_RPC_ERROR_CODE_CORE_BUSY -9 42 | #define CORE_RPC_ERROR_CODE_WRONG_BLOCKBLOB_SIZE -10 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/serialization/binary_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include 34 | #include "binary_archive.h" 35 | 36 | namespace serialization { 37 | 38 | template 39 | bool parse_binary(const std::string &blob, T &v) 40 | { 41 | std::istringstream istr(blob); 42 | binary_archive iar(istr); 43 | return ::serialization::serialize(iar, v); 44 | } 45 | 46 | template 47 | bool dump_binary(T& v, std::string& blob) 48 | { 49 | std::stringstream ostr; 50 | binary_archive oar(ostr); 51 | bool success = ::serialization::serialize(oar, v); 52 | blob = ostr.str(); 53 | return success && ostr.good(); 54 | }; 55 | 56 | } // namespace serialization 57 | -------------------------------------------------------------------------------- /src/serialization/json_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include 34 | #include "json_archive.h" 35 | 36 | namespace serialization { 37 | 38 | template 39 | std::string dump_json(T &v) 40 | { 41 | std::stringstream ostr; 42 | json_archive oar(ostr); 43 | assert(serialization::serialize(oar, v)); 44 | return ostr.str(); 45 | }; 46 | 47 | } // namespace serialization 48 | -------------------------------------------------------------------------------- /src/version.cmake: -------------------------------------------------------------------------------- 1 | execute_process(COMMAND "${GIT}" describe --dirty --match "v${VERSION}" RESULT_VARIABLE RET OUTPUT_VARIABLE DESCRIPTION OUTPUT_STRIP_TRAILING_WHITESPACE) 2 | if(RET) 3 | message(WARNING "Cannot determine current revision. Make sure that you are building either from a Git working tree or from a source archive.") 4 | set(VERSION "${COMMIT}") 5 | configure_file("src/version.h.in" "${TO}") 6 | else() 7 | string(REGEX MATCH "([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])?(-dirty)? $" COMMIT "${DESCRIPTION} ") 8 | string(STRIP "${COMMIT}" COMMIT) 9 | set(VERSION "${COMMIT}") 10 | configure_file("src/version.h.in" "${TO}") 11 | endif() -------------------------------------------------------------------------------- /src/version.h.in: -------------------------------------------------------------------------------- 1 | #define BUILD_COMMIT_ID "@VERSION@" 2 | #define PROJECT_VERSION "0.9.14" 3 | #define PROJECT_VERSION_BUILD_NO "0" 4 | #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")" 5 | -------------------------------------------------------------------------------- /src/wallet/wallet_rpc_server_error_codes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | 34 | #define WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR -1 35 | #define WALLET_RPC_ERROR_CODE_WRONG_ADDRESS -2 36 | #define WALLET_RPC_ERROR_CODE_DAEMON_IS_BUSY -3 37 | #define WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR -4 38 | #define WALLET_RPC_ERROR_CODE_WRONG_PAYMENT_ID -5 39 | #define WALLET_RPC_ERROR_CODE_TRANSFER_TYPE -6 40 | -------------------------------------------------------------------------------- /tests/core_tests/transaction_tests.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | 34 | 35 | bool test_transactions(); 36 | bool test_block_creation(); 37 | -------------------------------------------------------------------------------- /tests/crypto/crypto-ops-data.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include "crypto/crypto-ops-data.c" 32 | -------------------------------------------------------------------------------- /tests/crypto/crypto-ops.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include "crypto/crypto-ops.c" 32 | -------------------------------------------------------------------------------- /tests/crypto/crypto-tests.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #if defined(__cplusplus) 34 | #include "crypto/crypto.h" 35 | 36 | extern "C" { 37 | #endif 38 | 39 | void setup_random(void); 40 | 41 | #if defined(__cplusplus) 42 | } 43 | 44 | bool check_scalar(const crypto::ec_scalar &scalar); 45 | void random_scalar(crypto::ec_scalar &res); 46 | void hash_to_scalar(const void *data, std::size_t length, crypto::ec_scalar &res); 47 | void hash_to_point(const crypto::hash &h, crypto::ec_point &res); 48 | void hash_to_ec(const crypto::public_key &key, crypto::ec_point &res); 49 | #endif 50 | -------------------------------------------------------------------------------- /tests/crypto/hash.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include "crypto/hash.c" 32 | #include "crypto/keccak.c" 33 | -------------------------------------------------------------------------------- /tests/crypto/random.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include "crypto/random.c" 32 | 33 | #include "crypto-tests.h" 34 | 35 | void setup_random(void) { 36 | memset(&state, 42, sizeof(union hash_state)); 37 | } 38 | -------------------------------------------------------------------------------- /tests/daemon_tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(transfers transfers.cpp) 2 | target_link_libraries(transfers useragent rpc cryptonote_core crypto common epee gtest_main ${Boost_LIBRARIES}) 3 | 4 | file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test_transfers) 5 | add_custom_target(test_transfers COMMAND transfers WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test_transfers) 6 | -------------------------------------------------------------------------------- /tests/data/account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/tests/data/account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb -------------------------------------------------------------------------------- /tests/data/account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/tests/data/account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f -------------------------------------------------------------------------------- /tests/data/account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/tests/data/account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486 -------------------------------------------------------------------------------- /tests/data/account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aeonix/aeon-legacy/17ee55f32a1b149585c7f51740940a8de973dd66/tests/data/account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe -------------------------------------------------------------------------------- /tests/functional_tests/transactions_flow_test.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | bool transactions_flow_test(std::string& working_folder, 32 | std::string path_source_wallet, 33 | std::string path_terget_wallet, 34 | std::string& daemon_addr_a, 35 | std::string& daemon_addr_b, 36 | uint64_t amount_to_transfer, size_t mix_in_factor, size_t transactions_count, size_t transactions_per_second); 37 | -------------------------------------------------------------------------------- /tests/functional_tests/transactions_generation_from_blockchain.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | bool transactions_generation_from_blockchain(std::string& blockchain_path); 32 | -------------------------------------------------------------------------------- /tests/gtest/src/gtest-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 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 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: mheule@google.com (Markus Heule) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Sometimes it's desirable to build Google Test by compiling a single file. 35 | // This file serves this purpose. 36 | 37 | // This line ensures that gtest.h can be compiled on its own, even 38 | // when it's fused. 39 | #include "gtest/gtest.h" 40 | 41 | // The following lines pull in the real gtest *.cc files. 42 | #include "src/gtest.cc" 43 | #include "src/gtest-death-test.cc" 44 | #include "src/gtest-filepath.cc" 45 | #include "src/gtest-port.cc" 46 | #include "src/gtest-printers.cc" 47 | #include "src/gtest-test-part.cc" 48 | #include "src/gtest-typed-test.cc" 49 | -------------------------------------------------------------------------------- /tests/gtest/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 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 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | std::cout << "Running main() from gtest_main.cc\n"; 36 | 37 | testing::InitGoogleTest(&argc, argv); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /tests/hash/tests-slow-2m.txt: -------------------------------------------------------------------------------- 1 | 2f8e3df40bd11f9ac90c743ca8e32bb391da4fb98612aa3b6cdc639ee00b31f5 6465206f6d6e69627573206475626974616e64756d 2 | 722fa8ccd594d40e4a41f3822734304c8d5eff7e1b528408e2229da38ba553c4 6162756e64616e732063617574656c61206e6f6e206e6f636574 3 | bbec2cacf69866a8e740380fe7b818fc78f8571221742d729d9d02d7f8989b87 63617665617420656d70746f72 4 | b1257de4efc5ce28c6b40ceb1c6c8f812a64634eb3e81c5220bee9b2b76a6f05 6578206e6968696c6f206e6968696c20666974 5 | -------------------------------------------------------------------------------- /tests/performance_tests/generate_key_derivation.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include "crypto/crypto.h" 34 | #include "cryptonote_core/cryptonote_basic.h" 35 | 36 | #include "single_tx_test_base.h" 37 | 38 | class test_generate_key_derivation : public single_tx_test_base 39 | { 40 | public: 41 | static const size_t loop_count = 1000; 42 | 43 | bool test() 44 | { 45 | crypto::key_derivation recv_derivation; 46 | crypto::generate_key_derivation(m_tx_pub_key, m_bob.get_keys().m_view_secret_key, recv_derivation); 47 | return true; 48 | } 49 | }; 50 | -------------------------------------------------------------------------------- /tests/performance_tests/generate_key_image_helper.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include "cryptonote_core/account.h" 34 | #include "cryptonote_core/cryptonote_basic.h" 35 | #include "cryptonote_core/cryptonote_format_utils.h" 36 | 37 | #include "single_tx_test_base.h" 38 | 39 | class test_generate_key_image_helper : public single_tx_test_base 40 | { 41 | public: 42 | static const size_t loop_count = 500; 43 | 44 | bool test() 45 | { 46 | cryptonote::keypair in_ephemeral; 47 | crypto::key_image ki; 48 | return cryptonote::generate_key_image_helper(m_bob.get_keys(), m_tx_pub_key, 0, in_ephemeral, ki); 49 | } 50 | }; 51 | -------------------------------------------------------------------------------- /tests/performance_tests/is_out_to_acc.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include "cryptonote_core/account.h" 34 | #include "cryptonote_core/cryptonote_basic.h" 35 | #include "cryptonote_core/cryptonote_format_utils.h" 36 | 37 | #include "single_tx_test_base.h" 38 | 39 | class test_is_out_to_acc : public single_tx_test_base 40 | { 41 | public: 42 | static const size_t loop_count = 1000; 43 | 44 | bool test() 45 | { 46 | const cryptonote::txout_to_key& tx_out = boost::get(m_tx.vout[0].target); 47 | return cryptonote::is_out_to_acc(m_bob.get_keys(), tx_out, m_tx_pub_key, 0); 48 | } 49 | }; 50 | -------------------------------------------------------------------------------- /tests/unit_tests/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, AEON, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include "gtest/gtest.h" 32 | 33 | #include "include_base_utils.h" 34 | 35 | int main(int argc, char** argv) 36 | { 37 | epee::debug::get_set_enable_assert(true, false); 38 | 39 | ::testing::InitGoogleTest(&argc, argv); 40 | return RUN_ALL_TESTS(); 41 | } 42 | -------------------------------------------------------------------------------- /utils/.gitignore: -------------------------------------------------------------------------------- 1 | /.idea -------------------------------------------------------------------------------- /utils/munin_plugins/alt_blocks_count: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014, AEON, The Monero Project 4 | # 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without modification, are 8 | # permitted provided that the following conditions are met: 9 | # 10 | # 1. Redistributions of source code must retain the above copyright notice, this list of 11 | # conditions and the following disclaimer. 12 | # 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 14 | # of conditions and the following disclaimer in the documentation and/or other 15 | # materials provided with the distribution. 16 | # 17 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 18 | # used to endorse or promote products derived from this software without specific 19 | # prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 22 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 24 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 29 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 32 | 33 | case $1 in 34 | config) 35 | cat <<'EOM' 36 | graph_title alt_blocks_count 37 | graph_vlabel alt_blocks_count 38 | graph_category monero 39 | alt_blocks_count.label alt_blocks_count 40 | EOM 41 | exit 0;; 42 | esac 43 | 44 | printf "alt_blocks_count.value " 45 | /home/user/bitmonero/build/release/src/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep alt_blocks_count | cut -d ' ' -f2 46 | -------------------------------------------------------------------------------- /utils/munin_plugins/difficulty: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014, AEON, The Monero Project 4 | # 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without modification, are 8 | # permitted provided that the following conditions are met: 9 | # 10 | # 1. Redistributions of source code must retain the above copyright notice, this list of 11 | # conditions and the following disclaimer. 12 | # 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 14 | # of conditions and the following disclaimer in the documentation and/or other 15 | # materials provided with the distribution. 16 | # 17 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 18 | # used to endorse or promote products derived from this software without specific 19 | # prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 22 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 24 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 29 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 32 | 33 | case $1 in 34 | config) 35 | cat <<'EOM' 36 | graph_title difficulty 37 | graph_vlabel difficulty 38 | graph_category monero 39 | difficulty.label difficulty 40 | EOM 41 | exit 0;; 42 | esac 43 | 44 | printf "difficulty.value " 45 | /home/user/bitmonero/build/release/src/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep difficulty | cut -d ' ' -f2 46 | -------------------------------------------------------------------------------- /utils/munin_plugins/grey_peerlist_size: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014, AEON, The Monero Project 4 | # 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without modification, are 8 | # permitted provided that the following conditions are met: 9 | # 10 | # 1. Redistributions of source code must retain the above copyright notice, this list of 11 | # conditions and the following disclaimer. 12 | # 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 14 | # of conditions and the following disclaimer in the documentation and/or other 15 | # materials provided with the distribution. 16 | # 17 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 18 | # used to endorse or promote products derived from this software without specific 19 | # prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 22 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 24 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 29 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 32 | 33 | case $1 in 34 | config) 35 | cat <<'EOM' 36 | graph_title grey_peerlist_size 37 | graph_vlabel grey_peerlist_size 38 | graph_category monero 39 | grey_peerlist_size.label grey_peerlist_size 40 | EOM 41 | exit 0;; 42 | esac 43 | 44 | printf "grey_peerlist_size.value " 45 | /home/user/bitmonero/build/release/src/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep grey_peerlist_size | cut -d ' ' -f2 46 | -------------------------------------------------------------------------------- /utils/munin_plugins/height: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014, AEON, The Monero Project 4 | # 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without modification, are 8 | # permitted provided that the following conditions are met: 9 | # 10 | # 1. Redistributions of source code must retain the above copyright notice, this list of 11 | # conditions and the following disclaimer. 12 | # 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 14 | # of conditions and the following disclaimer in the documentation and/or other 15 | # materials provided with the distribution. 16 | # 17 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 18 | # used to endorse or promote products derived from this software without specific 19 | # prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 22 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 24 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 29 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 32 | 33 | case $1 in 34 | config) 35 | cat <<'EOM' 36 | graph_title Height 37 | graph_vlabel height 38 | graph_category monero 39 | height.label height 40 | height.type COUNTER 41 | EOM 42 | exit 0;; 43 | esac 44 | 45 | printf "height.value " 46 | /home/user/bitmonero/build/release/src/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep height | cut -d ' ' -f2 47 | -------------------------------------------------------------------------------- /utils/munin_plugins/incoming_connections_count: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014, AEON, The Monero Project 4 | # 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without modification, are 8 | # permitted provided that the following conditions are met: 9 | # 10 | # 1. Redistributions of source code must retain the above copyright notice, this list of 11 | # conditions and the following disclaimer. 12 | # 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 14 | # of conditions and the following disclaimer in the documentation and/or other 15 | # materials provided with the distribution. 16 | # 17 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 18 | # used to endorse or promote products derived from this software without specific 19 | # prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 22 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 24 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 29 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 32 | 33 | case $1 in 34 | config) 35 | cat <<'EOM' 36 | graph_title incoming_connections_count 37 | graph_vlabel incoming_connections_count 38 | graph_category monero 39 | incoming_connections_count.label incoming_connections_count 40 | EOM 41 | exit 0;; 42 | esac 43 | 44 | printf "incoming_connections_count.value " 45 | /home/user/bitmonero/build/release/src/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep incoming_connections_count | cut -d ' ' -f2 46 | -------------------------------------------------------------------------------- /utils/munin_plugins/outgoing_connections_count: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014, AEON, The Monero Project 4 | # 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without modification, are 8 | # permitted provided that the following conditions are met: 9 | # 10 | # 1. Redistributions of source code must retain the above copyright notice, this list of 11 | # conditions and the following disclaimer. 12 | # 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 14 | # of conditions and the following disclaimer in the documentation and/or other 15 | # materials provided with the distribution. 16 | # 17 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 18 | # used to endorse or promote products derived from this software without specific 19 | # prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 22 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 24 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 29 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 32 | 33 | case $1 in 34 | config) 35 | cat <<'EOM' 36 | graph_title outgoing_connections_count 37 | graph_vlabel outgoing_connections_count 38 | graph_category monero 39 | outgoing_connections_count.label outgoing_connections_count 40 | EOM 41 | exit 0;; 42 | esac 43 | 44 | printf "outgoing_connections_count.value " 45 | /home/user/bitmonero/build/release/src/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep outgoing_connections_count | cut -d ' ' -f2 46 | -------------------------------------------------------------------------------- /utils/munin_plugins/tx_count: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014, AEON, The Monero Project 4 | # 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without modification, are 8 | # permitted provided that the following conditions are met: 9 | # 10 | # 1. Redistributions of source code must retain the above copyright notice, this list of 11 | # conditions and the following disclaimer. 12 | # 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 14 | # of conditions and the following disclaimer in the documentation and/or other 15 | # materials provided with the distribution. 16 | # 17 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 18 | # used to endorse or promote products derived from this software without specific 19 | # prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 22 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 24 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 29 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 32 | 33 | case $1 in 34 | config) 35 | cat <<'EOM' 36 | graph_title tx_count 37 | graph_vlabel tx_count 38 | graph_category monero 39 | tx_count.label tx_count 40 | tx_count.type COUNTER 41 | EOM 42 | exit 0;; 43 | esac 44 | 45 | printf "tx_count.value " 46 | /home/user/bitmonero/build/release/src/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep tx_count| cut -d ' ' -f2 47 | -------------------------------------------------------------------------------- /utils/munin_plugins/tx_pool_size: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014, AEON, The Monero Project 4 | # 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without modification, are 8 | # permitted provided that the following conditions are met: 9 | # 10 | # 1. Redistributions of source code must retain the above copyright notice, this list of 11 | # conditions and the following disclaimer. 12 | # 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 14 | # of conditions and the following disclaimer in the documentation and/or other 15 | # materials provided with the distribution. 16 | # 17 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 18 | # used to endorse or promote products derived from this software without specific 19 | # prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 22 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 24 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 29 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 32 | 33 | case $1 in 34 | config) 35 | cat <<'EOM' 36 | graph_title tx_pool_size 37 | graph_vlabel tx_pool_size 38 | graph_category monero 39 | tx_pool_size.label tx_pool_size 40 | EOM 41 | exit 0;; 42 | esac 43 | 44 | printf "tx_pool_size.value " 45 | /home/user/bitmonero/build/release/src/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep tx_pool_size| cut -d ' ' -f2 46 | -------------------------------------------------------------------------------- /utils/munin_plugins/white_peerlist_size: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014, AEON, The Monero Project 4 | # 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without modification, are 8 | # permitted provided that the following conditions are met: 9 | # 10 | # 1. Redistributions of source code must retain the above copyright notice, this list of 11 | # conditions and the following disclaimer. 12 | # 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, this list 14 | # of conditions and the following disclaimer in the documentation and/or other 15 | # materials provided with the distribution. 16 | # 17 | # 3. Neither the name of the copyright holder nor the names of its contributors may be 18 | # used to endorse or promote products derived from this software without specific 19 | # prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 22 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 24 | # THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 29 | # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 32 | 33 | case $1 in 34 | config) 35 | cat <<'EOM' 36 | graph_title white_peerlist_size 37 | graph_vlabel white_peerlist_size 38 | graph_category monero 39 | white_peerlist_size.label white_peerlist_size 40 | EOM 41 | exit 0;; 42 | esac 43 | 44 | printf "white_peerlist_size.value " 45 | /home/user/bitmonero/build/release/src/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep white_peerlist_size | cut -d ' ' -f2 46 | -------------------------------------------------------------------------------- /utils/test-static-assert.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static_assert(1, "FAIL"); 4 | int main(int argc, char *argv[]) { 5 | return 0; 6 | } --------------------------------------------------------------------------------