Home
last modified time | relevance | path

Searched refs:SocketAddrAny (Results 1 – 16 of 16) sorted by relevance

/third_party/rust/crates/rustix/tests/net/
Daddr.rs6 Ipv4Addr, Ipv6Addr, SocketAddrAny, SocketAddrStorage, SocketAddrV4, SocketAddrV6, in encode_decode()
12 let len = SocketAddrAny::V4(orig).write(encoded.as_mut_ptr()); in encode_decode()
13 let decoded = SocketAddrAny::read(encoded.as_ptr(), len).unwrap(); in encode_decode()
14 assert_eq!(decoded, SocketAddrAny::V4(orig)); in encode_decode()
18 let len = SocketAddrAny::V6(orig).write(encoded.as_mut_ptr()); in encode_decode()
19 let decoded = SocketAddrAny::read(encoded.as_ptr(), len).unwrap(); in encode_decode()
20 assert_eq!(decoded, SocketAddrAny::V6(orig)); in encode_decode()
26 let len = SocketAddrAny::Unix(orig.clone()).write(encoded.as_mut_ptr()); in encode_decode()
27 let decoded = SocketAddrAny::read(encoded.as_ptr(), len).unwrap(); in encode_decode()
28 assert_eq!(decoded, SocketAddrAny::Unix(orig)); in encode_decode()
Dconnect_bind_send.rs2 AddressFamily, Ipv6Addr, Protocol, RecvFlags, SendFlags, SocketAddrAny, SocketAddrV4,
90 SocketAddrAny::V4(v4) => SocketAddr::V4(v4), in net_v4_connect()
129 SocketAddrAny::V6(v6) => SocketAddr::V6(v6), in net_v6_connect()
193 let addr = SocketAddrAny::V6(SocketAddrV6::new(localhost, 0, 0, 0)); in net_v6_bind_any()
243 SocketAddrAny::V4(v4) => SocketAddr::V4(v4), in net_v4_sendto()
288 SocketAddrAny::V6(v6) => SocketAddr::V6(v6), in net_v6_sendto()
413 SocketAddrAny::V4(v4) => v4, in net_v4_acceptfrom()
417 SocketAddrAny::V4(v4) => v4, in net_v4_acceptfrom()
467 SocketAddrAny::V6(v6) => v6, in net_v6_acceptfrom()
471 SocketAddrAny::V6(v6) => v6, in net_v6_acceptfrom()
Dv4.rs9 Protocol, RecvFlags, SendFlags, SocketAddrAny, SocketAddrV4, SocketType,
24 SocketAddrAny::V4(addr) => addr, in server()
Dv6.rs9 Protocol, RecvFlags, SendFlags, SocketAddrAny, SocketAddrV6, SocketType,
28 SocketAddrAny::V6(addr) => addr, in server()
Dpoll.rs8 Protocol, RecvFlags, SendFlags, SocketAddrAny, SocketAddrV6, SocketType,
27 SocketAddrAny::V6(addr) => addr, in server()
/third_party/rust/crates/rustix/src/backend/linux_raw/net/
Dread_sockaddr.rs7 use crate::net::{Ipv4Addr, Ipv6Addr, SocketAddrAny, SocketAddrUnix, SocketAddrV4, SocketAddrV6};
55 ) -> io::Result<SocketAddrAny> { in read_sockaddr() argument
67 Ok(SocketAddrAny::V4(SocketAddrV4::new( in read_sockaddr()
77 Ok(SocketAddrAny::V6(SocketAddrV6::new( in read_sockaddr()
89 Ok(SocketAddrAny::Unix(SocketAddrUnix::new(&[][..])?)) in read_sockaddr()
96 Ok(SocketAddrAny::Unix(SocketAddrUnix::new( in read_sockaddr()
116 ) -> Option<SocketAddrAny> { in maybe_read_sockaddr_os() argument
129 pub(crate) unsafe fn read_sockaddr_os(storage: *const c::sockaddr, len: usize) -> SocketAddrAny { in read_sockaddr_os() argument
137 SocketAddrAny::V4(SocketAddrV4::new( in read_sockaddr_os()
145 SocketAddrAny::V6(SocketAddrV6::new( in read_sockaddr_os()
[all …]
Dwrite_sockaddr.rs6 use crate::net::{SocketAddrAny, SocketAddrStorage, SocketAddrUnix, SocketAddrV4, SocketAddrV6};
10 addr: &SocketAddrAny, in write_sockaddr() argument
14 SocketAddrAny::V4(v4) => write_sockaddr_v4(v4, storage), in write_sockaddr()
15 SocketAddrAny::V6(v6) => write_sockaddr_v6(v6, storage), in write_sockaddr()
16 SocketAddrAny::Unix(unix) => write_sockaddr_unix(unix, storage), in write_sockaddr()
Dsyscalls.rs20 use crate::net::{SocketAddrAny, SocketAddrUnix, SocketAddrV4, SocketAddrV6};
164 pub(crate) fn acceptfrom(fd: BorrowedFd<'_>) -> io::Result<(OwnedFd, Option<SocketAddrAny>)> { in acceptfrom() argument
204 ) -> io::Result<(OwnedFd, Option<SocketAddrAny>)> { in acceptfrom_with() argument
468 ) -> io::Result<(usize, Option<SocketAddrAny>)> { in recvfrom() argument
512 pub(crate) fn getpeername(fd: BorrowedFd<'_>) -> io::Result<Option<SocketAddrAny>> { in getpeername() argument
549 pub(crate) fn getsockname(fd: BorrowedFd<'_>) -> io::Result<SocketAddrAny> { in getsockname() argument
/third_party/rust/crates/rustix/src/net/
Dsocket.rs2 use crate::net::{SocketAddr, SocketAddrAny, SocketAddrV4, SocketAddrV6};
108 pub fn bind_any<Fd: AsFd>(sockfd: Fd, addr: &SocketAddrAny) -> io::Result<()> { in bind_any()
112 fn _bind_any(sockfd: BorrowedFd<'_>, addr: &SocketAddrAny) -> io::Result<()> { in _bind_any()
114 SocketAddrAny::V4(v4) => backend::net::syscalls::bind_v4(sockfd, v4), in _bind_any()
115 SocketAddrAny::V6(v6) => backend::net::syscalls::bind_v6(sockfd, v6), in _bind_any()
117 SocketAddrAny::Unix(unix) => backend::net::syscalls::bind_unix(sockfd, unix), in _bind_any()
215 pub fn connect_any<Fd: AsFd>(sockfd: Fd, addr: &SocketAddrAny) -> io::Result<()> { in connect_any()
219 fn _connect_any(sockfd: BorrowedFd<'_>, addr: &SocketAddrAny) -> io::Result<()> { in _connect_any()
221 SocketAddrAny::V4(v4) => backend::net::syscalls::connect_v4(sockfd, v4), in _connect_any()
222 SocketAddrAny::V6(v6) => backend::net::syscalls::connect_v6(sockfd, v6), in _connect_any()
[all …]
Dsocket_addr_any.rs25 pub enum SocketAddrAny { enum
35 impl From<SocketAddrV4> for SocketAddrAny { implementation
42 impl From<SocketAddrV6> for SocketAddrAny { implementation
50 impl From<SocketAddrUnix> for SocketAddrAny { implementation
57 impl SocketAddrAny { implementation
94 impl fmt::Debug for SocketAddrAny { implementation
Dsend_recv.rs5 use crate::net::{SocketAddr, SocketAddrAny, SocketAddrV4, SocketAddrV6};
63 ) -> io::Result<(usize, Option<SocketAddrAny>)> { in recvfrom() argument
118 addr: &SocketAddrAny, in sendto_any() argument
127 addr: &SocketAddrAny, in _sendto_any() argument
130 SocketAddrAny::V4(v4) => backend::net::syscalls::sendto_v4(fd, buf, flags, v4), in _sendto_any()
131 SocketAddrAny::V6(v6) => backend::net::syscalls::sendto_v6(fd, buf, flags, v6), in _sendto_any()
133 SocketAddrAny::Unix(unix) => backend::net::syscalls::sendto_unix(fd, buf, flags, unix), in _sendto_any()
Dmod.rs32 pub use socket_addr_any::{SocketAddrAny, SocketAddrStorage};
/third_party/rust/crates/rustix/src/backend/libc/net/
Dread_sockaddr.rs8 use crate::net::{Ipv4Addr, Ipv6Addr, SocketAddrAny, SocketAddrV4, SocketAddrV6};
97 ) -> io::Result<SocketAddrAny> { in read_sockaddr() argument
110 Ok(SocketAddrAny::V4(SocketAddrV4::new( in read_sockaddr()
128 Ok(SocketAddrAny::V6(SocketAddrV6::new( in read_sockaddr()
141 Ok(SocketAddrAny::Unix(SocketAddrUnix::new(&[][..]).unwrap())) in read_sockaddr()
164 Ok(SocketAddrAny::Unix( in read_sockaddr()
177 ) -> Option<SocketAddrAny> { in maybe_read_sockaddr_os() argument
194 ) -> SocketAddrAny { in read_sockaddr_os() argument
204 ) -> SocketAddrAny { in inner_read_sockaddr_os() argument
213 SocketAddrAny::V4(SocketAddrV4::new( in inner_read_sockaddr_os()
[all …]
Dwrite_sockaddr.rs9 use crate::net::{SocketAddrAny, SocketAddrV4, SocketAddrV6};
13 addr: &SocketAddrAny, in write_sockaddr() argument
17 SocketAddrAny::V4(v4) => write_sockaddr_v4(v4, storage), in write_sockaddr()
18 SocketAddrAny::V6(v6) => write_sockaddr_v6(v6, storage), in write_sockaddr()
20 SocketAddrAny::Unix(unix) => write_sockaddr_unix(unix, storage), in write_sockaddr()
Dsyscalls.rs20 use crate::net::{SocketAddrAny, SocketAddrV4, SocketAddrV6};
58 ) -> io::Result<(usize, Option<SocketAddrAny>)> { in recvfrom() argument
274 pub(crate) fn acceptfrom(sockfd: BorrowedFd<'_>) -> io::Result<(OwnedFd, Option<SocketAddrAny>)> { in acceptfrom() argument
301 ) -> io::Result<(OwnedFd, Option<SocketAddrAny>)> { in acceptfrom_with() argument
331 ) -> io::Result<(OwnedFd, Option<SocketAddrAny>)> { in acceptfrom_with() argument
341 pub(crate) fn getsockname(sockfd: BorrowedFd<'_>) -> io::Result<SocketAddrAny> { in getsockname() argument
355 pub(crate) fn getpeername(sockfd: BorrowedFd<'_>) -> io::Result<Option<SocketAddrAny>> { in getpeername() argument
/third_party/rust/crates/rustix/tests/io/
Depoll.rs8 SocketAddrAny, SocketAddrV4, SocketType,
22 SocketAddrAny::V4(addr) => addr, in server()