about summary refs log tree commit diff
path: root/src/libstd/net/ip.rs
AgeCommit message (Collapse)AuthorLines
2016-10-03Add two functions to check type of given addressAbhishek Chanda-0/+32
The is_v4 function returns true if the given IP is v4. The is_v6 function returns true if the IP is v6.
2016-10-01std: Correct stability attributes for some implementationsOliver Middleton-2/+1
These are displayed by rustdoc so should be correct.
2016-09-30Ignore entire test modules on emscripten instead of individual testsBrian Anderson-1/+1
2016-09-13Add doc examples for std::net::IpAddr construction.Corey Farwell-0/+18
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-1/+0
2016-08-19std: Stabilize APIs for the 1.12 releaseAlex Crichton-10/+5
Stabilized * `Cell::as_ptr` * `RefCell::as_ptr` * `IpAddr::is_{unspecified,loopback,multicast}` * `Ipv6Addr::octets` * `LinkedList::contains` * `VecDeque::contains` * `ExitStatusExt::from_raw` - both on Unix and Windows * `Receiver::recv_timeout` * `RecvTimeoutError` * `BinaryHeap::peek_mut` * `PeekMut` * `iter::Product` * `iter::Sum` * `OccupiedEntry::remove_entry` * `VacantEntry::into_key` Deprecated * `Cell::as_unsafe_cell` * `RefCell::as_unsafe_cell` * `OccupiedEntry::remove_pair` Closes #27708 cc #27709 Closes #32313 Closes #32630 Closes #32713 Closes #34029 Closes #34392 Closes #34285 Closes #34529
2016-07-20Auto merge of #34694 - mathphreak:master, r=alexcrichtonbors-0/+121
Add IpAddr common methods Per https://github.com/rust-lang/rfcs/pull/1668#issuecomment-230867962 no RFC is needed here. The generated documentation for these methods is being weird. It shows a deprecation message referencing #27709 for each of them even though two of the referenced methods were stabilized as part of that issue. I don't know how best to address that.
2016-07-11Mark Ipv4Addr is_unspecified as stable and provide reference.Ben Stern-0/+4
2016-07-07Add links to Ipv*Addr methods in docsMatt Horn-5/+15
per https://github.com/rust-lang/rust/pull/34694#issuecomment-231126489
2016-07-06Properly mark new methods as unstableMatt Horn-5/+8
2016-07-06Mark new methods as unstableMatt Horn-0/+5
2016-07-06Add IpAddr common methodsMatt Horn-0/+103
2016-06-13Improve IP reserved address docsOliver Middleton-20/+35
- Add links to all RFCs to make it clear these are not Rust RFCs. - Correct RFC numbers to match the numbers in [RFC 6890](https://tools.ietf.org/html/rfc6890) - Clean up formatting to show addresses and ranges in parentheses like (255.255.255.255)
2016-05-26Make Ipv4Addr cmp() fasterAlexander Polyakov-1/+1
2016-05-07Rollup merge of #33439 - birkenfeld:ip-rfc-refs, r=steveklabnikSteve Klabnik-5/+5
doc: make RFC references consistent Always add a space and end sentence with a full stop.
2016-05-05doc: make RFC references consistentGeorg Brandl-5/+5
2016-05-05Fix some some duplicate words.Georg Brandl-1/+1
2016-04-01Auto merge of #32334 - tbu-:pr_ipv6_octets, r=aturonbors-21/+43
Add functions to convert IPv6 addresses from and to octets See also #32313.
2016-03-22try! -> ?Jorge Aparicio-4/+4
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-18Auto merge of #32050 - achanda:from-slice-v4, r=alexcrichtonbors-0/+12
Add an impl for From trait Converts a u8 slice to a Ipv4Addr More discussion on this here: https://github.com/rust-lang/rfcs/pull/1498#issuecomment-191921655
2016-03-19Add functions to convert IPv6 addresses from and to octetsTobias Bucher-21/+43
See also #32313.
2016-03-13Add is_documentation for IPv6Abhishek Chanda-19/+29
This function returns true if the given IPv6 is reserved for documentation. Also, reject this block in the is_global check
2016-03-12Reject unspecified and loopback IP from globalAbhishek Chanda-1/+3
2016-03-05Add an impl for From traitAbhishek Chanda-0/+12
Converts a u8 slice to a Ipv4Addr
2016-03-04Formatting changes to make tidy passAbhishek Chanda-3/+3
2016-03-04Reject the reserved block as not globalAbhishek Chanda-1/+4
2016-03-04Exclude 0.0.0.0 from the list of globally routable addressesAbhishek Chanda-17/+17
2016-02-23Register new snapshotsAaron Turon-2/+2
2016-02-09Revert deprecation of IpAddr, stabilizing for 1.7Aaron Turon-6/+5
After [considerable pushback](https://github.com/rust-lang/rfcs/issues/1451), it's clear that there is a community consensus around providing `IpAddr` in the standard library, together with other APIs using it. This commit reverts from deprecated status directly to stable. The deprecation landed in 1.6, which has already been released, so the stabilization is marked for 1.7 (currently in beta; will require a backport).
2016-01-16std: Stabilize APIs for the 1.7 releaseAlex Crichton-2/+21
This commit stabilizes and deprecates the FCP (final comment period) APIs for the upcoming 1.7 beta release. The specific APIs which changed were: Stabilized * `Path::strip_prefix` (renamed from `relative_from`) * `path::StripPrefixError` (new error type returned from `strip_prefix`) * `Ipv4Addr::is_loopback` * `Ipv4Addr::is_private` * `Ipv4Addr::is_link_local` * `Ipv4Addr::is_multicast` * `Ipv4Addr::is_broadcast` * `Ipv4Addr::is_documentation` * `Ipv6Addr::is_unspecified` * `Ipv6Addr::is_loopback` * `Ipv6Addr::is_unique_local` * `Ipv6Addr::is_multicast` * `Vec::as_slice` * `Vec::as_mut_slice` * `String::as_str` * `String::as_mut_str` * `<[T]>::clone_from_slice` - the `usize` return value is removed * `<[T]>::sort_by_key` * `i32::checked_rem` (and other signed types) * `i32::checked_neg` (and other signed types) * `i32::checked_shl` (and other signed types) * `i32::checked_shr` (and other signed types) * `i32::saturating_mul` (and other signed types) * `i32::overflowing_add` (and other signed types) * `i32::overflowing_sub` (and other signed types) * `i32::overflowing_mul` (and other signed types) * `i32::overflowing_div` (and other signed types) * `i32::overflowing_rem` (and other signed types) * `i32::overflowing_neg` (and other signed types) * `i32::overflowing_shl` (and other signed types) * `i32::overflowing_shr` (and other signed types) * `u32::checked_rem` (and other unsigned types) * `u32::checked_neg` (and other unsigned types) * `u32::checked_shl` (and other unsigned types) * `u32::saturating_mul` (and other unsigned types) * `u32::overflowing_add` (and other unsigned types) * `u32::overflowing_sub` (and other unsigned types) * `u32::overflowing_mul` (and other unsigned types) * `u32::overflowing_div` (and other unsigned types) * `u32::overflowing_rem` (and other unsigned types) * `u32::overflowing_neg` (and other unsigned types) * `u32::overflowing_shl` (and other unsigned types) * `u32::overflowing_shr` (and other unsigned types) * `ffi::IntoStringError` * `CString::into_string` * `CString::into_bytes` * `CString::into_bytes_with_nul` * `From<CString> for Vec<u8>` * `From<CString> for Vec<u8>` * `IntoStringError::into_cstring` * `IntoStringError::utf8_error` * `Error for IntoStringError` Deprecated * `Path::relative_from` - renamed to `strip_prefix` * `Path::prefix` - use `components().next()` instead * `os::unix::fs` constants - moved to the `libc` crate * `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize * `IntoCow` - conflicts with `Into` and may come back later * `i32::{BITS, BYTES}` (and other integers) - not pulling their weight * `DebugTuple::formatter` - will be removed * `sync::Semaphore` - not used enough and confused with system semaphores Closes #23284 cc #27709 (still lots more methods though) Closes #27712 Closes #27722 Closes #27728 Closes #27735 Closes #27729 Closes #27755 Closes #27782 Closes #27798
2015-12-29Fix warnings when compiling stdlib with --testFlorian Hahn-1/+0
2015-12-06Auto merge of #30187 - alexcrichton:stabilize-1.6, r=aturonbors-0/+4
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-0/+4
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-12-05Remove allocations in `impl Display for Ipv6Addr`Simon Sapin-11/+11
2015-11-10Auto merge of #29724 - alexcrichton:ip-endian, r=aturonbors-2/+9
The comparison of IP addresses should happen not always in network endianness but rather in the host endianness format, so be sure to convert to that before comparing addresses. There are still locations where the endianness will factor into visible properties, such as the hash, but these are not important to be independent of the endianness in play (as hash values are pretty undefined anyway. Closes #29691
2015-11-09std: Migrate to the new libcAlex Crichton-28/+36
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself * Update all references to use `libc` as a result. * Update all references to the new flat namespace. * Moves all windows bindings into sys::c
2015-11-09std: Fix endianness in Ord for IP addressesAlex Crichton-2/+9
The comparison of IP addresses should happen not always in network endianness but rather in the host endianness format, so be sure to convert to that before comparing addresses. There are still locations where the endianness will factor into visible properties, such as the hash, but these are not important to be independent of the endianness in play (as hash values are pretty undefined anyway. Closes #29691
2015-10-20std: Implement FromStr for SocketAddrV{4,6}Alex Crichton-0/+8
This was already implemented for SocketAddr, so the other types are lacking it is just an oversight! Closes #29183
2015-10-08typos: fix a grabbag of typos all over the placeCristi Cobzarenco-1/+1
2015-08-15std: Add issues to all unstable featuresAlex Crichton-2/+3
2015-07-19Fix documentation IP ranges: e.g., 192.0.2.* instead of 192.*.2.*.Ken Tossell-4/+8
Add Ipv4Addr tests to verify doc address checking.
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-1/+1
2015-05-05Rollup merge of #25105 - tshepang:doc-addr, r=steveklabnikManish Goregaokar-1/+2
This did not render as intended: >This is defined in RFC 5737 - 192.0.2.0/24 (TEST-NET-1) - 198.51.100.0/24 (TEST-NET-2) - 203.0.113.0/24 (TEST-NET-3) vs. > This is defined in RFC 5737 - 192.0.2.0/24 (TEST-NET-1) - 198.51.100.0/24 (TEST-NET-2) - 203.0.113.0/24 (TEST-NET-3)
2015-05-04Auto merge of #24652 - achanda:ip-long, r=alexcrichtonbors-1/+27
2015-05-04doc: fix markupTshepang Lekhonkhobe-1/+2
2015-05-03Add functions to convert IPv4 to long and backAbhishek Chanda-1/+27
2015-05-03doc: improve IpAddr is_global and is_unicast_globalTshepang Lekhonkhobe-10/+18
2015-04-29Add some missing punctuation in the libstd/net/ip.rs docs.Nick Hamann-19/+19
2015-04-15Move IP related tests to ip.rsAbhishek Chanda-0/+253
- Also move common functions to test.rs - Leaves out Socket address related tests in addr.rs
2015-04-14rollup merge of #24377: apasel422/docsAlex Crichton-6/+6
Conflicts: src/libstd/net/ip.rs src/libstd/sys/unix/fs.rs src/libstd/sys/unix/mod.rs src/libstd/sys/windows/mod.rs