summaryrefslogtreecommitdiff
path: root/src/common/dns_utils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* wallet-rpc: enable openaliasstoffu2017-03-171-3/+5
|
* update copyright year, fix occasional lack of newline at line endRiccardo Spagni2017-02-211-1/+1
|
* dns_utils: fix infinite recursion when distributing empty dns_urlsanonimal2017-02-211-0/+3
| | | | | | load_txt_records_from_dns attempts to distribute `a = 0, b = -1` where (b = dns_urls.size() - 1) and IntType is signed integer. This results in an infinite recursion which leads to SIGSEGV.
* dns_utils: fix first checked DNS entry being ignoredmoneromooo-monero2017-02-201-1/+0
|
* dns_utils: factor TXT record loading code from checkpoint codemoneromooo-monero2017-02-201-0/+103
|
* extract some basic code from libcryptonote_core into libcryptonote_basickenshi842017-02-081-1/+1
|
* moved get_account_address_from_str_or_url from libcommon to libcryptonote_corekenshi842017-01-241-16/+0
|
* Change logging to easylogging++moneromooo-monero2017-01-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the epee and data_loggers logging systems with a single one, and also adds filename:line and explicit severity levels. Categories may be defined, and logging severity set by category (or set of categories). epee style 0-4 log level maps to a sensible severity configuration. Log files now also rotate when reaching 100 MB. To select which logs to output, use the MONERO_LOGS environment variable, with a comma separated list of categories (globs are supported), with their requested severity level after a colon. If a log matches more than one such setting, the last one in the configuration string applies. A few examples: This one is (mostly) silent, only outputting fatal errors: MONERO_LOGS=*:FATAL This one is very verbose: MONERO_LOGS=*:TRACE This one is totally silent (logwise): MONERO_LOGS="" This one outputs all errors and warnings, except for the "verify" category, which prints just fatal errors (the verify category is used for logs about incoming transactions and blocks, and it is expected that some/many will fail to verify, hence we don't want the spam): MONERO_LOGS=*:WARNING,verify:FATAL Log levels are, in decreasing order of priority: FATAL, ERROR, WARNING, INFO, DEBUG, TRACE Subcategories may be added using prefixes and globs. This example will output net.p2p logs at the TRACE level, but all other net* logs only at INFO: MONERO_LOGS=*:ERROR,net*:INFO,net.p2p:TRACE Logs which are intended for the user (which Monero was using a lot through epee, but really isn't a nice way to go things) should use the "global" category. There are a few helper macros for using this category, eg: MGINFO("this shows up by default") or MGINFO_RED("this is red"), to try to keep a similar look and feel for now. Existing epee log macros still exist, and map to the new log levels, but since they're used as a "user facing" UI element as much as a logging system, they often don't map well to log severities (ie, a log level 0 log may be an error, or may be something we want the user to see, such as an important info). In those cases, I tried to use the new macros. In other cases, I left the existing macros in. When modifying logs, it is probably best to switch to the new macros with explicit levels. The --log-level options and set_log commands now also accept category settings, in addition to the epee style log levels.
* make openalias also available for solo miner; introduce namespace ↵kenshi842016-12-211-0/+143
| | | | tools::dns_utils; support integrated address with dns lookup
* dns_utils: const compatibility with older libunboundmoneromooo-monero2016-02-231-22/+16
| | | | https://www.nlnetlabs.nl/bugs-script/show_bug.cgi?id=515
* std::condvar is broken on Win32 with gcc/g++ 4.8 tooHoward Chu2016-02-181-2/+2
| | | | Use boost...
* updated copyright yearRiccardo Spagni2015-12-311-1/+1
|
* Replace tabs and remove trailing whitespacewarptangent2015-12-151-24/+24
|
* Optionally restrict DNS queries to TCPwarptangent2015-12-151-3/+24
| | | | | | | | | | | | | | | | | Sample use: DNS_PUBLIC=tcp torsocks bin/bitmonerod --p2p-bind-ip 127.0.0.1 Test: Run above with --log-level 4 with and without DNS_PUBLIC environment variable set. DNS debugging info should show successful DNS lookups only when DNS_PUBLIC is set to "tcp": DNS lookup for seeds.moneroseeds.se: 17 results DNS lookup for seeds.moneroseeds.ae.org: 17 results DNS lookup for seeds.moneroseeds.ch: 12 results DNS lookup for seeds.moneroseeds.li: 12 results
* dns_utils: fix wrong assertsmoneromooo-monero2015-09-271-2/+2
| | | | Braino.
* dns_utils: remove unnecessary string conversionmoneromooo-monero2015-08-301-5/+2
|
* dns_utils: factor the fetching code for different DNS record typesmoneromooo-monero2015-08-301-59/+21
|
* dns_utils: simplify string handling and fix leakmoneromooo-monero2015-08-301-5/+1
|
* dns_utils: add a const where possiblemoneromooo-monero2015-08-271-1/+1
|
* dns_utils: lock access to the singletonmoneromooo-monero2015-08-271-0/+4
| | | | This avoids races which could result in two objects being created
* dns: make ctor privatemoneromooo-monero2015-08-271-0/+5
| | | | | | | This ensures one can't instanciate a DNSResolver object by mistake, but uses the singleton. A separate create static function is added for cases where a new object is explicitely needed.
* Set dnssec_valid value correctly in dns_utils; fix address_from_url testRostislav2015-06-201-3/+3
|
* dns_utils: simpify smart pointer use, and use for url strings toomoneromooo-monero2015-06-071-38/+45
| | | | OK, I admit I wanted to template this struct for fun too.
* Allow name@domain.tld for OpenAlias lookupswarptangent2015-05-191-0/+13
| | | | | | | | | | | | | | | | | | Based on tewinget's update. Make OpenAlias address format independent of existing DNS functions. Add tests. Test: make debug-test cd build/debug/tests/unit_tests # test that regular DNS functions work, including IPv4 lookups. # also test function that converts OpenAlias address format make && ./unit_tests --gtest_filter=DNSResolver* # test that OpenAlias addresses like donate@getmonero.org work from # wallet tools make && ./unit_tests --gtest_filter=AddressFromURL.Success
* Revert "Allow name@domain.tld for OpenAlias lookups"warptangent2015-05-191-21/+13
| | | | This reverts commit b18368b635ba08aea541ef52ebc74180822644a2.
* Allow name@domain.tld for OpenAlias lookupsThomas Winget2015-04-291-13/+21
|
* [fix] log level change. compilation: dns, testsrfree2monero2015-04-101-1/+1
| | | | | old unbound #warning does not block compilation unit tests build fine. Even though the RPC/P2P network type is required again
* Merge pull request #252Riccardo Spagni2015-04-021-1/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 618f20c Network 1.7; Quieted the debug a bit. (rfree2monero) 391c7f9 Utils: use const, document dbg. Less default debug (rfree2monero) 44f4234 [fix] mac os x includes std::random... (rfree2monero) 162c993 Network 1.6: network limits, logging, +doxy (rfree2monero) a3b2226 my changelog (rfree2monero) 2900b1e doxygen files (rfree2monero) 1489310 doxygen related tool (rfree2monero) f9dba47 added windows_stream.* console colors (rfree2monero) c511abf remerged; commands JSON. logging upgrade. doxygen (rfree2monero) f79821a fix locking in count-peers thread (2) (rfree2monero) 0198ffb 2014 network limit 1.3 fix log/path/data +utils (rfree2monero) ae2a506 2014 network limit 1.2 +utils +toc -doc -drmonero (rfree2monero) 0f06dca fixed size_t on windows (rfree2monero) 39fc63f removed not needed <netinet/in.h> (rfree2monero) 5ce4256 2014 network limit 1.1 +utils +toc -doc -drmonero (rfree2monero) eabb519 2014 network limit 1.0a +utils +toc -doc -drmonero (rfree2monero)
| * remerged; commands JSON. logging upgrade. doxygenrfree2monero2015-04-011-1/+18
| |
* | Fixed DNS resolution bug in WindowsThomas Winget2015-04-021-4/+2
|/ | | | | | | | | | | | Due to a bug in unbound, we were passing a string containing a null character to ub_ctx_resolvconf and ub_ctx_hosts rather than a NULL pointer. On *nix this wasn't causing headache, but on Windows this was causing unbound to not correctly load DNS settings from the OS. Note on the bug: in a Windows-specific code branch in the function ub_ctx_hosts(), if the hosts file specified was a NULL pointer, a call to getenv() was stored in a local char* and later freed. This is incorrect, as we do not own that data, and caused the program to crash.
* DNSSEC added (hardcoded key)Thomas Winget2015-03-241-0/+66
| | | | | | | | DNSSEC is now implemented with the hardcoded key from unbound. This will need to be not hardcoded in the future, but is okay for now. Unit tests updated for DNSSEC (as well as for the fact that, contrary to previous assumption, example.com does not have a static IP address).
* year updated in licenseRiccardo Spagni2015-01-021-1/+1
|
* build libunbound from external if no local libunbound or for static buildsRiccardo Spagni2014-10-061-1/+2
|
* quick hacky fix for broken TXT readsRiccardo Spagni2014-10-031-1/+9
|
* updated DNSResolver/things that use it for DNSSECThomas Winget2014-09-301-3/+9
| | | | | | | Note: DNSResolver does not yet *use* DNSSEC, but rather this commit is preparation for including DNSSEC validation. The function in src/wallet/wallet2.cpp that uses DNSResolver still needs its parameters updated accordingly.
* Remove LDNS dep and fix a bug in libunbound const correctness fixThomas Winget2014-09-241-3/+3
|
* Removed ldns dependencyThomas Winget2014-09-241-4/+3
| | | | | | ldns dependency was only still around for constants defined in ldns/rr.h, but those constants are RFC specified DNS constants, and to reduce deps have been replicated in dns_utils.h instead of including ldns/rr.h.
* libunbound has const correctness issues...Thomas Winget2014-09-241-5/+19
|
* temp commitThomas Winget2014-09-241-15/+42
|
* Added function to check syntax of URL for DNS lookupThomas Winget2014-09-231-8/+35
| | | | | For now, simply checks for '.' character, but that will be easy to change in the future if necessary/desired.
* change to allow (at least a bit) for multiple TXT recordsThomas Winget2014-09-231-5/+10
|
* Monero addres from DNS TXT record implemented, tests passThomas Winget2014-09-231-17/+40
| | | | Still need to deal with DNSSEC and optional fields in the TXT record.
* Use the loop iterator, previous version of me.Thomas Winget2014-09-231-2/+2
|
* ipv4 and ipv6 resolution workingThomas Winget2014-09-231-11/+92
| | | | | | IPv4 and IPv6 name resolution working. Unit tests written (and passing). net_node.{h,inl} code modified to use DNS seeds.
* Initial commit of DNS codeThomas Winget2014-09-231-0/+55