about summary refs log tree commit diff
path: root/src/libstd/net/ip.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-2731/+0
2020-05-29Rollup merge of #72407 - Lucretiel:ipv6-display, r=Mark-SimulacrumRalf Jung-80/+78
Various minor improvements to Ipv6Addr::Display Cleaned up `Ipv6Addr::Display`, especially with an eye towards simplifying and reducing duplicated logic. Also added a fast-path optimization, similar to #72399 and #72398. - Defer to `Ipv4Addr::fmt` when printing an Ipv4 address - Fast path: write directly to `f` without an intermediary buffer when there are no alignment options - Simplify finding the inner zeroes-span
2020-05-20Various minor improvements to Ipv6Addr::DisplayNathan West-80/+78
- Defer to Ipv4Addr::fmt when printing an Ipv4 address - Fast path: write directly to f without an intermediary buffer when there are no alignment options - Simplify finding the inner zeroes-span
2020-05-20Add fast-path optimization for Ipv4Addr::fmtNathan West-9/+16
2020-03-06fix various typosMatthias Krüger-1/+1
2020-01-29Document remaining undocumented `From` implementations for IPsLeSeulArtichaut-0/+72
2020-01-08Use matches macro in libcore and libstdIgor Aleksanov-8/+2
2019-12-26Implement padding for IpAddr without heap allocDario Gonzalez-13/+80
2019-12-22Format the worldMark Rousskov-199/+258
2019-12-18Propagate cfg bootstrapMark Rousskov-4/+4
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-0/+4
functions with a `const` modifier
2019-11-13Fix broken links in Ipv4Addr::is_benchmarking docsBenjamin Sago-2/+2
2019-11-10Rollup merge of #66058 - mjptree:patch-2, r=kennytmYuki Okushi-1/+1
Correct deprecated `is_global` IPv6 documentation This method does currently not return false for the `site_local` unicast address space. The documentation of the `is_unicast_global` method on lines 1352 - 1382 suggests that this is intentional as the site-local prefix must no longer be supported in new implementations, thus the documentation can safely be updated to reflect that information. If not so, either the `is_unicast_global` method should be updated to exclude the unicast site-local address space, or the `is_global` method itself.
2019-11-09Update src/libstd/net/ip.rs mjptree-1/+1
I assumed some sort of Oxford-comma case here, bit have to admit English is not my first language. Co-Authored-By: kennytm <kennytm@gmail.com>
2019-11-03 Correct deprecated `is_global` IPv6 documentationmjptree-1/+1
This method does currently not return false for the `site_local` unicast address space. The documentation of the `is_unicast_global` method on lines 1352 - 1382 suggests that this is intentional as the site-local prefix must no longer be supported in new implementations, thus the documentation can safely be updated to reflect that information. If not so, either the `is_unicast_global` method should be updated to exclude the unicast site-local address space, or the `is_global` method itself.
2019-11-02Correct error in documentation for Ipv4Addr methodmjptree-1/+1
Correct statement in doctests on line 539 of `is_global` method of the `Ipv4Addr` object, which falsely attributed the tests to the broadcast address.
2019-10-01Remove unneeded `fn main` blocks from docsLzu Tao-135/+102
2019-04-23std::net: tests for Ipv4addr::is_shared()Corentin Henry-0/+15
2019-04-23std::net: add warning in Ipv4addr::is_reserved() documentationCorentin Henry-0/+7
See @the8472 comment's on Github: https://github.com/rust-lang/rust/pull/60145#issuecomment-485424229 > I don't think is_reserved including ranges marked for future use is > a good idea since those future uses may be realized at at some point > and then old software with is_reserved filters may have false > positives. This is not a hypothetical concern, such issues have been > encountered before when IANA assigned previously reserved /8 address > blocks.
2019-04-23std::net: add warning in Ipv6Addr::is_unicast_site_local() docCorentin Henry-0/+8
site-local addresses are deprecated, so we should warn users about it.
2019-04-22std::net: tests for Ipv4addr::is_reserved()Corentin Henry-0/+15
Also add tests to IpAddr for make sure these addresses are not global or multicast.
2019-04-22std::net: tests for Ipv4addr::is_ietf_protocol_assignment()Corentin Henry-0/+16
Also add tests to IpAddr to make sure these addresses are not global.
2019-04-22std::net: tests for Ipv4addr::is_benchmarking()Corentin Henry-16/+30
also add test to Ipaddr, making sure that these addresses are not global.
2019-04-22std::net: tests for Ipv6addr::is_unicast_link_local{_strict}()Corentin Henry-20/+49
2019-04-22std::net: fix tests for site-local ipv6 addressesCorentin Henry-2/+2
Ipv6Addr::is_unicast_global() now returns `true` for unicast site local addresses, since they are deprecated.
2019-04-22std::net: fix Ipv4addr::is_global() testsCorentin Henry-4/+4
Ipv4addr::is_global() previously considered 0/8 was global, but has now been fixed, so these tests needed to be fixed as well.
2019-04-22std::net: use macros to test ip propertiesCorentin Henry-143/+381
2019-04-22std::net: fix documentation markdownCorentin Henry-3/+5
2019-04-22std::net: fix Ipv4Addr::is_global()Corentin Henry-8/+64
As per @therealbstern's comment[0]: The implementation of Ipv4::is_global is not complete, according to the IANA IPv4 Special-Purpose Address Registry. - It compares the address to 0.0.0.0, but anything in 0.0.0.0/8 should not be considered global. - 0/8 is not global and is currently forbidden because some systems used to treat it as the local network. - The implementation of Ipv4::is_unspecified is correct. 0.0.0.0 is the unspecified address. - It does not examine 100.64.0.0/10, which is "Shared Address Space" and not global. - Ditto 192.0.0.0/24 (IETF Protocol Assignments), except for 192.0.0.9/32 and 192.0.0.10/32, which are carved out as globally reachable. - 198.18.0.0/15 is for "Benchmarking" and should not be globally reachable. - 240.0.0.0/4 is reserved and not currently reachable
2019-04-22std::net: add Ipv4Addr::is_shared()Corentin Henry-0/+22
2019-04-22std::net: add Ipv4Addr::is_ietf_protocol_assignment()Corentin Henry-0/+34
2019-04-22std::net: add Ipv4Addr::is_benchmarking()Corentin Henry-0/+25
2019-04-22std::net: add Ipv4Addr::is_reserved()Corentin Henry-0/+28
2019-04-20std::net: fix doc markdown in Ipv6Addr::is_unique_local()Corentin Henry-1/+1
2019-04-20std::net: add Ipv6Addr::is_unicast_link_local_strict()Corentin Henry-6/+96
RFC 4291 is a little unclear about what is a unicast link local address. According to section 2.4, the entire fe80::/10 range is reserved for these addresses, but section 2.5.3 defines a stricter format for such addresses. After a discussion[0] is has been decided to add a different method for each definition, so this commit: - renames is_unicast_link_local() into is_unicast_link_local_strict() - relaxed the check in is_unicast_link_local() [0]: https://github.com/rust-lang/rust/issues/27709#issuecomment-400370706
2019-04-20std::net: improve Ipv6Addr::is_unicast_site_local() docCorentin Henry-2/+11
- quote the RFC - add a link to the RFC - fix markdown
2019-04-20std::net: site-local ipv6 prefixes are globalCorentin Henry-4/+14
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-6/+6
2019-02-28libstd => 2018Taiki Endo-8/+8
2019-02-20Rollup merge of #58392 - scottmcm:less-shifting-in-net-ip, r=oli-obkkennytm-25/+58
Use less explicit shifting in std::net::ip Now that we have `{to|from}_be_bytes` the code can be simpler. (Inspired by PR #57740)
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-5/+5
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-11Use less explicit shifting in std::net::ipScott McMurray-25/+58
Now that we have {to|from}_be_bytes the code can be simpler. (Inspired by PR #57740)
2019-02-10libs: doc commentsAlexander Regueiro-5/+5
2019-02-10Rollup merge of #57740 - JakubOnderka:ipv4addr-to_ne_bytes, r=scottmcmGuillaume Gomez-2/+1
Use `to_ne_bytes` for converting IPv4Addr to octets It is easier and it should be also faster, because [`to_ne_bytes`](https://doc.rust-lang.org/std/primitive.u32.html#method.to_ne_bytes) just calls `mem::transmute`.
2019-01-26Bump bootstrap compiler to 1.33 betaMark Rousskov-1/+0
2019-01-18Use `to_ne_bytes` for converting IPv4Address to octetsJakub Onderka-2/+1
It is easier and it should be also faster, because `to_ne_bytes` just calls `mem::transmute`.
2018-12-31const-stabilize Ipv4Addr::newMazdak Farrokhzad-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-1/+1
fix various typos in doc comments
2018-11-13fix various typos in doc commentsAndy Russell-1/+1