summaryrefslogtreecommitdiff
path: root/crates/tor-geoip/src
Commit message (Collapse)AuthorAgeFilesLines
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* Disable a lot of dead code warningsIan Jackson2024-10-171-0/+3
| | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Run maint/add_warning.Nick Mathewson2024-03-131-0/+1
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-231-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* tor-geoip: Fix a doc warningIan Jackson2023-07-211-1/+1
| | | | | | | | | | | | cargo doc --locked --document-private-items --workspace --all-features warning: unclosed HTML tag `CountryCode` --> crates/tor-geoip/src/lib.rs:90:54 | 90 | /// We store these as NonZeroU8 so that an Option<CountryCode> only has to | ^^^^^^^^^^^^^ | = note: `#[warn(rustdoc::invalid_html_tags)]` on by default
* Merge branch 'cc_niche' into 'main'Nick Mathewson2023-07-201-5/+37
|\ | | | | | | | | geoip: Enable the niche optimization for CountryCode. See merge request tpo/core/arti!1384
| * geoip: Use from_raw_parts instead of transmute.gabi-2502023-07-131-1/+5
| |
| * geoip: Enable the niche optimization for CountryCode.Nick Mathewson2023-07-071-5/+33
| | | | | | | | | | | | | | | | Since we're going to be using `Option<CountryCode>` all over, let's save the extra byte. Sadly this required std::mem::transmute(), which is unsafe, so maybe we should think twice.
* | geoip: Add derive macros to GeoipDbjuga2023-07-181-0/+1
| | | | | | | | to be able to debug it, for instance.
* | geoip: Allow ASNs as zeros when creating NetDefnjuga2023-07-181-6/+2
| | | | | | | | | | | | | | so that GeoipDb can be created from files including ASNs generated with tor/scripts/maint/geoip/geoip-db-tool. Closes #961
* | Add country codes to relays inside a NetDireta2023-07-131-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | - When the `geoip` feature flag of `tor-netdir` is enabled, perform GeoIP lookups for all relays added to the directory and add the resulting country code to the `Relay` struct. - The GeoIP database is provided in a new `PartialNetDir::new_with_geoip` constructor. - A new trait was also added to `tor-linkspec`, `HasCountryCode`, to enable getting this data out from other crates. Part of onionmasq#47.
* | Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+2
|/
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* geoip: conditionalise a testIan Jackson2023-06-281-0/+1
| | | | | Without this, the build fails with cargo test --workspace --no-default-features --features=tokio,native-tls
* Merge branch 'stderr' into 'main'Alexander Færøy2023-06-211-0/+2
|\ | | | | | | | | lints: Promote clippy::print_stderr and clippy::print_stdout See merge request tpo/core/arti!1271
| * lints: Run maint/add_warning to actually apply new lints (again)Ian Jackson2023-06-211-0/+2
| | | | | | | | | | I prepared 161b9844d against an earlier version of main without the geoip crate. Run maint/add_warning again.
* | geoip: Add a few more tests.Nick Mathewson2023-06-201-1/+59
| |
* | geoip: Explain in more detail what a CountryCode is to us.Nick Mathewson2023-06-201-1/+14
| |
* | geoip: require that ccs actually are printable ascii.Nick Mathewson2023-06-201-3/+8
| | | | | | | | | | | | (There are plenty of strings that convert into 2 bytes of UTF8 without being two ascii characters, and there are plenty of sequences of two ascii characters that aren't printable.)
* | geoip: Make ?? a little more bullet-proofNick Mathewson2023-06-202-5/+50
|/ | | | We want to make sure that ?? is always None, never a CountryCode.
* tor-geoip: Add new crate with GeoIP database functionalityeta2023-06-202-0/+362
- This adds a new crate, `tor-geoip`, which can parse and perform lookups in the GeoIP database C-tor already uses (generated by a maintenance utility in the C-tor codebase). - We embed a copy of C-tor's databases with the crate and use `include_str!` to ship them with the binary, bloating its size somewhat. - This does, however, solve the problem of figuring out how to distribute these. - The plan is to gate this functionality behind a feature flag anyway, so the cost should be nil unless explicitly opted into. Part of tpo/core/onionmasq#47.