├── .github └── workflows │ └── ci.yml ├── .gitignore ├── CMakeLists.linux.txt ├── CMakeLists.macosM1.txt ├── CMakeLists.txt ├── CTestCustom.cmake ├── LICENSE.md ├── Makefile ├── README.md ├── checkpoints.csv ├── external ├── CMakeLists.txt ├── README.md ├── google │ ├── README.md │ ├── dense_hash_map │ ├── dense_hash_set │ ├── sparse_hash_map │ ├── sparse_hash_set │ ├── sparsehash │ │ ├── README.md │ │ ├── densehashtable.h │ │ ├── hashtable-common.h │ │ ├── libc_allocator_with_realloc.h │ │ ├── os_config.h │ │ ├── sparseconfig.h │ │ ├── sparseconfig_win.h │ │ └── sparsehashtable.h │ ├── sparsetable │ └── type_traits.h ├── gtest │ ├── CMakeLists.txt │ └── README.md ├── linenoise │ ├── README.md │ └── linenoise.hpp └── miniupnpc │ ├── CMakeLists.txt │ ├── Changelog.txt │ ├── LICENSE │ ├── MANIFEST.in │ ├── Makefile │ ├── Makefile.mingw │ ├── README │ ├── README.md │ ├── VERSION │ ├── addr_is_reserved.c │ ├── addr_is_reserved.h │ ├── 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-config.cmake │ ├── miniupnpc.c │ ├── miniupnpc.def │ ├── miniupnpc.h │ ├── miniupnpc.rc │ ├── miniupnpc_declspec.h │ ├── miniupnpc_socketdef.h │ ├── miniupnpcmodule.c │ ├── miniupnpcstrings.h.cmake │ ├── miniupnpcstrings.h.in │ ├── miniupnpctypes.h │ ├── miniwget.c │ ├── miniwget.h │ ├── miniwget_private.h │ ├── minixml.c │ ├── minixml.h │ ├── minixmlvalid.c │ ├── msvc │ ├── genminiupnpcstrings.vbs │ ├── miniupnpc.sln │ ├── miniupnpc.vcproj │ ├── miniupnpc.vcxproj │ ├── miniupnpc.vcxproj.filters │ ├── miniupnpc_vs2010.sln │ ├── miniupnpc_vs2010.vcxproj │ ├── miniupnpc_vs2010.vcxproj.filters │ ├── miniupnpc_vs2015.sln │ ├── upnpc-static.vcproj │ ├── upnpc-static.vcxproj │ ├── upnpc-static.vcxproj.filters │ └── upnpc-static_vs2010.vcxproj │ ├── portlistingparse.c │ ├── portlistingparse.h │ ├── pymoduletest.py │ ├── receivedata.c │ ├── receivedata.h │ ├── setup.py │ ├── setupmingw32.py │ ├── testaddr_is_reserved.c │ ├── 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 │ ├── win32_snprintf.h │ └── wingenminiupnpcstrings.c ├── include ├── BlockchainExplorerData.h ├── BlockchainExplorerData2.h ├── CryptoTypes.h ├── DynexCN.h ├── IBlockchainExplorer.h ├── INode.h ├── IObservable.h ├── IStreamSerializable.h ├── ITransaction.h ├── ITransfersContainer.h ├── ITransfersSynchronizer.h ├── IWallet.h ├── IWalletLegacy.h └── android.h ├── src ├── BlockchainExplorer │ ├── BlockchainExplorer.cpp │ ├── BlockchainExplorer.h │ ├── BlockchainExplorerDataBuilder.cpp │ ├── BlockchainExplorerDataBuilder.h │ ├── BlockchainExplorerErrors.cpp │ └── BlockchainExplorerErrors.h ├── CMakeLists.txt ├── CheckpointsData.h ├── Common │ ├── ArrayRef.h │ ├── ArrayView.h │ ├── Base58.cpp │ ├── Base58.h │ ├── Base64.cpp │ ├── Base64.h │ ├── BlockingQueue.cpp │ ├── BlockingQueue.h │ ├── CommandLine.cpp │ ├── CommandLine.h │ ├── ConsoleHandler.cpp │ ├── ConsoleHandler.h │ ├── ConsoleTools.cpp │ ├── ConsoleTools.h │ ├── DnsTools.cpp │ ├── DnsTools.h │ ├── FileMappedVector.cpp │ ├── FileMappedVector.h │ ├── FormatTools.cpp │ ├── FormatTools.h │ ├── IInputStream.cpp │ ├── IInputStream.h │ ├── IOutputStream.cpp │ ├── IOutputStream.h │ ├── JsonValue.cpp │ ├── JsonValue.h │ ├── Lazy.h │ ├── Math.cpp │ ├── Math.h │ ├── MemoryInputStream.cpp │ ├── MemoryInputStream.h │ ├── ObserverManager.h │ ├── PasswordContainer.cpp │ ├── PasswordContainer.h │ ├── PathTools.cpp │ ├── PathTools.h │ ├── ScopeExit.cpp │ ├── ScopeExit.h │ ├── ShuffleGenerator.h │ ├── SignalHandler.cpp │ ├── SignalHandler.h │ ├── StdInputStream.cpp │ ├── StdInputStream.h │ ├── StdOutputStream.cpp │ ├── StdOutputStream.h │ ├── StreamTools.cpp │ ├── StreamTools.h │ ├── StringBuffer.h │ ├── StringInputStream.cpp │ ├── StringInputStream.h │ ├── StringOutputStream.cpp │ ├── StringOutputStream.h │ ├── StringTools.cpp │ ├── StringTools.h │ ├── StringView.cpp │ ├── StringView.h │ ├── UrlTools.cpp │ ├── UrlTools.h │ ├── Util.cpp │ ├── Util.h │ ├── Varint.h │ ├── VectorOutputStream.cpp │ ├── VectorOutputStream.h │ ├── int-util.h │ ├── pod-class.h │ └── static_assert.h ├── ConnectivityTool │ └── ConnectivityTool.cpp ├── Daemon │ ├── Daemon.cpp │ ├── DaemonCommandsHandler.cpp │ └── DaemonCommandsHandler.h ├── DynexCNConfig.h ├── DynexCNCore │ ├── Account.cpp │ ├── Account.h │ ├── Auth.cpp │ ├── Auth.h │ ├── BlockIndex.cpp │ ├── BlockIndex.h │ ├── Blockchain.cpp │ ├── Blockchain.h │ ├── BlockchainIndices.cpp │ ├── BlockchainIndices.h │ ├── BlockchainMessages.cpp │ ├── BlockchainMessages.h │ ├── Checkpoints.cpp │ ├── Checkpoints.h │ ├── Core.cpp │ ├── Core.h │ ├── CoreConfig.cpp │ ├── CoreConfig.h │ ├── Currency.cpp │ ├── Currency.h │ ├── Difficulty.cpp │ ├── Difficulty.h │ ├── DynexCNBasic.cpp │ ├── DynexCNBasic.h │ ├── DynexCNBasicImpl.cpp │ ├── DynexCNBasicImpl.h │ ├── DynexCNFormatUtils.cpp │ ├── DynexCNFormatUtils.h │ ├── DynexCNSerialization.cpp │ ├── DynexCNSerialization.h │ ├── DynexCNStatInfo.h │ ├── DynexCNTools.cpp │ ├── DynexCNTools.h │ ├── IBlock.cpp │ ├── IBlock.h │ ├── IBlockHandler.h │ ├── IBlockchainStorageObserver.h │ ├── ICore.h │ ├── ICoreObserver.h │ ├── ITimeProvider.cpp │ ├── ITimeProvider.h │ ├── ITransactionValidator.h │ ├── ITxPoolObserver.h │ ├── IntrusiveLinkedList.h │ ├── MessageQueue.h │ ├── OnceInInterval.h │ ├── README.MD │ ├── SwappedMap.cpp │ ├── SwappedMap.h │ ├── SwappedVector.cpp │ ├── SwappedVector.h │ ├── Transaction.cpp │ ├── TransactionApi.h │ ├── TransactionApiExtra.h │ ├── TransactionExtra.cpp │ ├── TransactionExtra.h │ ├── TransactionPool.cpp │ ├── TransactionPool.h │ ├── TransactionPrefixImpl.cpp │ ├── TransactionUtils.cpp │ ├── TransactionUtils.h │ ├── UpgradeDetector.cpp │ ├── UpgradeDetector.h │ └── VerificationContext.h ├── DynexCNProtocol │ ├── DynexCNProtocolDefinitions.h │ ├── DynexCNProtocolHandler.cpp │ ├── DynexCNProtocolHandler.h │ ├── DynexCNProtocolHandlerCommon.h │ ├── IDynexCNProtocolObserver.h │ ├── IDynexCNProtocolQuery.h │ └── README.MD ├── GreenWallet │ ├── AddressBook.cpp │ ├── AddressBook.h │ ├── ColouredMsg.h │ ├── CommandDispatcher.cpp │ ├── CommandDispatcher.h │ ├── CommandImplementations.cpp │ ├── CommandImplementations.h │ ├── Commands.cpp │ ├── Commands.h │ ├── Fusion.cpp │ ├── Fusion.h │ ├── GetInput.cpp │ ├── GetInput.h │ ├── Menu.cpp │ ├── Menu.h │ ├── Open.cpp │ ├── Open.h │ ├── ParseArguments.cpp │ ├── ParseArguments.h │ ├── README.md │ ├── Sync.cpp │ ├── Sync.h │ ├── Tools.cpp │ ├── Tools.h │ ├── Transfer.cpp │ ├── Transfer.h │ ├── Types.h │ ├── WalletConfig.h │ ├── ZedWallet.cpp │ ├── ZedWallet.h │ └── linenoise.hpp ├── HTTP │ ├── HttpParser.cpp │ ├── HttpParser.h │ ├── HttpParserErrorCodes.cpp │ ├── HttpParserErrorCodes.h │ ├── HttpRequest.cpp │ ├── HttpRequest.h │ ├── HttpResponse.cpp │ └── HttpResponse.h ├── InProcessNode │ ├── InProcessNode.cpp │ ├── InProcessNode.h │ ├── InProcessNodeErrors.cpp │ └── InProcessNodeErrors.h ├── JsonRpcServer │ ├── JsonRpcServer.cpp │ └── JsonRpcServer.h ├── Logging │ ├── CommonLogger.cpp │ ├── CommonLogger.h │ ├── ConsoleLogger.cpp │ ├── ConsoleLogger.h │ ├── FileLogger.cpp │ ├── FileLogger.h │ ├── ILogger.cpp │ ├── ILogger.h │ ├── LoggerGroup.cpp │ ├── LoggerGroup.h │ ├── LoggerManager.cpp │ ├── LoggerManager.h │ ├── LoggerMessage.cpp │ ├── LoggerMessage.h │ ├── LoggerRef.cpp │ ├── LoggerRef.h │ ├── StreamLogger.cpp │ └── StreamLogger.h ├── Mnemonics │ ├── README.md │ ├── chinese_simplified.h │ ├── dutch.h │ ├── electrum-words.cpp │ ├── electrum-words.h │ ├── english.h │ ├── english_old.h │ ├── esperanto.h │ ├── french.h │ ├── german.h │ ├── italian.h │ ├── japanese.h │ ├── language_base.h │ ├── lojban.h │ ├── polish.h │ ├── portuguese.h │ ├── russian.h │ ├── singleton.h │ ├── spanish.h │ └── ukrainian.h ├── NodeRpcProxy │ ├── NodeErrors.cpp │ ├── NodeErrors.h │ ├── NodeRpcProxy.cpp │ └── NodeRpcProxy.h ├── Optimizer │ ├── Optimizer.cpp │ └── README.md ├── P2p │ ├── ConnectionContext.h │ ├── IP2pNodeInternal.cpp │ ├── IP2pNodeInternal.h │ ├── LevinProtocol.cpp │ ├── LevinProtocol.h │ ├── NetNode.cpp │ ├── NetNode.h │ ├── NetNodeCommon.h │ ├── NetNodeConfig.cpp │ ├── NetNodeConfig.h │ ├── P2pConnectionProxy.cpp │ ├── P2pConnectionProxy.h │ ├── P2pContext.cpp │ ├── P2pContext.h │ ├── P2pContextOwner.cpp │ ├── P2pContextOwner.h │ ├── P2pInterfaces.cpp │ ├── P2pInterfaces.h │ ├── P2pNetworks.h │ ├── P2pNode.cpp │ ├── P2pNode.h │ ├── P2pNodeConfig.cpp │ ├── P2pNodeConfig.h │ ├── P2pProtocolDefinitions.h │ ├── P2pProtocolTypes.h │ ├── PeerListManager.cpp │ └── PeerListManager.h ├── PaymentGate │ ├── NodeFactory.cpp │ ├── NodeFactory.h │ ├── PaymentServiceJsonRpcMessages.cpp │ ├── PaymentServiceJsonRpcMessages.h │ ├── PaymentServiceJsonRpcServer.cpp │ ├── PaymentServiceJsonRpcServer.h │ ├── WalletService.cpp │ ├── WalletService.h │ ├── WalletServiceErrorCategory.cpp │ └── WalletServiceErrorCategory.h ├── PaymentGateService │ ├── ConfigurationManager.cpp │ ├── ConfigurationManager.h │ ├── PaymentGateService.cpp │ ├── PaymentGateService.h │ ├── PaymentServiceConfiguration.cpp │ ├── PaymentServiceConfiguration.h │ ├── RpcNodeConfiguration.cpp │ ├── RpcNodeConfiguration.h │ └── main.cpp ├── Platform │ ├── FreeBSD │ │ └── System │ │ │ ├── Context.c │ │ │ ├── Context.h │ │ │ ├── Dispatcher.cpp │ │ │ ├── Dispatcher.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── ErrorMessage.h │ │ │ ├── Future.h │ │ │ ├── Ipv4Resolver.cpp │ │ │ ├── Ipv4Resolver.h │ │ │ ├── README.md │ │ │ ├── TcpConnection.cpp │ │ │ ├── TcpConnection.h │ │ │ ├── TcpConnector.cpp │ │ │ ├── TcpConnector.h │ │ │ ├── TcpListener.cpp │ │ │ ├── TcpListener.h │ │ │ ├── Timer.cpp │ │ │ ├── Timer.h │ │ │ └── asm.s │ ├── Linux │ │ └── System │ │ │ ├── Dispatcher.cpp │ │ │ ├── Dispatcher.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── ErrorMessage.h │ │ │ ├── Future.h │ │ │ ├── Ipv4Resolver.cpp │ │ │ ├── Ipv4Resolver.h │ │ │ ├── TcpConnection.cpp │ │ │ ├── TcpConnection.h │ │ │ ├── TcpConnector.cpp │ │ │ ├── TcpConnector.h │ │ │ ├── TcpListener.cpp │ │ │ ├── TcpListener.h │ │ │ ├── Timer.cpp │ │ │ └── Timer.h │ ├── OSX │ │ └── System │ │ │ ├── Dispatcher.cpp │ │ │ ├── Dispatcher.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── ErrorMessage.h │ │ │ ├── Future.h │ │ │ ├── Ipv4Resolver.cpp │ │ │ ├── Ipv4Resolver.h │ │ │ ├── TcpConnection.cpp │ │ │ ├── TcpConnection.h │ │ │ ├── TcpConnector.cpp │ │ │ ├── TcpConnector.h │ │ │ ├── TcpListener.cpp │ │ │ ├── TcpListener.h │ │ │ ├── Timer.cpp │ │ │ └── Timer.h │ ├── Posix │ │ └── System │ │ │ ├── MemoryMappedFile.cpp │ │ │ ├── MemoryMappedFile.h │ │ │ └── README.md │ ├── Windows │ │ └── System │ │ │ ├── Dispatcher.cpp │ │ │ ├── Dispatcher.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── ErrorMessage.h │ │ │ ├── Future.h │ │ │ ├── Ipv4Resolver.cpp │ │ │ ├── Ipv4Resolver.h │ │ │ ├── MemoryMappedFile.cpp │ │ │ ├── MemoryMappedFile.h │ │ │ ├── TcpConnection.cpp │ │ │ ├── TcpConnection.h │ │ │ ├── TcpConnector.cpp │ │ │ ├── TcpConnector.h │ │ │ ├── TcpListener.cpp │ │ │ ├── TcpListener.h │ │ │ ├── Timer.cpp │ │ │ └── Timer.h │ ├── mingw │ │ └── alloca.h │ └── msc │ │ ├── alloca.h │ │ ├── stdbool.h │ │ └── sys │ │ └── param.h ├── README.md ├── Rpc │ ├── CoreRpcServerCommandsDefinitions.h │ ├── CoreRpcServerErrorCodes.h │ ├── HttpClient.cpp │ ├── HttpClient.h │ ├── HttpServer.cpp │ ├── HttpServer.h │ ├── JsonRpc.cpp │ ├── JsonRpc.h │ ├── RpcServer.cpp │ ├── RpcServer.h │ ├── RpcServerConfig.cpp │ └── RpcServerConfig.h ├── Serialization │ ├── BinaryInputStreamSerializer.cpp │ ├── BinaryInputStreamSerializer.h │ ├── BinaryOutputStreamSerializer.cpp │ ├── BinaryOutputStreamSerializer.h │ ├── BinarySerializationTools.h │ ├── BlockchainExplorerDataSerialization.cpp │ ├── BlockchainExplorerDataSerialization.h │ ├── ISerializer.h │ ├── IStream.h │ ├── JsonInputStreamSerializer.cpp │ ├── JsonInputStreamSerializer.h │ ├── JsonInputValueSerializer.cpp │ ├── JsonInputValueSerializer.h │ ├── JsonOutputStreamSerializer.cpp │ ├── JsonOutputStreamSerializer.h │ ├── KVBinaryCommon.h │ ├── KVBinaryInputStreamSerializer.cpp │ ├── KVBinaryInputStreamSerializer.h │ ├── KVBinaryOutputStreamSerializer.cpp │ ├── KVBinaryOutputStreamSerializer.h │ ├── MemoryStream.cpp │ ├── MemoryStream.h │ ├── SerializationOverloads.cpp │ ├── SerializationOverloads.h │ └── SerializationTools.h ├── SimpleWallet │ ├── SimpleWallet.cpp │ └── SimpleWallet.h ├── System │ ├── Context.h │ ├── ContextGroup.cpp │ ├── ContextGroup.h │ ├── ContextGroupTimeout.cpp │ ├── ContextGroupTimeout.h │ ├── Event.cpp │ ├── Event.h │ ├── EventLock.cpp │ ├── EventLock.h │ ├── InterruptedException.cpp │ ├── InterruptedException.h │ ├── Ipv4Address.cpp │ ├── Ipv4Address.h │ ├── OperationTimeout.h │ ├── RemoteContext.h │ ├── RemoteEventLock.cpp │ ├── RemoteEventLock.h │ ├── TcpStream.cpp │ └── TcpStream.h ├── Transfers │ ├── BlockchainSynchronizer.cpp │ ├── BlockchainSynchronizer.h │ ├── CommonTypes.h │ ├── IBlockchainSynchronizer.h │ ├── IObservableImpl.h │ ├── SynchronizationState.cpp │ ├── SynchronizationState.h │ ├── TransfersConsumer.cpp │ ├── TransfersConsumer.h │ ├── TransfersContainer.cpp │ ├── TransfersContainer.h │ ├── TransfersSubscription.cpp │ ├── TransfersSubscription.h │ ├── TransfersSynchronizer.cpp │ ├── TransfersSynchronizer.h │ └── TypeHelpers.h ├── Wallet │ ├── IFusionManager.h │ ├── LegacyKeysImporter.cpp │ ├── LegacyKeysImporter.h │ ├── WalletAsyncContextCounter.cpp │ ├── WalletAsyncContextCounter.h │ ├── WalletErrors.cpp │ ├── WalletErrors.h │ ├── WalletGreen.cpp │ ├── WalletGreen.h │ ├── WalletIndices.h │ ├── WalletRpcServer.cpp │ ├── WalletRpcServer.h │ ├── WalletRpcServerCommandsDefinitions.h │ ├── WalletRpcServerErrorCodes.h │ ├── WalletSerializationV1.cpp │ ├── WalletSerializationV1.h │ ├── WalletSerializationV2.cpp │ ├── WalletSerializationV2.h │ ├── WalletUtils.cpp │ └── WalletUtils.h ├── WalletGui │ ├── CMakeLists.txt │ ├── CommandLineParser.cpp │ ├── CommandLineParser.h │ ├── CurrencyAdapter.cpp │ ├── CurrencyAdapter.h │ ├── DynexCNWrapper.cpp │ ├── DynexCNWrapper.h │ ├── LICENSE.txt │ ├── LogFileWatcher.cpp │ ├── LogFileWatcher.h │ ├── LoggerAdapter.cpp │ ├── LoggerAdapter.h │ ├── NodeAdapter.cpp │ ├── NodeAdapter.h │ ├── README.md │ ├── Settings.cpp │ ├── Settings.h │ ├── SignalHandler.cpp │ ├── SignalHandler.h │ ├── WalletAdapter.cpp │ ├── WalletAdapter.h │ ├── cryptonotewallet.rc │ ├── gui │ │ ├── AddressBookDialog.cpp │ │ ├── AddressBookDialog.h │ │ ├── AddressBookFrame.cpp │ │ ├── AddressBookFrame.h │ │ ├── AddressBookModel.cpp │ │ ├── AddressBookModel.h │ │ ├── AnimatedLabel.cpp │ │ ├── AnimatedLabel.h │ │ ├── BalanceProofDialog.cpp │ │ ├── BalanceProofDialog.h │ │ ├── ChangePasswordDialog.cpp │ │ ├── ChangePasswordDialog.h │ │ ├── ConnectionSettings.cpp │ │ ├── ConnectionSettings.h │ │ ├── ExitWidget.cpp │ │ ├── ExitWidget.h │ │ ├── ImportKeyDialog.cpp │ │ ├── ImportKeyDialog.h │ │ ├── ImportKeysDialog.cpp │ │ ├── ImportKeysDialog.h │ │ ├── MainWindow.cpp │ │ ├── MainWindow.h │ │ ├── MainWindow.mm │ │ ├── MnemonicSeedDialog.cpp │ │ ├── MnemonicSeedDialog.h │ │ ├── NewAddressDialog.cpp │ │ ├── NewAddressDialog.h │ │ ├── NewPasswordDialog.cpp │ │ ├── NewPasswordDialog.h │ │ ├── OverviewFrame.cpp │ │ ├── OverviewFrame.h │ │ ├── PasswordDialog.cpp │ │ ├── PasswordDialog.h │ │ ├── PrivateKeysDialog.cpp │ │ ├── PrivateKeysDialog.h │ │ ├── README.md │ │ ├── ReceiveFrame.cpp │ │ ├── ReceiveFrame.h │ │ ├── RecentTransactionsModel.cpp │ │ ├── RecentTransactionsModel.h │ │ ├── RestoreFromMnemonicSeedDialog.cpp │ │ ├── RestoreFromMnemonicSeedDialog.h │ │ ├── SendFrame.cpp │ │ ├── SendFrame.h │ │ ├── SortedTransactionsModel.cpp │ │ ├── SortedTransactionsModel.h │ │ ├── TransactionDetailsDialog.cpp │ │ ├── TransactionDetailsDialog.h │ │ ├── TransactionFrame.cpp │ │ ├── TransactionFrame.h │ │ ├── TransactionsFrame.cpp │ │ ├── TransactionsFrame.h │ │ ├── TransactionsListModel.cpp │ │ ├── TransactionsListModel.h │ │ ├── TransactionsModel.cpp │ │ ├── TransactionsModel.h │ │ ├── TransferFrame.cpp │ │ ├── TransferFrame.h │ │ ├── VerifyMnemonicSeedDialog.cpp │ │ ├── VerifyMnemonicSeedDialog.h │ │ ├── WalletEvents.h │ │ └── ui │ │ │ ├── README.md │ │ │ ├── addressbookdialog.ui │ │ │ ├── addressbookframe.ui │ │ │ ├── balanceproofdialog.ui │ │ │ ├── changepassworddialog.ui │ │ │ ├── connectionsettingsdialog.ui │ │ │ ├── exitwidget.ui │ │ │ ├── importkeydialog.ui │ │ │ ├── importkeysdialog.ui │ │ │ ├── mainwindow.ui │ │ │ ├── mnemonicseeddialog.ui │ │ │ ├── newaddressdialog.ui │ │ │ ├── newpassworddialog.ui │ │ │ ├── overviewframe.ui │ │ │ ├── passworddialog.ui │ │ │ ├── privatekeysdialog.ui │ │ │ ├── receiveframe.ui │ │ │ ├── restorefrommnemonicseeddialog.ui │ │ │ ├── sendframe.ui │ │ │ ├── transactiondetailsdialog.ui │ │ │ ├── transactionframe.ui │ │ │ ├── transactionsframe.ui │ │ │ ├── transferframe.ui │ │ │ └── verifymnemonicseeddialog.ui │ ├── icons │ │ ├── README.md │ │ ├── add.png │ │ ├── address-book.png │ │ ├── cancelled.png │ │ ├── clock1.png │ │ ├── clock2.png │ │ ├── clock3.png │ │ ├── clock4.png │ │ ├── clock5.png │ │ ├── connected.png │ │ ├── disconnected.png │ │ ├── editcopy.png │ │ ├── editpaste.png │ │ ├── export.png │ │ ├── lock_closed.png │ │ ├── lock_open.png │ │ ├── overview.png │ │ ├── receive.png │ │ ├── remove.png │ │ ├── send.png │ │ ├── sync_sprite.png │ │ ├── synced.png │ │ ├── transaction.png │ │ ├── transactions.png │ │ ├── tx_inout.png │ │ ├── tx_input.png │ │ ├── tx_mined.png │ │ ├── tx_output.png │ │ └── unconfirmed.png │ ├── images │ │ ├── README.md │ │ ├── clock.gif │ │ ├── dynex.icns │ │ ├── dynex.ico │ │ ├── dynex.png │ │ └── splash.png │ ├── main.cpp │ └── resources.qrc ├── WalletLegacy │ ├── KeysStorage.cpp │ ├── KeysStorage.h │ ├── WalletHelper.cpp │ ├── WalletHelper.h │ ├── WalletLegacy.cpp │ ├── WalletLegacy.h │ ├── WalletLegacyEvent.h │ ├── WalletLegacySerialization.cpp │ ├── WalletLegacySerialization.h │ ├── WalletLegacySerializer.cpp │ ├── WalletLegacySerializer.h │ ├── WalletRequest.h │ ├── WalletSendTransactionContext.h │ ├── WalletTransactionSender.cpp │ ├── WalletTransactionSender.h │ ├── WalletUnconfirmedTransactions.cpp │ ├── WalletUnconfirmedTransactions.h │ ├── WalletUserTransactionsCache.cpp │ ├── WalletUserTransactionsCache.h │ └── WalletUtils.h ├── crypto │ ├── aesb.h │ ├── blake256.c │ ├── blake256.h │ ├── chacha8.c │ ├── chacha8.h │ ├── crypto-ops-data.c │ ├── crypto-ops.c │ ├── crypto-ops.h │ ├── crypto.cpp │ ├── crypto.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 │ ├── slow-hash.cpp │ └── tree-hash.c ├── version.cmake └── version.h.in └── tests ├── CMakeLists.txt └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # push scripts 2 | ###################### 3 | gitpush.sh 4 | 5 | # build folder 6 | ###################### 7 | build/** 8 | 9 | # OS generated files # 10 | ###################### 11 | .DS_Store 12 | .DS_Store? 13 | ._* 14 | .Spotlight-V100 15 | .Trashes 16 | ehthumbs.db 17 | Thumbs.db 18 | 19 | # Compiled source # 20 | ################### 21 | *.com 22 | *.class 23 | *.dll 24 | *.exe 25 | *.o 26 | *.so 27 | 28 | -------------------------------------------------------------------------------- /CTestCustom.cmake: -------------------------------------------------------------------------------- 1 | set(CTEST_CUSTOM_TESTS_IGNORE 2 | CoreTests 3 | IntegrationTestLibrary 4 | TestGenerator 5 | CryptoTests 6 | IntegrationTests 7 | NodeRpcProxyTests 8 | PerformanceTests 9 | TransfersTests 10 | ) 11 | 12 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 TuringX [TRGX] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /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 | rm -rf build 29 | 30 | tags: 31 | ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest 32 | 33 | .PHONY: all cmake-debug build-debug test-debug all-debug cmake-release build-release test-release all-release clean tags 34 | -------------------------------------------------------------------------------- /checkpoints.csv: -------------------------------------------------------------------------------- 1 | 164784,eb535cf687a5870c8bf3eda611537c3e6577e537051cd6959dfa421a63ef5894 -------------------------------------------------------------------------------- /external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(UPNPC_BUILD_STATIC ON CACHE BOOL "Build static library") 3 | set(UPNPC_BUILD_SHARED OFF CACHE BOOL "Build shared library") 4 | set(UPNPC_BUILD_TESTS OFF CACHE BOOL "Build test executables") 5 | set(UPNPC_BUILD_SAMPLE OFF CACHE BOOL "Build sample executables") 6 | 7 | add_subdirectory(miniupnpc) 8 | #add_subdirectory(gtest) 9 | 10 | #set_property(TARGET upnpc-static gtest gtest_main PROPERTY FOLDER "external") 11 | -------------------------------------------------------------------------------- /external/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /external/google/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /external/google/sparsehash/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /external/google/sparsehash/os_config.h: -------------------------------------------------------------------------------- 1 | #ifndef _MSC_VER 2 | //non-win version 3 | 4 | /* Define to 1 if you have the header file. */ 5 | #define HAVE_INTTYPES_H 1 6 | 7 | /* Define to 1 if you have the header file. */ 8 | #define HAVE_STDINT_H 1 9 | 10 | /* Define to 1 if the system has the type `uint16_t'. */ 11 | #define HAVE_UINT16_T 1 12 | 13 | /* Define to 1 if the system has the type `u_int16_t'. */ 14 | #define HAVE_U_INT16_T 1 15 | 16 | /* Define to 1 if the system has the type `__uint16'. */ 17 | /* #undef HAVE___UINT16 */ 18 | 19 | #else 20 | //win version 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #undef HAVE_INTTYPES_H 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #undef HAVE_STDINT_H 27 | 28 | /* Define to 1 if the system has the type `uint16_t'. */ 29 | #undef HAVE_UINT16_T 30 | 31 | /* Define to 1 if the system has the type `u_int16_t'. */ 32 | #undef HAVE_U_INT16_T 33 | 34 | /* Define to 1 if the system has the type `__uint16'. */ 35 | #define HAVE___UINT16 1 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /external/google/sparsehash/sparseconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NOTE: This file is for internal use only. 3 | * Do not use these #defines in your own program! 4 | */ 5 | 6 | /* Namespace for Google classes */ 7 | #define GOOGLE_NAMESPACE ::google 8 | 9 | /* the location of the header defining hash functions */ 10 | #define HASH_FUN_H 11 | 12 | /* the namespace of the hash<> function */ 13 | #define HASH_NAMESPACE std 14 | 15 | /* Define to 1 if the system has the type `long long'. */ 16 | #define HAVE_LONG_LONG 1 17 | 18 | /* Define to 1 if you have the `memcpy' function. */ 19 | #define HAVE_MEMCPY 1 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #define HAVE_SYS_TYPES_H 1 23 | 24 | /* The system-provided hash function including the namespace. */ 25 | #define SPARSEHASH_HASH HASH_NAMESPACE::hash 26 | 27 | /* The system-provided hash function, in namespace HASH_NAMESPACE. */ 28 | #define SPARSEHASH_HASH_NO_NAMESPACE hash 29 | 30 | /* the namespace where STL code like vector<> is defined */ 31 | #define STL_NAMESPACE std 32 | 33 | /* Stops putting the code inside the Google namespace */ 34 | #define _END_GOOGLE_NAMESPACE_ } 35 | 36 | /* Puts following code inside the Google namespace */ 37 | #define _START_GOOGLE_NAMESPACE_ namespace google { 38 | 39 | #include "os_config.h" 40 | -------------------------------------------------------------------------------- /external/google/sparsehash/sparseconfig_win.h: -------------------------------------------------------------------------------- 1 | /* 2 | * NOTE: This file is for internal use only. 3 | * Do not use these #defines in your own program! 4 | */ 5 | 6 | /* Namespace for Google classes */ 7 | #define GOOGLE_NAMESPACE ::google 8 | 9 | /* the location of the header defining hash functions */ 10 | #define HASH_FUN_H 11 | 12 | /* the namespace of the hash<> function */ 13 | #define HASH_NAMESPACE std 14 | 15 | /* Define to 1 if the system has the type `long long'. */ 16 | #define HAVE_LONG_LONG 1 17 | 18 | /* Define to 1 if you have the `memcpy' function. */ 19 | #define HAVE_MEMCPY 1 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #define HAVE_SYS_TYPES_H 1 23 | 24 | /* The system-provided hash function including the namespace. */ 25 | #define SPARSEHASH_HASH HASH_NAMESPACE::hash 26 | 27 | /* The system-provided hash function, in namespace HASH_NAMESPACE. */ 28 | #define SPARSEHASH_HASH_NO_NAMESPACE hash 29 | 30 | /* the namespace where STL code like vector<> is defined */ 31 | #define STL_NAMESPACE std 32 | 33 | /* Stops putting the code inside the Google namespace */ 34 | #define _END_GOOGLE_NAMESPACE_ } 35 | 36 | /* Puts following code inside the Google namespace */ 37 | #define _START_GOOGLE_NAMESPACE_ namespace google { 38 | -------------------------------------------------------------------------------- /external/gtest/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/external/gtest/CMakeLists.txt -------------------------------------------------------------------------------- /external/gtest/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /external/linenoise/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /external/miniupnpc/LICENSE: -------------------------------------------------------------------------------- 1 | MiniUPnPc 2 | Copyright (c) 2005-2020, 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 VERSION 3 | include LICENSE 4 | include miniupnpcmodule.c 5 | include setup.py 6 | include Makefile 7 | include *.[ch] 8 | include *.h.in 9 | include *.sh 10 | -------------------------------------------------------------------------------- /external/miniupnpc/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /external/miniupnpc/VERSION: -------------------------------------------------------------------------------- 1 | 2.2.2 2 | -------------------------------------------------------------------------------- /external/miniupnpc/addr_is_reserved.h: -------------------------------------------------------------------------------- 1 | /* $Id: addr_is_reserved.h,v 1.1 2020/09/28 21:11:19 nanard Exp $ */ 2 | /* vim: tabstop=4 shiftwidth=4 noexpandtab 3 | * Project: miniupnp 4 | * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ 5 | * Author: Thomas Bernard 6 | * Copyright (c) 2005-2020 Thomas Bernard 7 | * This software is subjects to the conditions detailed 8 | * in the LICENCE file provided within this distribution */ 9 | #ifndef ADDR_IS_RESERVED_H_INCLUDED 10 | #define ADDR_IS_RESERVED_H_INCLUDED 11 | 12 | int addr_is_reserved(const char * addr_str); 13 | 14 | #endif /* ADDR_IS_RESERVED_H_INCLUDED */ 15 | -------------------------------------------------------------------------------- /external/miniupnpc/codelength.h: -------------------------------------------------------------------------------- 1 | /* $Id: codelength.h,v 1.5 2015/07/09 12:40:18 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.4 2018/04/06 10:53:13 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2010-2018 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 | #include "miniupnpc_socketdef.h" 12 | 13 | /* connecthostport() 14 | * return a socket connected (TCP) to the host and port 15 | * or INVALID_SOCKET in case of error */ 16 | SOCKET connecthostport(const char * host, unsigned short port, 17 | unsigned int scope_id); 18 | 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /external/miniupnpc/external-ip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $Id: external-ip.sh,v 1.2 2017/11/02 15:33:09 nanard Exp $ 3 | # (c) 2010 Reuben Hawkins 4 | upnpc -s | sed -n -e 's/^ExternalIPAddress = \([0-9.]*\)$/\1/p' 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.6 2018/04/06 10:53:13 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2005-2018 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 | #include "miniupnpc_socketdef.h" 11 | 12 | /*int httpWrite(int, const char *, int, const char *);*/ 13 | int soapPostSubmit(SOCKET, const char *, const char *, unsigned short, 14 | const char *, const char *, const char *); 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /external/miniupnpc/minissdpc.h: -------------------------------------------------------------------------------- 1 | /* $Id: minissdpc.h,v 1.8 2019/02/10 12:29:23 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 s); 36 | 37 | MINIUPNP_LIBSPEC int 38 | requestDevicesFromMiniSSDPD(int s, const char * devtype); 39 | 40 | MINIUPNP_LIBSPEC struct UPNPDev * 41 | receiveDevicesFromMiniSSDPD(int s, 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-config.cmake: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/libminiupnpc-shared.cmake" OR MINIUPNPC_USE_STATIC_LIBS) 2 | include("${CMAKE_CURRENT_LIST_DIR}/miniupnpc-private.cmake") 3 | include("${CMAKE_CURRENT_LIST_DIR}/libminiupnpc-static.cmake") 4 | else() 5 | include("${CMAKE_CURRENT_LIST_DIR}/libminiupnpc-shared.cmake") 6 | endif() 7 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpc.def: -------------------------------------------------------------------------------- 1 | LIBRARY 2 | ; miniupnpc library 3 | miniupnpc 4 | 5 | EXPORTS 6 | ; miniupnpc 7 | upnpDiscover 8 | upnpDiscoverDevice 9 | upnpDiscoverDevices 10 | upnpDiscoverAll 11 | freeUPNPDevlist 12 | parserootdesc 13 | UPNP_GetValidIGD 14 | UPNP_GetIGDFromUrl 15 | GetUPNPUrls 16 | FreeUPNPUrls 17 | ; miniwget 18 | miniwget 19 | miniwget_getaddr 20 | ; upnpcommands 21 | UPNP_GetTotalBytesSent 22 | UPNP_GetTotalBytesReceived 23 | UPNP_GetTotalPacketsSent 24 | UPNP_GetTotalPacketsReceived 25 | UPNP_GetStatusInfo 26 | UPNP_GetConnectionTypeInfo 27 | UPNP_GetExternalIPAddress 28 | UPNP_GetLinkLayerMaxBitRates 29 | UPNP_AddPortMapping 30 | UPNP_AddAnyPortMapping 31 | UPNP_DeletePortMapping 32 | UPNP_DeletePortMappingRange 33 | UPNP_GetPortMappingNumberOfEntries 34 | UPNP_GetSpecificPortMappingEntry 35 | UPNP_GetGenericPortMappingEntry 36 | UPNP_GetListOfPortMappings 37 | UPNP_AddPinhole 38 | UPNP_CheckPinholeWorking 39 | UPNP_UpdatePinhole 40 | UPNP_GetPinholePackets 41 | UPNP_DeletePinhole 42 | UPNP_GetFirewallStatus 43 | UPNP_GetOutboundPinholeTimeout 44 | ; upnperrors 45 | strupnperror 46 | ; portlistingparse 47 | ParsePortListing 48 | FreePortListing 49 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpc.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "rc_version.h" 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION LIBMINIUPNPC_MAJOR_VERSION,LIBMINIUPNPC_MINOR_VERSION,LIBMINIUPNPC_MICRO_VERSION,0 6 | PRODUCTVERSION LIBMINIUPNPC_MAJOR_VERSION,LIBMINIUPNPC_MINOR_VERSION,LIBMINIUPNPC_MICRO_VERSION,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | #ifdef _DEBUG 9 | FILEFLAGS VS_FF_DEBUG 10 | #else 11 | FILEFLAGS 0 12 | #endif 13 | FILEOS VOS__WINDOWS32 14 | FILETYPE VFT_DLL 15 | FILESUBTYPE VFT2_UNKNOWN // not used 16 | BEGIN 17 | BLOCK "StringFileInfo" 18 | BEGIN 19 | BLOCK "04090000" /* Lang = US English, Charset = ASCII */ 20 | BEGIN 21 | VALUE "FileDescription", "MiniUPnPc library\0" 22 | VALUE "FileVersion", LIBMINIUPNPC_DOTTED_VERSION "\0" 23 | VALUE "InternalName", INTERNAL_NAME 24 | VALUE "LegalCopyright", "Copyright (C) Thomas Bernard\0" 25 | VALUE "LegalTrademarks", "\0" 26 | VALUE "OriginalFilename", INTERNAL_NAME 27 | VALUE "ProductName", "MiniUPnPc\0" 28 | VALUE "ProductVersion", LIBMINIUPNPC_DOTTED_VERSION "\0" 29 | VALUE "Comments", "For more information visit https://miniupnp.tuxfamil.org/\0" 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0409, 0 /* US English, ASCII */ 35 | END 36 | END 37 | -------------------------------------------------------------------------------- /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/miniupnpc_socketdef.h: -------------------------------------------------------------------------------- 1 | /* $Id: miniupnpc_socketdef.h,v 1.4 2021/03/02 23:35:29 nanard Exp $ */ 2 | /* Miniupnp project : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2018 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided within this distribution */ 7 | #ifndef MINIUPNPC_SOCKETDEF_H_INCLUDED 8 | #define MINIUPNPC_SOCKETDEF_H_INCLUDED 9 | 10 | #ifdef _WIN32 11 | 12 | #define ISINVALID(s) (INVALID_SOCKET==(s)) 13 | 14 | #else 15 | 16 | #ifndef SOCKET 17 | #define SOCKET int 18 | #endif 19 | #ifndef SSIZE_T 20 | #define SSIZE_T ssize_t 21 | #endif 22 | #ifndef INVALID_SOCKET 23 | #define INVALID_SOCKET (-1) 24 | #endif 25 | #ifndef ISINVALID 26 | #define ISINVALID(s) ((s)<0) 27 | #endif 28 | 29 | #endif 30 | 31 | #ifdef _MSC_VER 32 | #define MSC_CAST_INT (int) 33 | #else 34 | #define MSC_CAST_INT 35 | #endif 36 | 37 | /* definition of PRINT_SOCKET_ERROR */ 38 | #ifdef _WIN32 39 | #define PRINT_SOCKET_ERROR(x) fprintf(stderr, "Socket error: %s, %d\n", x, WSAGetLastError()); 40 | #else 41 | #define PRINT_SOCKET_ERROR(x) perror(x) 42 | #endif 43 | 44 | #endif /* MINIUPNPC_SOCKETDEF_H_INCLUDED */ 45 | -------------------------------------------------------------------------------- /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.2 2012/09/27 15:42:10 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.13 2018/04/06 10:53:15 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 * miniwget(const char *, int *, unsigned int, int *); 18 | 19 | MINIUPNP_LIBSPEC void * miniwget_getaddr(const char *, int *, char *, int, unsigned int, int *); 20 | 21 | int parseURL(const char *, char *, unsigned short *, char * *, unsigned int *); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /external/miniupnpc/miniwget_private.h: -------------------------------------------------------------------------------- 1 | /* $Id: miniwget_private.h,v 1.1 2018/04/06 10:17:58 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2018 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided in this distribution. 7 | * */ 8 | #ifndef MINIWGET_INTERNAL_H_INCLUDED 9 | #define MINIWGET_INTERNAL_H_INCLUDED 10 | 11 | #include "miniupnpc_socketdef.h" 12 | 13 | void * getHTTPResponse(SOCKET s, int * size, int * status_code); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /external/miniupnpc/minixml.h: -------------------------------------------------------------------------------- 1 | /* $Id: minixml.h,v 1.8 2019/02/10 12:29:25 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/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/external/miniupnpc/msvc/miniupnpc.vcproj -------------------------------------------------------------------------------- /external/miniupnpc/msvc/miniupnpc_vs2010.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual C++ Express 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniupnpc_vs2010", "miniupnpc_vs2010.vcxproj", "{D28CE435-CB33-4BAE-8A52-C6EF915956F5}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upnpc-static_vs2010", "upnpc-static_vs2010.vcxproj", "{469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug Dll|Win32 = Debug Dll|Win32 11 | Debug|Win32 = Debug|Win32 12 | Release Dll|Win32 = Release Dll|Win32 13 | Release|Win32 = Release|Win32 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Debug Dll|Win32.ActiveCfg = Debug Dll|Win32 17 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Debug Dll|Win32.Build.0 = Debug Dll|Win32 18 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Debug|Win32.ActiveCfg = Debug|Win32 19 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Debug|Win32.Build.0 = Debug|Win32 20 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Release Dll|Win32.ActiveCfg = Release Dll|Win32 21 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Release Dll|Win32.Build.0 = Release Dll|Win32 22 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Release|Win32.ActiveCfg = Release|Win32 23 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Release|Win32.Build.0 = Release|Win32 24 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Debug Dll|Win32.ActiveCfg = Debug Dll|Win32 25 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Debug Dll|Win32.Build.0 = Debug Dll|Win32 26 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Debug|Win32.ActiveCfg = Debug|Win32 27 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Debug|Win32.Build.0 = Debug|Win32 28 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Release Dll|Win32.ActiveCfg = Release Dll|Win32 29 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Release Dll|Win32.Build.0 = Release Dll|Win32 30 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Release|Win32.ActiveCfg = Release|Win32 31 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Release|Win32.Build.0 = Release|Win32 32 | EndGlobalSection 33 | GlobalSection(SolutionProperties) = preSolution 34 | HideSolutionNode = FALSE 35 | EndGlobalSection 36 | EndGlobal 37 | -------------------------------------------------------------------------------- /external/miniupnpc/msvc/miniupnpc_vs2015.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "miniupnpc", "miniupnpc.vcxproj", "{D28CE435-CB33-4BAE-8A52-C6EF915956F5}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upnpc-static", "upnpc-static.vcxproj", "{469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug Dll|Win32 = Debug Dll|Win32 13 | Debug|Win32 = Debug|Win32 14 | Release Dll|Win32 = Release Dll|Win32 15 | Release|Win32 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Debug Dll|Win32.ActiveCfg = Debug Dll|Win32 19 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Debug Dll|Win32.Build.0 = Debug Dll|Win32 20 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Debug|Win32.ActiveCfg = Debug|Win32 21 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Debug|Win32.Build.0 = Debug|Win32 22 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Release Dll|Win32.ActiveCfg = Release Dll|Win32 23 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Release Dll|Win32.Build.0 = Release Dll|Win32 24 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Release|Win32.ActiveCfg = Release|Win32 25 | {D28CE435-CB33-4BAE-8A52-C6EF915956F5}.Release|Win32.Build.0 = Release|Win32 26 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Debug Dll|Win32.ActiveCfg = Debug Dll|Win32 27 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Debug Dll|Win32.Build.0 = Debug Dll|Win32 28 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Debug|Win32.ActiveCfg = Debug|Win32 29 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Debug|Win32.Build.0 = Debug|Win32 30 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Release Dll|Win32.ActiveCfg = Release Dll|Win32 31 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Release Dll|Win32.Build.0 = Release Dll|Win32 32 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Release|Win32.ActiveCfg = Release|Win32 33 | {469E1CF6-08A2-4B7B-A2AA-5BDB089857C1}.Release|Win32.Build.0 = Release|Win32 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /external/miniupnpc/msvc/upnpc-static.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/external/miniupnpc/msvc/upnpc-static.vcproj -------------------------------------------------------------------------------- /external/miniupnpc/msvc/upnpc-static.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Fichiers sources 20 | 21 | 22 | -------------------------------------------------------------------------------- /external/miniupnpc/portlistingparse.h: -------------------------------------------------------------------------------- 1 | /* $Id: portlistingparse.h,v 1.11 2015/07/21 13:16:55 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/receivedata.h: -------------------------------------------------------------------------------- 1 | /* $Id: receivedata.h,v 1.5 2018/04/06 10:53:15 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2011-2018 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 | #include "miniupnpc_socketdef.h" 12 | 13 | /* Reads data from the specified socket. 14 | * Returns the number of bytes read if successful, zero if no bytes were 15 | * read or if we timed out. Returns negative if there was an error. */ 16 | int receivedata(SOCKET socket, 17 | char * data, int length, 18 | int timeout, unsigned int * scope_id); 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /external/miniupnpc/setup.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # vim: tabstop=8 shiftwidth=8 expandtab 3 | # $Id: setup.py,v 1.14 2020/04/06 10:23:02 nanard Exp $ 4 | # the MiniUPnP Project (c) 2007-2020 Thomas Bernard 5 | # https://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/ 6 | # 7 | # python script to build the miniupnpc module under unix 8 | # 9 | # Uses MAKE environment variable (defaulting to 'make') 10 | 11 | from setuptools import setup, Extension 12 | from setuptools.command import build_ext 13 | import subprocess 14 | import os 15 | 16 | EXT = ['libminiupnpc.a'] 17 | 18 | class make_then_build_ext(build_ext.build_ext): 19 | def run(self): 20 | subprocess.check_call([os.environ.get('MAKE', 'make')] + EXT) 21 | build_ext.build_ext.run(self) 22 | 23 | setup(name="miniupnpc", 24 | version=open('VERSION').read().strip(), 25 | author='Thomas BERNARD', 26 | author_email='miniupnp@free.fr', 27 | license=open('LICENSE').read(), 28 | url='http://miniupnp.free.fr/', 29 | description='miniUPnP client', 30 | cmdclass={'build_ext': make_then_build_ext}, 31 | ext_modules=[ 32 | Extension(name="miniupnpc", sources=["miniupnpcmodule.c"], 33 | extra_objects=EXT) 34 | ]) 35 | 36 | -------------------------------------------------------------------------------- /external/miniupnpc/setupmingw32.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # vim: tabstop=8 shiftwidth=8 expandtab 3 | # $Id: setupmingw32.py,v 1.13 2020/10/15 22:27:08 nanard Exp $ 4 | # the MiniUPnP Project (c) 2007-2020 Thomas Bernard 5 | # https://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/ 6 | # 7 | # python script to build the miniupnpc module under windows (using mingw32) 8 | # 9 | import sys 10 | 11 | if (sys.version_info.major * 10 + sys.version_info.minor) >= 35: 12 | compat_lib = ["legacy_stdio_definitions"] 13 | else: 14 | compat_lib = [] 15 | 16 | try: 17 | from setuptools import setup, Extension 18 | except ImportError: 19 | from distutils.core import setup, Extension 20 | from distutils import sysconfig 21 | sysconfig.get_config_vars()["OPT"] = '' 22 | sysconfig.get_config_vars()["CFLAGS"] = '' 23 | setup(name="miniupnpc", 24 | version=open('VERSION').read().strip(), 25 | author='Thomas BERNARD', 26 | author_email='miniupnp@free.fr', 27 | license=open('LICENSE').read(), 28 | url='http://miniupnp.free.fr/', 29 | description='miniUPnP client', 30 | ext_modules=[ 31 | Extension(name="miniupnpc", sources=["miniupnpcmodule.c"], 32 | libraries=["ws2_32", "iphlpapi"] + compat_lib, 33 | extra_objects=["miniupnpc.lib"]) 34 | ]) 35 | 36 | -------------------------------------------------------------------------------- /external/miniupnpc/testaddr_is_reserved.c: -------------------------------------------------------------------------------- 1 | /* $Id: testaddr_is_reserved.c,v 1.1 2020/10/15 22:12:51 nanard Exp $ */ 2 | /* vim: tabstop=4 shiftwidth=4 noexpandtab 3 | * Project : miniupnp 4 | * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ 5 | * Author : Thomas BERNARD 6 | * copyright (c) 2005-2020 Thomas Bernard 7 | * This software is subjet to the conditions detailed in the 8 | * provided LICENSE file. */ 9 | #include 10 | #include "addr_is_reserved.h" 11 | 12 | static const struct { 13 | const char * str; 14 | int expected_result; 15 | } tests[] = { 16 | { "0.0.0.0", 1 }, 17 | { "8.8.8.8", 0 }, 18 | { "192.168.1.1", 1 }, 19 | { "10.250.42.12", 1 }, 20 | { "11.250.42.12", 0 }, 21 | { "172.31.1.1", 1 }, 22 | { "172.32.1.1", 0 }, 23 | { "169.254.42.42", 1 }, 24 | { "192.0.0.11", 1 }, 25 | { "198.0.0.11", 0 }, 26 | { "198.18.0.11", 1 }, 27 | { "100.64.1.1", 1 }, 28 | { "100.127.1.1", 1 }, 29 | { "100.128.1.1", 0 }, 30 | { NULL, 0 } 31 | }; 32 | 33 | int main(int argc, char * * argv) { 34 | int i, result; 35 | (void)argc; (void)argv; 36 | 37 | for (i = 0; tests[i].str != NULL; i++) { 38 | result = addr_is_reserved(tests[i].str); 39 | printf("testing %s %d %d\n", tests[i].str, tests[i].expected_result, result); 40 | if (result != tests[i].expected_result) { 41 | fprintf(stderr, "*** FAILURE ***\n"); 42 | return 1; /* Failure */ 43 | } 44 | } 45 | return 0; /* success */ 46 | } 47 | -------------------------------------------------------------------------------- /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.7 2018/01/16 01:01:05 nanard Exp $ */ 2 | /* vim: tabstop=4 shiftwidth=4 noexpandtab 3 | * Project : miniupnp 4 | * Author : Thomas Bernard 5 | * Copyright (c) 2005-2018 Thomas Bernard 6 | * This software is subject to the conditions detailed in the 7 | * LICENCE file provided in this distribution. 8 | * */ 9 | #include 10 | #include 11 | #include "miniwget.h" 12 | 13 | /** 14 | * This program uses the miniwget / miniwget_getaddr function 15 | * from miniwget.c in order to retrieve a web ressource using 16 | * a GET HTTP method, and store it in a file. 17 | */ 18 | int main(int argc, char * * argv) 19 | { 20 | void * data; 21 | int size, writtensize; 22 | FILE *f; 23 | char addr[64]; 24 | int status_code = -1; 25 | 26 | if(argc < 3) { 27 | fprintf(stderr, "Usage:\t%s url file\n", argv[0]); 28 | fprintf(stderr, "Example:\t%s http://www.google.com/ out.html\n", argv[0]); 29 | return 1; 30 | } 31 | data = miniwget_getaddr(argv[1], &size, addr, sizeof(addr), 0, &status_code); 32 | if(!data || (status_code != 200)) { 33 | if(data) free(data); 34 | fprintf(stderr, "Error %d fetching %s\n", status_code, argv[1]); 35 | return 1; 36 | } 37 | printf("local address : %s\n", addr); 38 | printf("got %d bytes\n", size); 39 | f = fopen(argv[2], "wb"); 40 | if(!f) { 41 | fprintf(stderr, "Cannot open file %s for writing\n", argv[2]); 42 | free(data); 43 | return 1; 44 | } 45 | writtensize = fwrite(data, 1, size, f); 46 | if(writtensize != size) { 47 | fprintf(stderr, "Could only write %d bytes out of %d to %s\n", 48 | writtensize, size, argv[2]); 49 | } else { 50 | printf("%d bytes written to %s\n", writtensize, argv[2]); 51 | } 52 | fclose(f); 53 | free(data); 54 | return 0; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /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.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.3 2020/05/29 15:57:42 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ 4 | * Author : Thomas BERNARD 5 | * copyright (c) 2005-2020 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 | char * usn; 22 | unsigned int scope_id; 23 | #if defined(__STDC_VERSION) && __STDC_VERSION__ >= 199901L 24 | /* C99 flexible array member */ 25 | char buffer[]; 26 | #elif defined(__GNUC__) 27 | char buffer[0]; 28 | #else 29 | /* Fallback to a hack */ 30 | char buffer[1]; 31 | #endif 32 | }; 33 | 34 | /* freeUPNPDevlist() 35 | * free list returned by upnpDiscover() */ 36 | MINIUPNP_LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist); 37 | 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | 44 | #endif /* UPNPDEV_H_INCLUDED */ 45 | -------------------------------------------------------------------------------- /external/miniupnpc/upnperrors.h: -------------------------------------------------------------------------------- 1 | /* $Id: upnperrors.h,v 1.6 2015/07/21 13:16:55 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/Common/Base64.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #pragma once 39 | 40 | #include 41 | #include 42 | 43 | namespace Tools 44 | { 45 | namespace Base64 46 | { 47 | std::string encode(const std::string& data); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/Common/BlockingQueue.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "BlockingQueue.h" 39 | 40 | namespace { 41 | char suppressMSVCWarningLNK4221; 42 | } 43 | -------------------------------------------------------------------------------- /src/Common/FileMappedVector.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "FileMappedVector.h" 39 | 40 | namespace { 41 | char suppressMSVCWarningLNK4221; 42 | } 43 | -------------------------------------------------------------------------------- /src/Common/IInputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "IInputStream.h" 39 | -------------------------------------------------------------------------------- /src/Common/IOutputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "IOutputStream.h" 39 | -------------------------------------------------------------------------------- /src/Common/Math.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "Math.h" 39 | 40 | namespace { 41 | #ifdef _MSC_VER 42 | char suppressMSVCWarningLNK4221; 43 | #endif 44 | } 45 | -------------------------------------------------------------------------------- /src/Common/SignalHandler.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #pragma once 39 | 40 | #include 41 | 42 | namespace Tools { 43 | 44 | class SignalHandler 45 | { 46 | public: 47 | static bool install(std::function t); 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /src/Common/pod-class.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #pragma once 39 | 40 | #if defined(_MSC_VER) 41 | #define POD_CLASS struct 42 | #else 43 | #define POD_CLASS class 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Common/static_assert.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #pragma once 39 | 40 | #ifndef __cplusplus 41 | #ifdef __clang__ 42 | 43 | #define static_assert _Static_assert 44 | 45 | #endif 46 | #endif 47 | -------------------------------------------------------------------------------- /src/DynexCNCore/IBlock.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "IBlock.h" 39 | 40 | namespace DynexCN { 41 | IBlock::~IBlock() { 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/DynexCNCore/ITimeProvider.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "ITimeProvider.h" 39 | -------------------------------------------------------------------------------- /src/DynexCNCore/ITxPoolObserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #pragma once 39 | 40 | namespace DynexCN { 41 | class ITxPoolObserver { 42 | public: 43 | virtual ~ITxPoolObserver() { 44 | } 45 | 46 | virtual void txDeletedFromPool() = 0; 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /src/DynexCNCore/README.MD: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/DynexCNCore/SwappedMap.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "SwappedMap.h" 39 | 40 | namespace { 41 | #ifdef _MSC_VER 42 | char suppressMSVCWarningLNK4221; 43 | #endif 44 | } 45 | -------------------------------------------------------------------------------- /src/DynexCNCore/SwappedVector.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "SwappedVector.h" 39 | 40 | namespace { 41 | #ifdef _MSC_VER 42 | char suppressMSVCWarningLNK4221; 43 | #endif 44 | } 45 | -------------------------------------------------------------------------------- /src/DynexCNCore/UpgradeDetector.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "UpgradeDetector.h" 39 | -------------------------------------------------------------------------------- /src/DynexCNProtocol/README.MD: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/GreenWallet/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/Mnemonics/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/Mnemonics/electrum-words.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/Mnemonics/electrum-words.h -------------------------------------------------------------------------------- /src/NodeRpcProxy/NodeErrors.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "NodeErrors.h" 39 | 40 | namespace DynexCN { 41 | namespace error { 42 | 43 | NodeErrorCategory NodeErrorCategory::INSTANCE; 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Optimizer/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/P2p/IP2pNodeInternal.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "IP2pNodeInternal.h" 39 | -------------------------------------------------------------------------------- /src/P2p/P2pInterfaces.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "P2pInterfaces.h" 39 | 40 | namespace DynexCN { 41 | 42 | IP2pConnection::~IP2pConnection() { 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/P2p/P2pNetworks.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #pragma once 39 | 40 | namespace DynexCN 41 | { 42 | const static uuid DYNEX_NETWORK = { { 0x3c, 0xae, 0xb5, 0xc3, 0xf3, 0xee, 0xe0, 0x2f, 0xd2, 0xc3, 0xee, 0x1a, 0x3c, 0x4e, 0x0b, 0xfa } }; 43 | } 44 | -------------------------------------------------------------------------------- /src/PaymentGate/WalletServiceErrorCategory.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "WalletServiceErrorCategory.h" 39 | 40 | namespace DynexCN { 41 | namespace error { 42 | 43 | WalletServiceErrorCategory WalletServiceErrorCategory::INSTANCE; 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/Context.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #include 20 | #include 21 | #include "Context.h" 22 | 23 | void 24 | makecontext(uctx *ucp, void (*func)(void), intptr_t arg) 25 | { 26 | long *sp; 27 | 28 | memset(&ucp->uc_mcontext, 0, sizeof ucp->uc_mcontext); 29 | ucp->uc_mcontext.mc_rdi = (long)arg; 30 | sp = (long*)ucp->uc_stack.ss_sp+ucp->uc_stack.ss_size/sizeof(long); 31 | sp -= 1; 32 | sp = (void*)((uintptr_t)sp - (uintptr_t)sp%16); /* 16-align for OS X */ 33 | *--sp = 0; /* return address */ 34 | ucp->uc_mcontext.mc_rip = (long)func; 35 | ucp->uc_mcontext.mc_rsp = (long)sp; 36 | } 37 | 38 | int 39 | swapcontext(uctx *oucp, const uctx *ucp) 40 | { 41 | if(getcontext(oucp) == 0) 42 | setcontext(ucp); 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #include "ErrorMessage.h" 20 | #include 21 | #include 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage() { 26 | return errorMessage(errno); 27 | } 28 | 29 | std::string errorMessage(int err) { 30 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | std::string lastErrorMessage(); 25 | std::string errorMessage(int); 26 | } 27 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/Ipv4Resolver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | class Ipv4Address; 27 | 28 | class Ipv4Resolver { 29 | public: 30 | Ipv4Resolver(); 31 | explicit Ipv4Resolver(Dispatcher& dispatcher); 32 | Ipv4Resolver(const Ipv4Resolver&) = delete; 33 | Ipv4Resolver(Ipv4Resolver&& other); 34 | ~Ipv4Resolver(); 35 | Ipv4Resolver& operator=(const Ipv4Resolver&) = delete; 36 | Ipv4Resolver& operator=(Ipv4Resolver&& other); 37 | Ipv4Address resolve(const std::string& host); 38 | 39 | private: 40 | Dispatcher* dispatcher; 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/TcpConnection.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace System { 26 | 27 | class Dispatcher; 28 | class Ipv4Address; 29 | 30 | class TcpConnection { 31 | public: 32 | TcpConnection(); 33 | TcpConnection(const TcpConnection&) = delete; 34 | TcpConnection(TcpConnection&& other); 35 | ~TcpConnection(); 36 | TcpConnection& operator=(const TcpConnection&) = delete; 37 | TcpConnection& operator=(TcpConnection&& other); 38 | std::size_t read(uint8_t* data, std::size_t size); 39 | std::size_t write(const uint8_t* data, std::size_t size); 40 | std::pair getPeerAddressAndPort() const; 41 | 42 | private: 43 | friend class TcpConnector; 44 | friend class TcpListener; 45 | 46 | Dispatcher* dispatcher; 47 | int connection; 48 | void* readContext; 49 | void* writeContext; 50 | 51 | TcpConnection(Dispatcher& dispatcher, int socket); 52 | }; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/TcpConnector.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | class TcpConnection; 29 | 30 | class TcpConnector { 31 | public: 32 | TcpConnector(); 33 | TcpConnector(Dispatcher& dispatcher); 34 | TcpConnector(const TcpConnector&) = delete; 35 | TcpConnector(TcpConnector&& other); 36 | ~TcpConnector(); 37 | TcpConnector& operator=(const TcpConnector&) = delete; 38 | TcpConnector& operator=(TcpConnector&& other); 39 | TcpConnection connect(const Ipv4Address& address, uint16_t port); 40 | 41 | private: 42 | void* context; 43 | Dispatcher* dispatcher; 44 | }; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/TcpListener.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | class TcpConnection; 29 | 30 | class TcpListener { 31 | public: 32 | TcpListener(); 33 | TcpListener(Dispatcher& dispatcher, const Ipv4Address& address, uint16_t port); 34 | TcpListener(const TcpListener&) = delete; 35 | TcpListener(TcpListener&& other); 36 | ~TcpListener(); 37 | TcpListener& operator=(const TcpListener&) = delete; 38 | TcpListener& operator=(TcpListener&& other); 39 | TcpConnection accept(); 40 | 41 | private: 42 | Dispatcher* dispatcher; 43 | int listener; 44 | void* context; 45 | }; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | 27 | class Timer { 28 | public: 29 | Timer(); 30 | explicit Timer(Dispatcher& dispatcher); 31 | Timer(const Timer&) = delete; 32 | Timer(Timer&& other); 33 | ~Timer(); 34 | Timer& operator=(const Timer&) = delete; 35 | Timer& operator=(Timer&& other); 36 | void sleep(std::chrono::nanoseconds duration); 37 | 38 | private: 39 | Dispatcher* dispatcher; 40 | int timer; 41 | void* context; 42 | }; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/asm.s: -------------------------------------------------------------------------------- 1 | .globl _setmcontext 2 | _setmcontext: 3 | movq 16(%rdi), %rsi 4 | movq 24(%rdi), %rdx 5 | movq 32(%rdi), %rcx 6 | movq 40(%rdi), %r8 7 | movq 48(%rdi), %r9 8 | movq 56(%rdi), %rax 9 | movq 64(%rdi), %rbx 10 | movq 72(%rdi), %rbp 11 | movq 80(%rdi), %r10 12 | movq 88(%rdi), %r11 13 | movq 96(%rdi), %r12 14 | movq 104(%rdi), %r13 15 | movq 112(%rdi), %r14 16 | movq 120(%rdi), %r15 17 | movq 184(%rdi), %rsp 18 | pushq 160(%rdi) /* new %eip */ 19 | movq 8(%rdi), %rdi 20 | ret 21 | 22 | .globl _getmcontext 23 | _getmcontext: 24 | movq %rdi, 8(%rdi) 25 | movq %rsi, 16(%rdi) 26 | movq %rdx, 24(%rdi) 27 | movq %rcx, 32(%rdi) 28 | movq %r8, 40(%rdi) 29 | movq %r9, 48(%rdi) 30 | movq $1, 56(%rdi) /* %rax */ 31 | movq %rbx, 64(%rdi) 32 | movq %rbp, 72(%rdi) 33 | movq %r10, 80(%rdi) 34 | movq %r11, 88(%rdi) 35 | movq %r12, 96(%rdi) 36 | movq %r13, 104(%rdi) 37 | movq %r14, 112(%rdi) 38 | movq %r15, 120(%rdi) 39 | 40 | movq (%rsp), %rcx /* %rip */ 41 | movq %rcx, 160(%rdi) 42 | leaq 8(%rsp), %rcx /* %rsp */ 43 | movq %rcx, 184(%rdi) 44 | 45 | movq 32(%rdi), %rcx /* restore %rcx */ 46 | movq $0, %rax 47 | ret -------------------------------------------------------------------------------- /src/Platform/Linux/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #include "ErrorMessage.h" 20 | #include 21 | #include 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage() { 26 | return errorMessage(errno); 27 | } 28 | 29 | std::string errorMessage(int err) { 30 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/Platform/Linux/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | std::string lastErrorMessage(); 25 | std::string errorMessage(int); 26 | } 27 | -------------------------------------------------------------------------------- /src/Platform/Linux/System/Future.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | namespace Detail { 26 | 27 | template using Future = std::future; 28 | 29 | template Future async(std::function&& operation) { 30 | return std::async(std::launch::async, std::move(operation)); 31 | } 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/Platform/Linux/System/Ipv4Resolver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | class Ipv4Address; 27 | 28 | class Ipv4Resolver { 29 | public: 30 | Ipv4Resolver(); 31 | explicit Ipv4Resolver(Dispatcher& dispatcher); 32 | Ipv4Resolver(const Ipv4Resolver&) = delete; 33 | Ipv4Resolver(Ipv4Resolver&& other); 34 | ~Ipv4Resolver(); 35 | Ipv4Resolver& operator=(const Ipv4Resolver&) = delete; 36 | Ipv4Resolver& operator=(Ipv4Resolver&& other); 37 | Ipv4Address resolve(const std::string& host); 38 | 39 | private: 40 | Dispatcher* dispatcher; 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/Platform/Linux/System/TcpConnection.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | #include "Dispatcher.h" 25 | 26 | namespace System { 27 | 28 | class Ipv4Address; 29 | 30 | class TcpConnection { 31 | public: 32 | TcpConnection(); 33 | TcpConnection(const TcpConnection&) = delete; 34 | TcpConnection(TcpConnection&& other); 35 | ~TcpConnection(); 36 | TcpConnection& operator=(const TcpConnection&) = delete; 37 | TcpConnection& operator=(TcpConnection&& other); 38 | std::size_t read(uint8_t* data, std::size_t size); 39 | std::size_t write(const uint8_t* data, std::size_t size); 40 | std::pair getPeerAddressAndPort() const; 41 | 42 | private: 43 | friend class TcpConnector; 44 | friend class TcpListener; 45 | 46 | Dispatcher* dispatcher; 47 | int connection; 48 | ContextPair contextPair; 49 | 50 | TcpConnection(Dispatcher& dispatcher, int socket); 51 | }; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/Platform/Linux/System/TcpConnector.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | class TcpConnection; 29 | 30 | class TcpConnector { 31 | public: 32 | TcpConnector(); 33 | TcpConnector(Dispatcher& dispatcher); 34 | TcpConnector(const TcpConnector&) = delete; 35 | TcpConnector(TcpConnector&& other); 36 | ~TcpConnector(); 37 | TcpConnector& operator=(const TcpConnector&) = delete; 38 | TcpConnector& operator=(TcpConnector&& other); 39 | TcpConnection connect(const Ipv4Address& address, uint16_t port); 40 | 41 | private: 42 | void* context; 43 | Dispatcher* dispatcher; 44 | }; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/Platform/Linux/System/TcpListener.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | class TcpConnection; 29 | 30 | class TcpListener { 31 | public: 32 | TcpListener(); 33 | TcpListener(Dispatcher& dispatcher, const Ipv4Address& address, uint16_t port); 34 | TcpListener(const TcpListener&) = delete; 35 | TcpListener(TcpListener&& other); 36 | ~TcpListener(); 37 | TcpListener& operator=(const TcpListener&) = delete; 38 | TcpListener& operator=(TcpListener&& other); 39 | TcpConnection accept(); 40 | 41 | private: 42 | Dispatcher* dispatcher; 43 | void* context; 44 | int listener; 45 | }; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/Platform/Linux/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | 27 | class Timer { 28 | public: 29 | Timer(); 30 | explicit Timer(Dispatcher& dispatcher); 31 | Timer(const Timer&) = delete; 32 | Timer(Timer&& other); 33 | ~Timer(); 34 | Timer& operator=(const Timer&) = delete; 35 | Timer& operator=(Timer&& other); 36 | void sleep(std::chrono::nanoseconds duration); 37 | 38 | private: 39 | Dispatcher* dispatcher; 40 | void* context; 41 | int timer; 42 | }; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/Platform/OSX/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #include "ErrorMessage.h" 20 | #include 21 | #include 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage() { 26 | return errorMessage(errno); 27 | } 28 | 29 | std::string errorMessage(int err) { 30 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/Platform/OSX/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | std::string lastErrorMessage(); 25 | std::string errorMessage(int); 26 | } 27 | -------------------------------------------------------------------------------- /src/Platform/OSX/System/Ipv4Resolver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | class Ipv4Address; 27 | 28 | class Ipv4Resolver { 29 | public: 30 | Ipv4Resolver(); 31 | explicit Ipv4Resolver(Dispatcher& dispatcher); 32 | Ipv4Resolver(const Ipv4Resolver&) = delete; 33 | Ipv4Resolver(Ipv4Resolver&& other); 34 | ~Ipv4Resolver(); 35 | Ipv4Resolver& operator=(const Ipv4Resolver&) = delete; 36 | Ipv4Resolver& operator=(Ipv4Resolver&& other); 37 | Ipv4Address resolve(const std::string& host); 38 | 39 | private: 40 | Dispatcher* dispatcher; 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/Platform/OSX/System/TcpConnection.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace System { 26 | 27 | class Dispatcher; 28 | class Ipv4Address; 29 | 30 | class TcpConnection { 31 | public: 32 | TcpConnection(); 33 | TcpConnection(const TcpConnection&) = delete; 34 | TcpConnection(TcpConnection&& other); 35 | ~TcpConnection(); 36 | TcpConnection& operator=(const TcpConnection&) = delete; 37 | TcpConnection& operator=(TcpConnection&& other); 38 | std::size_t read(uint8_t* data, std::size_t size); 39 | std::size_t write(const uint8_t* data, std::size_t size); 40 | std::pair getPeerAddressAndPort() const; 41 | 42 | private: 43 | friend class TcpConnector; 44 | friend class TcpListener; 45 | 46 | Dispatcher* dispatcher; 47 | int connection; 48 | void* readContext; 49 | void* writeContext; 50 | 51 | TcpConnection(Dispatcher& dispatcher, int socket); 52 | }; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/Platform/OSX/System/TcpConnector.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | class TcpConnection; 29 | 30 | class TcpConnector { 31 | public: 32 | TcpConnector(); 33 | TcpConnector(Dispatcher& dispatcher); 34 | TcpConnector(const TcpConnector&) = delete; 35 | TcpConnector(TcpConnector&& other); 36 | ~TcpConnector(); 37 | TcpConnector& operator=(const TcpConnector&) = delete; 38 | TcpConnector& operator=(TcpConnector&& other); 39 | TcpConnection connect(const Ipv4Address& address, uint16_t port); 40 | 41 | private: 42 | void* context; 43 | Dispatcher* dispatcher; 44 | }; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/Platform/OSX/System/TcpListener.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | class TcpConnection; 29 | 30 | class TcpListener { 31 | public: 32 | TcpListener(); 33 | TcpListener(Dispatcher& dispatcher, const Ipv4Address& address, uint16_t port); 34 | TcpListener(const TcpListener&) = delete; 35 | TcpListener(TcpListener&& other); 36 | ~TcpListener(); 37 | TcpListener& operator=(const TcpListener&) = delete; 38 | TcpListener& operator=(TcpListener&& other); 39 | TcpConnection accept(); 40 | 41 | private: 42 | Dispatcher* dispatcher; 43 | int listener; 44 | void* context; 45 | }; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/Platform/OSX/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | 27 | class Timer { 28 | public: 29 | Timer(); 30 | explicit Timer(Dispatcher& dispatcher); 31 | Timer(const Timer&) = delete; 32 | Timer(Timer&& other); 33 | ~Timer(); 34 | Timer& operator=(const Timer&) = delete; 35 | Timer& operator=(Timer&& other); 36 | void sleep(std::chrono::nanoseconds duration); 37 | 38 | private: 39 | Dispatcher* dispatcher; 40 | int timer; 41 | void* context; 42 | }; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/Platform/Posix/System/MemoryMappedFile.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace System { 26 | 27 | class MemoryMappedFile { 28 | public: 29 | MemoryMappedFile(); 30 | ~MemoryMappedFile(); 31 | 32 | void create(const std::string& path, uint64_t size, bool overwrite, std::error_code& ec); 33 | void create(const std::string& path, uint64_t size, bool overwrite); 34 | void open(const std::string& path, std::error_code& ec); 35 | void open(const std::string& path); 36 | void close(std::error_code& ec); 37 | void close(); 38 | 39 | const std::string& path() const; 40 | uint64_t size() const; 41 | const uint8_t* data() const; 42 | uint8_t* data(); 43 | bool isOpened() const; 44 | 45 | void rename(const std::string& newPath, std::error_code& ec); 46 | void rename(const std::string& newPath); 47 | 48 | void flush(uint8_t* data, uint64_t size, std::error_code& ec); 49 | void flush(uint8_t* data, uint64_t size); 50 | 51 | void swap(MemoryMappedFile& other); 52 | 53 | private: 54 | int m_file; 55 | std::string m_path; 56 | uint64_t m_size; 57 | uint8_t* m_data; 58 | }; 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/Platform/Posix/System/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #include "ErrorMessage.h" 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | std::string lastErrorMessage() { 27 | return errorMessage(GetLastError()); 28 | } 29 | 30 | std::string errorMessage(int error) { 31 | struct Buffer { 32 | ~Buffer() { 33 | if (pointer != nullptr) { 34 | LocalFree(pointer); 35 | } 36 | } 37 | 38 | LPTSTR pointer = nullptr; 39 | } buffer; 40 | 41 | auto size = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, nullptr, error, 42 | MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast(&buffer.pointer), 0, nullptr); 43 | return "result=" + std::to_string(error) + ", " + std::string(buffer.pointer, size); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage(); 26 | std::string errorMessage(int); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/Future.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | namespace Detail { 26 | 27 | template using Future = std::future; 28 | 29 | template Future async(std::function&& operation) { 30 | return std::async(std::launch::async, std::move(operation)); 31 | } 32 | 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/Ipv4Resolver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | class Ipv4Address; 27 | 28 | class Ipv4Resolver { 29 | public: 30 | Ipv4Resolver(); 31 | explicit Ipv4Resolver(Dispatcher& dispatcher); 32 | Ipv4Resolver(const Ipv4Resolver&) = delete; 33 | Ipv4Resolver(Ipv4Resolver&& other); 34 | ~Ipv4Resolver(); 35 | Ipv4Resolver& operator=(const Ipv4Resolver&) = delete; 36 | Ipv4Resolver& operator=(Ipv4Resolver&& other); 37 | Ipv4Address resolve(const std::string& host); 38 | 39 | private: 40 | Dispatcher* dispatcher; 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/MemoryMappedFile.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace System { 26 | 27 | class MemoryMappedFile { 28 | public: 29 | MemoryMappedFile(); 30 | ~MemoryMappedFile(); 31 | 32 | void create(const std::string& path, uint64_t size, bool overwrite, std::error_code& ec); 33 | void create(const std::string& path, uint64_t size, bool overwrite); 34 | void open(const std::string& path, std::error_code& ec); 35 | void open(const std::string& path); 36 | void close(std::error_code& ec); 37 | void close(); 38 | 39 | const std::string& path() const; 40 | uint64_t size() const; 41 | const uint8_t* data() const; 42 | uint8_t* data(); 43 | bool isOpened() const; 44 | 45 | void rename(const std::string& newPath, std::error_code& ec); 46 | void rename(const std::string& newPath); 47 | 48 | void flush(uint8_t* data, uint64_t size, std::error_code& ec); 49 | void flush(uint8_t* data, uint64_t size); 50 | 51 | void swap(MemoryMappedFile& other); 52 | 53 | private: 54 | void* m_fileHandle; 55 | void* m_mappingHandle; 56 | std::string m_path; 57 | uint64_t m_size; 58 | uint8_t* m_data; 59 | }; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/TcpConnection.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | 29 | class TcpConnection { 30 | public: 31 | TcpConnection(); 32 | TcpConnection(const TcpConnection&) = delete; 33 | TcpConnection(TcpConnection&& other); 34 | ~TcpConnection(); 35 | TcpConnection& operator=(const TcpConnection&) = delete; 36 | TcpConnection& operator=(TcpConnection&& other); 37 | size_t read(uint8_t* data, size_t size); 38 | size_t write(const uint8_t* data, size_t size); 39 | std::pair getPeerAddressAndPort() const; 40 | 41 | private: 42 | friend class TcpConnector; 43 | friend class TcpListener; 44 | 45 | Dispatcher* dispatcher; 46 | size_t connection; 47 | void* readContext; 48 | void* writeContext; 49 | 50 | TcpConnection(Dispatcher& dispatcher, size_t connection); 51 | }; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/TcpConnector.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | class TcpConnection; 29 | 30 | class TcpConnector { 31 | public: 32 | TcpConnector(); 33 | explicit TcpConnector(Dispatcher& dispatcher); 34 | TcpConnector(const TcpConnector&) = delete; 35 | TcpConnector(TcpConnector&& other); 36 | ~TcpConnector(); 37 | TcpConnector& operator=(const TcpConnector&) = delete; 38 | TcpConnector& operator=(TcpConnector&& other); 39 | TcpConnection connect(const Ipv4Address& address, uint16_t port); 40 | 41 | private: 42 | Dispatcher* dispatcher; 43 | void* context; 44 | }; 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/TcpListener.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | class TcpConnection; 29 | 30 | class TcpListener { 31 | public: 32 | TcpListener(); 33 | TcpListener(Dispatcher& dispatcher, const Ipv4Address& address, uint16_t port); 34 | TcpListener(const TcpListener&) = delete; 35 | TcpListener(TcpListener&& other); 36 | ~TcpListener(); 37 | TcpListener& operator=(const TcpListener&) = delete; 38 | TcpListener& operator=(TcpListener&& other); 39 | TcpConnection accept(); 40 | 41 | private: 42 | Dispatcher* dispatcher; 43 | size_t listener; 44 | void* context; 45 | }; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | 27 | class Timer { 28 | public: 29 | Timer(); 30 | explicit Timer(Dispatcher& dispatcher); 31 | Timer(const Timer&) = delete; 32 | Timer(Timer&& other); 33 | ~Timer(); 34 | Timer& operator=(const Timer&) = delete; 35 | Timer& operator=(Timer&& other); 36 | void sleep(std::chrono::nanoseconds duration); 37 | 38 | private: 39 | Dispatcher* dispatcher; 40 | void* context; 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/Platform/mingw/alloca.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | -------------------------------------------------------------------------------- /src/Platform/msc/alloca.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #ifndef __cplusplus 22 | #define alloca(size) _alloca(size) 23 | #endif 24 | -------------------------------------------------------------------------------- /src/Platform/msc/stdbool.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #if !defined(__cplusplus) 22 | 23 | typedef int bool; 24 | #define true 1 25 | #define false 0 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/Platform/msc/sys/param.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #define LITTLE_ENDIAN 1234 22 | #define BIG_ENDIAN 4321 23 | #define PDP_ENDIAN 3412 24 | #define BYTE_ORDER LITTLE_ENDIAN 25 | -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/Serialization/BlockchainExplorerDataSerialization.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2018, The Karbo developers 3 | // Copyright (c) 2017-2019, The CROAT.community developers 4 | // 5 | // This file is part of Bytecoin. 6 | // 7 | // Bytecoin is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU Lesser General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // Bytecoin is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU Lesser General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU Lesser General Public License 18 | // along with Bytecoin. If not, see . 19 | 20 | #pragma once 21 | 22 | #include "BlockchainExplorerData.h" 23 | 24 | #include "Serialization/ISerializer.h" 25 | 26 | namespace DynexCN { 27 | 28 | void serialize(transactionOutputDetails2& output, ISerializer& serializer); 29 | void serialize(TransactionOutputReferenceDetails& outputReference, ISerializer& serializer); 30 | 31 | void serialize(BaseInputDetails& inputBase, ISerializer& serializer); 32 | void serialize(KeyInputDetails& inputToKey, ISerializer& serializer); 33 | void serialize(MultisignatureInputDetails& inputMultisig, ISerializer& serializer); 34 | void serialize(transactionInputDetails2& input, ISerializer& serializer); 35 | 36 | void serialize(TransactionExtraDetails& extra, ISerializer& serializer); 37 | void serialize(TransactionExtraDetails2& extra, ISerializer& serializer); 38 | void serialize(TransactionDetails& transaction, ISerializer& serializer); 39 | 40 | void serialize(BlockDetails& block, ISerializer& serializer); 41 | 42 | } //namespace DynexCN 43 | -------------------------------------------------------------------------------- /src/Serialization/IStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace DynexCN { 25 | 26 | class IInputStream { 27 | public: 28 | virtual size_t read(char* data, size_t size) = 0; 29 | }; 30 | 31 | class IOutputStream { 32 | public: 33 | virtual void write(const char* data, size_t size) = 0; 34 | }; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Serialization/JsonInputStreamSerializer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #include "Serialization/JsonInputStreamSerializer.h" 20 | 21 | #include 22 | #include 23 | 24 | namespace DynexCN { 25 | 26 | namespace { 27 | 28 | Common::JsonValue getJsonValueFromStreamHelper(std::istream& stream) { 29 | Common::JsonValue value; 30 | stream >> value; 31 | return value; 32 | } 33 | 34 | } 35 | 36 | JsonInputStreamSerializer::JsonInputStreamSerializer(std::istream& stream) : JsonInputValueSerializer(getJsonValueFromStreamHelper(stream)) { 37 | } 38 | 39 | JsonInputStreamSerializer::~JsonInputStreamSerializer() { 40 | } 41 | 42 | } //namespace DynexCN 43 | -------------------------------------------------------------------------------- /src/Serialization/JsonInputStreamSerializer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | #include "../Common/JsonValue.h" 25 | #include "JsonInputValueSerializer.h" 26 | 27 | namespace DynexCN { 28 | 29 | //deserialization 30 | class JsonInputStreamSerializer : public JsonInputValueSerializer { 31 | public: 32 | JsonInputStreamSerializer(std::istream& stream); 33 | virtual ~JsonInputStreamSerializer(); 34 | }; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Serialization/KVBinaryInputStreamSerializer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include "ISerializer.h" 23 | #include "JsonInputValueSerializer.h" 24 | 25 | namespace DynexCN { 26 | 27 | class KVBinaryInputStreamSerializer : public JsonInputValueSerializer { 28 | public: 29 | KVBinaryInputStreamSerializer(Common::IInputStream& strm); 30 | 31 | virtual bool binary(void* value, size_t size, Common::StringView name) override; 32 | virtual bool binary(std::string& value, Common::StringView name) override; 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/Serialization/MemoryStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #include "MemoryStream.h" 20 | -------------------------------------------------------------------------------- /src/Serialization/MemoryStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include // memcpy 24 | #include 25 | #include 26 | 27 | namespace DynexCN { 28 | 29 | class MemoryStream: public Common::IOutputStream { 30 | public: 31 | 32 | MemoryStream() : m_writePos(0) { 33 | } 34 | 35 | virtual size_t writeSome(const void* data, size_t size) override { 36 | if (size == 0) { 37 | return 0; 38 | } 39 | 40 | if (m_writePos + size > m_buffer.size()) { 41 | m_buffer.resize(m_writePos + size); 42 | } 43 | 44 | memcpy(&m_buffer[m_writePos], data, size); 45 | m_writePos += size; 46 | return size; 47 | } 48 | 49 | size_t size() { 50 | return m_buffer.size(); 51 | } 52 | 53 | const uint8_t* data() { 54 | return m_buffer.data(); 55 | } 56 | 57 | void clear() { 58 | m_writePos = 0; 59 | m_buffer.resize(0); 60 | } 61 | 62 | private: 63 | size_t m_writePos; 64 | std::vector m_buffer; 65 | }; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/Serialization/SerializationOverloads.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 2 | // Copyright (c) 2017-2019, The CROAT.community developers 3 | // 4 | // This file is part of Bytecoin. 5 | // 6 | // Bytecoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Bytecoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Bytecoin. If not, see . 18 | 19 | #include "Serialization/SerializationOverloads.h" 20 | 21 | #include 22 | 23 | namespace DynexCN { 24 | 25 | void serializeBlockHeight(ISerializer& s, uint32_t& blockHeight, Common::StringView name) { 26 | if (s.type() == ISerializer::INPUT) { 27 | uint64_t height; 28 | s(height, name); 29 | 30 | if (height == std::numeric_limits::max()) { 31 | blockHeight = std::numeric_limits::max(); 32 | } else if (height > std::numeric_limits::max() && height < std::numeric_limits::max()) { 33 | throw std::runtime_error("Deserialization error: wrong value"); 34 | } else { 35 | blockHeight = static_cast(height); 36 | } 37 | } else { 38 | s(blockHeight, name); 39 | } 40 | } 41 | 42 | void serializeGlobalOutputIndex(ISerializer& s, uint32_t& globalOutputIndex, Common::StringView name) { 43 | serializeBlockHeight(s, globalOutputIndex, name); 44 | } 45 | 46 | } //namespace DynexCN 47 | -------------------------------------------------------------------------------- /src/System/InterruptedException.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "InterruptedException.h" 39 | 40 | namespace { 41 | #ifdef _MSC_VER 42 | char suppressMSVCWarningLNK4221; 43 | #endif 44 | } 45 | -------------------------------------------------------------------------------- /src/Wallet/WalletErrors.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include "WalletErrors.h" 39 | 40 | namespace DynexCN { 41 | namespace error { 42 | 43 | WalletErrorCategory WalletErrorCategory::INSTANCE; 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/WalletGui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2016 The CN developers 2 | Copyright (c) 2012-2017 The Bytecoin developers 3 | Copyright (c) 2014-2017 XDN developers 4 | Copyright (c) 2014-2018 The Monero project 5 | Copyright (c) 2014-2018 The Forknote developers 6 | Copyright (c) 2018-2019 The TurtleCoin developers 7 | Copyright (c) 2016-2022 The Karbo developers 8 | Copyright (c) 2022-2023 Dynex developers 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | -------------------------------------------------------------------------------- /src/WalletGui/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/WalletGui/cryptonotewallet.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON "images\dynex.ico" 2 | -------------------------------------------------------------------------------- /src/WalletGui/gui/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/WalletGui/gui/ui/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/WalletGui/gui/ui/addressbookdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddressBookDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 747 10 | 525 11 | 12 | 13 | 14 | Select address 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Qt::Horizontal 26 | 27 | 28 | 29 | 40 30 | 20 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Choose 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | m_okButton 50 | clicked() 51 | AddressBookDialog 52 | accept() 53 | 54 | 55 | 694 56 | 499 57 | 58 | 59 | 373 60 | 262 61 | 62 | 63 | 64 | 65 | m_addressBookView 66 | doubleClicked(QModelIndex) 67 | AddressBookDialog 68 | accept() 69 | 70 | 71 | 373 72 | 242 73 | 74 | 75 | 373 76 | 262 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/WalletGui/gui/ui/exitwidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ExitWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 385 10 | 66 11 | 12 | 13 | 14 | Saving data 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | %1 wallet is saving data. 28 | Please wait... 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/WalletGui/gui/ui/transactiondetailsdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | TransactionDetailsDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 736 10 | 357 11 | 12 | 13 | 14 | Transaction details 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Qt::Horizontal 26 | 27 | 28 | 29 | 40 30 | 20 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Close 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | m_closeButton 50 | clicked() 51 | TransactionDetailsDialog 52 | accept() 53 | 54 | 55 | 619 56 | 331 57 | 58 | 59 | 335 60 | 178 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/WalletGui/icons/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/WalletGui/icons/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/add.png -------------------------------------------------------------------------------- /src/WalletGui/icons/address-book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/address-book.png -------------------------------------------------------------------------------- /src/WalletGui/icons/cancelled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/cancelled.png -------------------------------------------------------------------------------- /src/WalletGui/icons/clock1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/clock1.png -------------------------------------------------------------------------------- /src/WalletGui/icons/clock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/clock2.png -------------------------------------------------------------------------------- /src/WalletGui/icons/clock3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/clock3.png -------------------------------------------------------------------------------- /src/WalletGui/icons/clock4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/clock4.png -------------------------------------------------------------------------------- /src/WalletGui/icons/clock5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/clock5.png -------------------------------------------------------------------------------- /src/WalletGui/icons/connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/connected.png -------------------------------------------------------------------------------- /src/WalletGui/icons/disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/disconnected.png -------------------------------------------------------------------------------- /src/WalletGui/icons/editcopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/editcopy.png -------------------------------------------------------------------------------- /src/WalletGui/icons/editpaste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/editpaste.png -------------------------------------------------------------------------------- /src/WalletGui/icons/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/export.png -------------------------------------------------------------------------------- /src/WalletGui/icons/lock_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/lock_closed.png -------------------------------------------------------------------------------- /src/WalletGui/icons/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/lock_open.png -------------------------------------------------------------------------------- /src/WalletGui/icons/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/overview.png -------------------------------------------------------------------------------- /src/WalletGui/icons/receive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/receive.png -------------------------------------------------------------------------------- /src/WalletGui/icons/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/remove.png -------------------------------------------------------------------------------- /src/WalletGui/icons/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/send.png -------------------------------------------------------------------------------- /src/WalletGui/icons/sync_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/sync_sprite.png -------------------------------------------------------------------------------- /src/WalletGui/icons/synced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/synced.png -------------------------------------------------------------------------------- /src/WalletGui/icons/transaction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/transaction.png -------------------------------------------------------------------------------- /src/WalletGui/icons/transactions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/transactions.png -------------------------------------------------------------------------------- /src/WalletGui/icons/tx_inout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/tx_inout.png -------------------------------------------------------------------------------- /src/WalletGui/icons/tx_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/tx_input.png -------------------------------------------------------------------------------- /src/WalletGui/icons/tx_mined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/tx_mined.png -------------------------------------------------------------------------------- /src/WalletGui/icons/tx_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/tx_output.png -------------------------------------------------------------------------------- /src/WalletGui/icons/unconfirmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/icons/unconfirmed.png -------------------------------------------------------------------------------- /src/WalletGui/images/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/WalletGui/images/clock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/images/clock.gif -------------------------------------------------------------------------------- /src/WalletGui/images/dynex.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/images/dynex.icns -------------------------------------------------------------------------------- /src/WalletGui/images/dynex.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/images/dynex.ico -------------------------------------------------------------------------------- /src/WalletGui/images/dynex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/images/dynex.png -------------------------------------------------------------------------------- /src/WalletGui/images/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/src/WalletGui/images/splash.png -------------------------------------------------------------------------------- /src/WalletGui/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icons/sync_sprite.png 4 | icons/synced.png 5 | icons/lock_closed.png 6 | icons/lock_open.png 7 | icons/tx_mined.png 8 | icons/editcopy.png 9 | icons/add.png 10 | icons/tx_input.png 11 | icons/tx_output.png 12 | icons/address-book.png 13 | icons/editpaste.png 14 | icons/remove.png 15 | icons/receive.png 16 | icons/transactions.png 17 | icons/send.png 18 | icons/overview.png 19 | icons/clock1.png 20 | icons/clock2.png 21 | icons/clock3.png 22 | icons/clock4.png 23 | icons/clock5.png 24 | icons/transaction.png 25 | icons/connected.png 26 | icons/disconnected.png 27 | icons/export.png 28 | icons/tx_inout.png 29 | icons/unconfirmed.png 30 | icons/cancelled.png 31 | 32 | 33 | images/splash.png 34 | images/dynex.png 35 | images/clock.gif 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/crypto/blake256.h: -------------------------------------------------------------------------------- 1 | #ifndef _BLAKE256_H_ 2 | #define _BLAKE256_H_ 3 | 4 | #include 5 | 6 | typedef struct { 7 | uint32_t h[8], s[4], t[2]; 8 | int buflen, nullt; 9 | uint8_t buf[64]; 10 | } state; 11 | 12 | typedef struct { 13 | state inner; 14 | state outer; 15 | } hmac_state; 16 | 17 | void blake256_init(state *); 18 | void blake224_init(state *); 19 | 20 | void blake256_update(state *, const uint8_t *, uint64_t); 21 | void blake224_update(state *, const uint8_t *, uint64_t); 22 | 23 | void blake256_final(state *, uint8_t *); 24 | void blake224_final(state *, uint8_t *); 25 | 26 | void blake256_hash(uint8_t *, const uint8_t *, uint64_t); 27 | void blake224_hash(uint8_t *, const uint8_t *, uint64_t); 28 | 29 | /* HMAC functions: */ 30 | 31 | void hmac_blake256_init(hmac_state *, const uint8_t *, uint64_t); 32 | void hmac_blake224_init(hmac_state *, const uint8_t *, uint64_t); 33 | 34 | void hmac_blake256_update(hmac_state *, const uint8_t *, uint64_t); 35 | void hmac_blake224_update(hmac_state *, const uint8_t *, uint64_t); 36 | 37 | void hmac_blake256_final(hmac_state *, uint8_t *); 38 | void hmac_blake224_final(hmac_state *, uint8_t *); 39 | 40 | void hmac_blake256_hash(uint8_t *, const uint8_t *, uint64_t, const uint8_t *, uint64_t); 41 | void hmac_blake224_hash(uint8_t *, const uint8_t *, uint64_t, const uint8_t *, uint64_t); 42 | 43 | #endif /* _BLAKE256_H_ */ 44 | -------------------------------------------------------------------------------- /src/crypto/chacha8.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #define CHACHA8_KEY_SIZE 32 7 | #define CHACHA8_IV_SIZE 8 8 | 9 | #if defined(__cplusplus) 10 | #include 11 | #include 12 | 13 | #include "hash.h" 14 | 15 | namespace Crypto { 16 | extern "C" { 17 | #endif 18 | void chacha8(const void* data, size_t length, const uint8_t* key, const uint8_t* iv, char* cipher); 19 | #if defined(__cplusplus) 20 | } 21 | 22 | #pragma pack(push, 1) 23 | struct chacha8_key { 24 | uint8_t data[CHACHA8_KEY_SIZE]; 25 | 26 | ~chacha8_key() 27 | { 28 | memset(data, 0, sizeof(data)); 29 | } 30 | }; 31 | 32 | // MS VC 2012 doesn't interpret `class chacha8_iv` as POD in spite of [9.0.10], so it is a struct 33 | struct chacha8_iv { 34 | uint8_t data[CHACHA8_IV_SIZE]; 35 | }; 36 | #pragma pack(pop) 37 | 38 | static_assert(sizeof(chacha8_key) == CHACHA8_KEY_SIZE && sizeof(chacha8_iv) == CHACHA8_IV_SIZE, "Invalid structure size"); 39 | 40 | inline void chacha8(const void* data, size_t length, const chacha8_key& key, const chacha8_iv& iv, char* cipher) { 41 | chacha8(data, length, reinterpret_cast(&key), reinterpret_cast(&iv), cipher); 42 | } 43 | 44 | inline void generate_chacha8_key(Crypto::cn_context &context, const std::string& password, chacha8_key& key) { 45 | /* 46 | static_assert(sizeof(chacha8_key) <= sizeof(Hash), "Size of hash must be at least that of chacha8_key"); 47 | Hash pwd_hash; 48 | cn_slow_hash(context, password.data(), password.size(), pwd_hash); 49 | memcpy(&key, &pwd_hash, sizeof(key)); 50 | memset(&pwd_hash, 0, sizeof(pwd_hash)); // better use memset_s 51 | */ 52 | static_assert(sizeof(chacha8_key) == sizeof(Hash), "Size of hash must be equal to chacha8_key"); 53 | // write directly 54 | cn_slow_hash(password.data(), password.size(), reinterpret_cast(&key.data)); 55 | } 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/crypto/groestl.h: -------------------------------------------------------------------------------- 1 | #ifndef __hash_h 2 | #define __hash_h 3 | /* 4 | #include "crypto_uint8.h" 5 | #include "crypto_uint32.h" 6 | #include "crypto_uint64.h" 7 | #include "crypto_hash.h" 8 | 9 | typedef crypto_uint8 uint8_t; 10 | typedef crypto_uint32 uint32_t; 11 | typedef crypto_uint64 uint64_t; 12 | */ 13 | #include 14 | 15 | /* some sizes (number of bytes) */ 16 | #define ROWS 8 17 | #define LENGTHFIELDLEN ROWS 18 | #define COLS512 8 19 | 20 | #define SIZE512 (ROWS*COLS512) 21 | 22 | #define ROUNDS512 10 23 | #define HASH_BIT_LEN 256 24 | 25 | #define ROTL32(v, n) ((((v)<<(n))|((v)>>(32-(n))))&li_32(ffffffff)) 26 | 27 | 28 | #define li_32(h) 0x##h##u 29 | #define EXT_BYTE(var,n) ((uint8_t)((uint32_t)(var) >> (8*n))) 30 | #define u32BIG(a) \ 31 | ((ROTL32(a,8) & li_32(00FF00FF)) | \ 32 | (ROTL32(a,24) & li_32(FF00FF00))) 33 | 34 | 35 | /* NIST API begin */ 36 | typedef unsigned char BitSequence; 37 | typedef unsigned long long DataLength; 38 | typedef struct { 39 | uint32_t chaining[SIZE512/sizeof(uint32_t)]; /* actual state */ 40 | uint32_t block_counter1, 41 | block_counter2; /* message block counter(s) */ 42 | BitSequence buffer[SIZE512]; /* data buffer */ 43 | int buf_ptr; /* data buffer pointer */ 44 | int bits_in_last_byte; /* no. of message bits in last byte of 45 | data buffer */ 46 | } hashState; 47 | 48 | /*void Init(hashState*); 49 | void Update(hashState*, const BitSequence*, DataLength); 50 | void Final(hashState*, BitSequence*); */ 51 | void groestl(const BitSequence*, DataLength, BitSequence*); 52 | /* NIST API end */ 53 | 54 | /* 55 | int crypto_hash(unsigned char *out, 56 | const unsigned char *in, 57 | unsigned long long len); 58 | */ 59 | 60 | #endif /* __hash_h */ 61 | -------------------------------------------------------------------------------- /src/crypto/hash-extra-blake.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #include 39 | #include 40 | 41 | #include "blake256.h" 42 | 43 | void hash_extra_blake(const void *data, size_t length, char *hash) { 44 | blake256_hash((uint8_t*)hash, data, length); 45 | } 46 | -------------------------------------------------------------------------------- /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) 2021-2023, Dynex Developers 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 project are originally copyright by: 30 | // Copyright (c) 2012-2016, The CN developers, The Bytecoin developers 31 | // Copyright (c) 2014-2018, The Monero project 32 | // Copyright (c) 2014-2018, The Forknote developers 33 | // Copyright (c) 2018, The TurtleCoin developers 34 | // Copyright (c) 2016-2018, The Karbowanec developers 35 | // Copyright (c) 2017-2022, The CROAT.community developers 36 | 37 | 38 | #pragma once 39 | 40 | #if !defined(__cplusplus) 41 | #include 42 | #endif 43 | 44 | void generate_random_bytes(size_t n, void *result); 45 | -------------------------------------------------------------------------------- /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/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() 12 | -------------------------------------------------------------------------------- /src/version.h.in: -------------------------------------------------------------------------------- 1 | #define BUILD_COMMIT_ID "@VERSION@" 2 | 3 | #define STR_HELPER(x) #x 4 | #define STR(x) STR_HELPER(x) 5 | 6 | #define CN_PROJECT_NAME "Dynex" 7 | #define CN_PROJECT_SITE "https://dynexcoin.org" 8 | #define CN_PROJECT_COPYRIGHT "Copyright (c) 2022-2024 Dynex Developers" 9 | #define CN_VER_REMARK "#non-privacy" 10 | 11 | // parsed by CMake 12 | #define CN_VER_BUILD 20240401 13 | #define CN_VER_MAJOR 2 14 | #define CN_VER_MINOR 2 15 | #define CN_VER_REV 2 16 | #define CN_VER_WAL 7 17 | 18 | //#define PROJECT_VERSION "2.2.2" 19 | //#define PROJECT_VERSION_BUILD_NO "1" 20 | //#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")" 21 | 22 | #define CN_PROJECT_VERSION STR(CN_VER_MAJOR) "." STR(CN_VER_MINOR) "." STR(CN_VER_REV) 23 | #define CN_PROJECT_VERSION_BUILD_NO STR(CN_VER_BUILD) 24 | #define CN_PROJECT_VERSION_LONG CN_PROJECT_VERSION "-" CN_PROJECT_VERSION_BUILD_NO " (" CN_VER_REMARK ")" 25 | #define CN_PROJECT_DESCRIPTION CN_PROJECT_NAME " v. " CN_PROJECT_VERSION_LONG 26 | #define CN_WALLET_REV "." STR(CN_VER_WAL) 27 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dynexcoin/Dynex/617034473bfdb043d5dad3e90ac8c96bf75bc11a/tests/CMakeLists.txt -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------