summaryrefslogtreecommitdiff
path: root/src/sys/socket/addr.rs
AgeCommit message (Collapse)Author
2018-04-10Refactor the ioctl API and documentationBryant Mairs
* Split `ioctl!` into separate macros. This makes documentation easier to read. * For every `ioctl_*!` macro include a description of the macro arguments as, the function prototype for the generated wrapper function, and an example if we have one. * Expose `request_code_*!` in the documentation to make the `ioctl_*_bad` macros easier to use. * Reorganize the file hierarchy to be simpler
2018-01-28Replace sockaddr_ctl with one from libcBryant Mairs
Also alter Debug to output all fields.
2018-01-28Implement Copy/Clone for all types missing itBryant Mairs
2018-01-28Disallow unnecessary import bracesBryant Mairs
2018-01-08Impl LinkAddr(MAC Addr)luozijun
2018-01-08impl `Debug` for all sockaddr typesluozijun
2017-12-20Remove unnecessary impl ClonesBryant Mairs
2017-12-20Merge redundant match armsBryant Mairs
2017-12-05Merge #696bors[bot]
696: Stop reexporting `Errno` variants r=Susurrus a=jonas-schievink Closes #664 (unsure if this is everything needed)
2017-12-04Stop reexporting `Errno` and its variantsJonas Schievink
cc #664 (unsure if this is everything needed)
2017-12-03Add support for getifaddrs. Closes: #650.Markus Wanner
2017-11-19sys/socket: add UnixAddr abstract name getterLuca Bruno
This introduces an `as_abstract()` getter to `UnixAddr` in order to retrieve the name of an abstract unix socket. This also adds tests around abstract addresses and clarify docs, adding explicit semantics.
2017-08-11Get rid of a lot of transmutesJonas Schievink
Most could be replaced by simple raw pointer casts (or even perfectly safe coercions!). cc #373
2017-08-01Document AddressFamily and SockTypeNicolas Dusart
2017-08-01add socket constants already present in libcNicolas Dusart
2017-08-01remove sys::sockets::consts module as it's libc goal to define themNicolas Dusart
2016-12-10Add support for system control sockets for XNUConrad Kramer
2016-11-18Fix Unix domain sockets.Alan Somers
There were multiple errors regarding Unix domain sockets: * UnixAddr::path assumed that gethostbyname and similar functions would include the terminating null as part of len. That is not universally true. In fact, POSIX only guarantees that len will be at least large enough to store the non-null-terminated path. So it could be larger or smaller than nix was assuming. Since abstract sockets' paths are not strings, we can't modify gethostbyname. Instead, I implemented the fix in UnixAddr::path and UnixAddr::new. I clarified the documentation too. * SockAddr::as_ffi_pair contained a Linuxism. * sockaddr_storage_to_addr forgot to adjust sun_len when creating a UnixAddr
2016-09-17Fixed a bug where UnixAddr::new_abstract forgot to count the null-byte.Mathias Svensson
2016-04-14fixed a few clippy warningsAndre Bogus
2016-03-30socket: Respect IPv6 flowinfo and scope_id in InetAddr::from_stdKamal Marhubi
Fixes #329
2016-02-23Add support for AF_PACKET on linuxHerman J. Radtke III
2016-02-04Add comment on IPv6 address endianness.Philipp Matthias Schaefer
2016-02-04IPv6 addresses are always in big endian orderFrank Denis
no matter what the architecture is.
2016-01-28Use sockaddr_nl from libcKamal Marhubi
2016-01-28Derive all the thingsAlexander Polakov
as suggested by @kamalmarhubi
2016-01-28Fix style suggestions regarding #cfgAlexander Polakov
as pointed out by @kamalmarhubi
2016-01-28Netlink bitsAlexander Polakov
2016-01-28Move errno::Result back to crate rootarcnmx
2016-01-28Errno::result()arcnmx
2016-01-18update libc to 0.2.2Mattis Marjak
2015-10-28Fix handling of sockaddr_un lengthsGeoffrey Thomas
The returned length of AF_UNIX sockaddrs is significant, and generally does not match the length of the entire structure. For filesystem sockets, this is ignorable because the path is also NUL-terminated, but for unbound sockets (e.g., a socketpair) or abstract-namespace sockets (a Linux extension where the address is an arbitrary bytestring), we need to keep track of the length. Fixes #177. Also add a UnixAddr::new_abstract function and some better handling of abstract-namespace socket addresses to fix #169.
2015-05-21Fix NixPath yield with CStr instead of OsStrCarl Lerche
As described in #117, the `AsExtStr` trait is defined to return a raw `*const libc::c_char`. Its impl for `OsStr` simply borrowed the byte slice from its `OsStr` argument and cast it to a `*const libc::c_char`, which does not construct a proper null-terminated C string. Given this, the `AsExtStr` is not necessary and is removed. `NixPath` is updated to yield `CStr`. Fixes #117, #120 Thanks to @dead10ck
2015-04-24FromPrimitive is no moreFlorian Hartwig
2015-04-03'derive(Copy)' needs Clone nowFlorian Hartwig
2015-04-01Remove usage of std::num::IntCarl Lerche
2015-04-01Fix argument order for copy* functionsFlorian Hartwig
2015-03-24NixResult -> nix::Result; NixError -> nix::ErrorCarl Lerche
2015-03-19Track Rust nightliesCarl Lerche
2015-03-14Derive FromPrimitive for AddressFamily.Jan Bujak
2015-03-10Track Rust nightliesCarl Lerche
2015-02-27Further SockAddr & NixPath cleanupCarl Lerche
2015-02-25Large cleanup, mostly of socket functionsCarl Lerche
2015-02-23in_addr conversions + IP_DROP_MEMBERSHIP supportCarl Lerche
2015-02-22Remove prefix from SockAddr variantsCarl Lerche
2015-02-22Split up socket moduleCarl Lerche