| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::{ |
| 2 | netrust-analyzer cargo std https://github.com/rust-lang/rust/library/std net/::{Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#, SocketAddrV4rust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/socket_addr/SocketAddrV4#, SocketAddrV6rust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/socket_addr/SocketAddrV6#}, |
| 3 | osrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/::fdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/::RawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/RawFd#, |
| 4 | }; |
| 5 | |
| 6 | use craterust-analyzer cargo timestamped-socket 0.2.2 crate/::{ |
| 7 | cerrrust-analyzer cargo timestamped-socket 0.2.2 cerr()., control_messagerust-analyzer cargo timestamped-socket 0.2.2 control_message/::zeroed_sockaddr_storagerust-analyzer cargo timestamped-socket 0.2.2 control_message/zeroed_sockaddr_storage()., interfacerust-analyzer cargo timestamped-socket 0.2.2 interface/::InterfaceNamerust-analyzer cargo timestamped-socket 0.2.2 interface/InterfaceName#, |
| 8 | networkaddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/::NetworkAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/NetworkAddress#, |
| 9 | }; |
| 10 | |
| 11 | use superrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/::{ |
| 12 | sealedrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/::{PrivateTokenrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/PrivateToken#, SealedMCrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/SealedMC#, SealedNArust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/SealedNA#}, |
| 13 | MulticastJoinablerust-analyzer cargo timestamped-socket 0.2.2 networkaddress/MulticastJoinable#, |
| 14 | }; |
| 15 | |
| 16 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, PartialOrdrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialOrd:, Ordrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Ord:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)] |
| 17 | pub struct MacAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#([u8; 6]); |
| 18 | |
| 19 | impl Fromrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/From#<[u8; 6]> for MacAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress# { |
| 20 | fn fromrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[MacAddress][`From<[u8; 6]>`]from().(value: [u8; 6]) -> Selfrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[MacAddress][`From<[u8; 6]>`] { |
| 21 | MacAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#(value) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | impl AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<[u8]> for MacAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress# { |
| 26 | fn as_refrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[MacAddress][`AsRef<[u8]>`]as_ref().(&self) -> &[u8] { |
| 27 | &self.0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0. |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | impl MacAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress# { |
| 32 | pub const fn newrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[MacAddress]new().(address: [u8; 6]) -> Selfrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[MacAddress] { |
| 33 | MacAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#(address) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:, Hashrust-analyzer cargo core https://github.com/rust-lang/rust/library/core hash/macros/Hash:)] |
| 38 | pub struct EthernetAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress# { |
| 39 | protocolrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#protocol.: u16, |
| 40 | mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address.: MacAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#, |
| 41 | if_indexrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#if_index.: libcrust-analyzer cargo libc 0.2.152 crate/::c_intrust-analyzer cargo libc 0.2.152 unix/c_int#, |
| 42 | } |
| 43 | |
| 44 | impl EthernetAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress# { |
| 45 | pub const fn newrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress]new().(protocol: u16, mac_address: MacAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#, if_index: libcrust-analyzer cargo libc 0.2.152 crate/::c_intrust-analyzer cargo libc 0.2.152 unix/c_int#) -> Selfrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress] { |
| 46 | EthernetAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress# { |
| 47 | protocolrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#protocol., |
| 48 | mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address., |
| 49 | if_indexrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#if_index., |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | pub const fn macrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress]mac().(&self) -> MacAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress# { |
| 54 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address. |
| 55 | } |
| 56 | |
| 57 | pub const fn protocolrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress]protocol().(&self) -> u16 { |
| 58 | self.protocolrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#protocol. |
| 59 | } |
| 60 | |
| 61 | pub const fn interfacerust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress]interface().(&self) -> libcrust-analyzer cargo libc 0.2.152 crate/::c_intrust-analyzer cargo libc 0.2.152 unix/c_int# { |
| 62 | self.if_indexrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#if_index. |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | impl SealedNArust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/SealedNA# for EthernetAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress# {} |
| 67 | |
| 68 | impl NetworkAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/NetworkAddress# for EthernetAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress# { |
| 69 | fn to_sockaddrrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress][NetworkAddress]to_sockaddr().(&self, _token: PrivateTokenrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/PrivateToken#) -> libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_storagerust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_storage# { |
| 70 | const _: () = assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!( |
| 71 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_storagerust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_storage#>() |
| 72 | >= stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_llrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#>() |
| 73 | ); |
| 74 | const _: () = assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!( |
| 75 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_storagerust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_storage#>() |
| 76 | >= stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_llrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#>() |
| 77 | ); |
| 78 | |
| 79 | let mut result = zeroed_sockaddr_storagerust-analyzer cargo timestamped-socket 0.2.2 control_message/zeroed_sockaddr_storage().(); |
| 80 | // Safety: the above assertions guarantee that alignment and size are correct. |
| 81 | // the resulting reference won't outlast the function, and result lives the entire |
| 82 | // duration of the function |
| 83 | let out = unsafe { &mut (*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().(&mut result as *mut _ as *mut libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_llrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#)) }; |
| 84 | |
| 85 | out.sll_familyrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#sll_family. = libcrust-analyzer cargo libc 0.2.152 crate/::AF_PACKETrust-analyzer cargo libc 0.2.152 unix/linux_like/AF_PACKET. as _; |
| 86 | out.sll_addrrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#sll_addr.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#6]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`IndexMut<I>`]index_mut()..copy_from_slicerust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]copy_from_slice().(&self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.); |
| 87 | out.sll_halenrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#sll_halen. = 6; |
| 88 | out.sll_protocolrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#sll_protocol. = u16::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]from_ne_bytes().(self.protocolrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#protocol..to_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_be_bytes().()); |
| 89 | out.sll_ifindexrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#sll_ifindex. = self.if_indexrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#if_index.; |
| 90 | |
| 91 | result |
| 92 | } |
| 93 | |
| 94 | fn from_sockaddrrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress][NetworkAddress]from_sockaddr().(addr: libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_storagerust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_storage#, _token: PrivateTokenrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/PrivateToken#) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Selfrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress][NetworkAddress]> { |
| 95 | const _: () = assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!( |
| 96 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_storagerust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_storage#>() |
| 97 | >= stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of().::<libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_llrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#>() |
| 98 | ); |
| 99 | const _: () = assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!( |
| 100 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_storagerust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_storage#>() |
| 101 | >= stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::align_ofrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/align_of().::<libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_llrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#>() |
| 102 | ); |
| 103 | |
| 104 | if addr.ss_familyrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_storage#ss_family. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u16][`PartialEq<Self>`]ne().libcrust-analyzer cargo libc 0.2.152 crate/::AF_PACKETrust-analyzer cargo libc 0.2.152 unix/linux_like/AF_PACKET. as _ { |
| 105 | return Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 106 | } |
| 107 | |
| 108 | // Safety: the above assertions guarantee that alignment and size are correct |
| 109 | // the resulting reference won't outlast the function, and addr lives the entire |
| 110 | // duration of the function |
| 111 | let input = unsafe { &(*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().(&addr as *const _ as *const libcrust-analyzer cargo libc 0.2.152 crate/::sockaddr_llrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#)) }; |
| 112 | |
| 113 | if input.sll_halenrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#sll_halen. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u8][`PartialEq<Self>`]ne().6 { |
| 114 | return Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 115 | } |
| 116 | |
| 117 | Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(EthernetAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#::newrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress]new().( |
| 118 | u16::from_be_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]from_be_bytes().(input.sll_protocolrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#sll_protocol..to_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u16]to_ne_bytes().()), |
| 119 | MacAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#::newrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[MacAddress]new().(input.sll_addrrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#sll_addr.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#6]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()..try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()), |
| 120 | input.sll_ifindexrust-analyzer cargo libc 0.2.152 unix/linux_like/sockaddr_ll#sll_ifindex., |
| 121 | )) |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | impl SealedMCrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/SealedMC# for EthernetAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress# {} |
| 126 | |
| 127 | impl MulticastJoinablerust-analyzer cargo timestamped-socket 0.2.2 networkaddress/MulticastJoinable# for EthernetAddressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress# { |
| 128 | fn join_multicastrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress][MulticastJoinable]join_multicast().( |
| 129 | &self, |
| 130 | socket: RawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/RawFd#, |
| 131 | interface: InterfaceNamerust-analyzer cargo timestamped-socket 0.2.2 interface/InterfaceName#, |
| 132 | _token: PrivateTokenrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/PrivateToken#, |
| 133 | ) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 134 | let request = libcrust-analyzer cargo libc 0.2.152 crate/::packet_mreqrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/packet_mreq# { |
| 135 | mr_ifindexrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/packet_mreq#mr_ifindex.: interface |
| 136 | .get_indexrust-analyzer cargo timestamped-socket 0.2.2 interface/impl#[InterfaceName]get_index().() |
| 137 | .ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidInputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidInput#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as _, |
| 138 | mr_typerust-analyzer cargo libc 0.2.152 unix/linux_like/linux/packet_mreq#mr_type.: libcrust-analyzer cargo libc 0.2.152 crate/::PACKET_MR_MULTICASTrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/PACKET_MR_MULTICAST. as _, |
| 139 | mr_alenrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/packet_mreq#mr_alen.: 6, |
| 140 | mr_addressrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/packet_mreq#mr_address.: [ |
| 141 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 142 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 143 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 144 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 145 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 146 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().5]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 147 | 0, |
| 148 | 0, |
| 149 | ], |
| 150 | }; |
| 151 | // Safety: |
| 152 | // value points to a struct of length option_len, of type ip_mreq as expected for IPPROTO_IPV6/IPV6_ADD_MEMBERSHIP |
| 153 | cerrrust-analyzer cargo timestamped-socket 0.2.2 cerr().(unsafe { |
| 154 | libcrust-analyzer cargo libc 0.2.152 crate/::setsockoptrust-analyzer cargo libc 0.2.152 setsockopt().( |
| 155 | socket, |
| 156 | libcrust-analyzer cargo libc 0.2.152 crate/::SOL_PACKETrust-analyzer cargo libc 0.2.152 unix/linux_like/SOL_PACKET., |
| 157 | libcrust-analyzer cargo libc 0.2.152 crate/::PACKET_ADD_MEMBERSHIPrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/PACKET_ADD_MEMBERSHIP., |
| 158 | &request as *const _ as *const _, |
| 159 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_of_valrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of_val().(&request) as _, |
| 160 | ) |
| 161 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 162 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 163 | } |
| 164 | |
| 165 | fn leave_multicastrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[EthernetAddress][MulticastJoinable]leave_multicast().( |
| 166 | &self, |
| 167 | socket: RawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/RawFd#, |
| 168 | interface: InterfaceNamerust-analyzer cargo timestamped-socket 0.2.2 interface/InterfaceName#, |
| 169 | _token: PrivateTokenrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/PrivateToken#, |
| 170 | ) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 171 | let request = libcrust-analyzer cargo libc 0.2.152 crate/::packet_mreqrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/packet_mreq# { |
| 172 | mr_ifindexrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/packet_mreq#mr_ifindex.: interface |
| 173 | .get_indexrust-analyzer cargo timestamped-socket 0.2.2 interface/impl#[InterfaceName]get_index().() |
| 174 | .ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidInputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidInput#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as _, |
| 175 | mr_typerust-analyzer cargo libc 0.2.152 unix/linux_like/linux/packet_mreq#mr_type.: libcrust-analyzer cargo libc 0.2.152 crate/::PACKET_MR_MULTICASTrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/PACKET_MR_MULTICAST. as _, |
| 176 | mr_alenrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/packet_mreq#mr_alen.: 6, |
| 177 | mr_addressrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/packet_mreq#mr_address.: [ |
| 178 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 179 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 180 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 181 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 182 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().4]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 183 | self.mac_addressrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/EthernetAddress#mac_address..0rust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/MacAddress#0.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().5]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., |
| 184 | 0, |
| 185 | 0, |
| 186 | ], |
| 187 | }; |
| 188 | // Safety: |
| 189 | // value points to a struct of length option_len, of type ip_mreq as expected for IPPROTO_IPV6/IPV6_ADD_MEMBERSHIP |
| 190 | cerrrust-analyzer cargo timestamped-socket 0.2.2 cerr().(unsafe { |
| 191 | libcrust-analyzer cargo libc 0.2.152 crate/::setsockoptrust-analyzer cargo libc 0.2.152 setsockopt().( |
| 192 | socket, |
| 193 | libcrust-analyzer cargo libc 0.2.152 crate/::SOL_PACKETrust-analyzer cargo libc 0.2.152 unix/linux_like/SOL_PACKET., |
| 194 | libcrust-analyzer cargo libc 0.2.152 crate/::PACKET_DROP_MEMBERSHIPrust-analyzer cargo libc 0.2.152 unix/linux_like/linux/PACKET_DROP_MEMBERSHIP., |
| 195 | &request as *const _ as *const _, |
| 196 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_of_valrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of_val().(&request) as _, |
| 197 | ) |
| 198 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 199 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | impl SealedMCrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/SealedMC# for SocketAddrV4rust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/socket_addr/SocketAddrV4# {} |
| 204 | |
| 205 | impl MulticastJoinablerust-analyzer cargo timestamped-socket 0.2.2 networkaddress/MulticastJoinable# for SocketAddrV4rust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/socket_addr/SocketAddrV4# { |
| 206 | fn join_multicastrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[SocketAddrV4][MulticastJoinable]join_multicast().( |
| 207 | &self, |
| 208 | socket: RawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/RawFd#, |
| 209 | interface: InterfaceNamerust-analyzer cargo timestamped-socket 0.2.2 interface/InterfaceName#, |
| 210 | _token: PrivateTokenrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/PrivateToken#, |
| 211 | ) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 212 | let request = libcrust-analyzer cargo libc 0.2.152 crate/::ip_mreqnrust-analyzer cargo libc 0.2.152 unix/linux_like/ip_mreqn# { |
| 213 | imr_multiaddrrust-analyzer cargo libc 0.2.152 unix/linux_like/ip_mreqn#imr_multiaddr.: libcrust-analyzer cargo libc 0.2.152 crate/::in_addrrust-analyzer cargo libc 0.2.152 unix/linux_like/in_addr# { |
| 214 | s_addrrust-analyzer cargo libc 0.2.152 unix/linux_like/in_addr#s_addr.: u32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_ne_bytes().(self.iprust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/socket_addr/impl#[SocketAddrV4]ip().().octetsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]octets().()), |
| 215 | }, |
| 216 | imr_addressrust-analyzer cargo libc 0.2.152 unix/linux_like/ip_mreqn#imr_address.: libcrust-analyzer cargo libc 0.2.152 crate/::in_addrrust-analyzer cargo libc 0.2.152 unix/linux_like/in_addr# { |
| 217 | s_addrrust-analyzer cargo libc 0.2.152 unix/linux_like/in_addr#s_addr.: u32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_ne_bytes().(Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#::UNSPECIFIEDrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]UNSPECIFIED..octetsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]octets().()), |
| 218 | }, |
| 219 | imr_ifindexrust-analyzer cargo libc 0.2.152 unix/linux_like/ip_mreqn#imr_ifindex.: interface |
| 220 | .get_indexrust-analyzer cargo timestamped-socket 0.2.2 interface/impl#[InterfaceName]get_index().() |
| 221 | .ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidInputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidInput#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as _, |
| 222 | }; |
| 223 | // Safety: |
| 224 | // value points to a struct of length option_len, of type ip_mreq as expected for IPPROTO_IP/IP_ADD_MEMBERSHIP |
| 225 | cerrrust-analyzer cargo timestamped-socket 0.2.2 cerr().(unsafe { |
| 226 | libcrust-analyzer cargo libc 0.2.152 crate/::setsockoptrust-analyzer cargo libc 0.2.152 setsockopt().( |
| 227 | socket, |
| 228 | libcrust-analyzer cargo libc 0.2.152 crate/::IPPROTO_IPrust-analyzer cargo libc 0.2.152 unix/IPPROTO_IP., |
| 229 | libcrust-analyzer cargo libc 0.2.152 crate/::IP_ADD_MEMBERSHIPrust-analyzer cargo libc 0.2.152 unix/linux_like/IP_ADD_MEMBERSHIP., |
| 230 | &request as *const _ as *const _, |
| 231 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_of_valrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of_val().(&request) as _, |
| 232 | ) |
| 233 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 234 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 235 | } |
| 236 | |
| 237 | fn leave_multicastrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[SocketAddrV4][MulticastJoinable]leave_multicast().( |
| 238 | &self, |
| 239 | socket: RawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/RawFd#, |
| 240 | interface: InterfaceNamerust-analyzer cargo timestamped-socket 0.2.2 interface/InterfaceName#, |
| 241 | _token: PrivateTokenrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/PrivateToken#, |
| 242 | ) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 243 | let request = libcrust-analyzer cargo libc 0.2.152 crate/::ip_mreqnrust-analyzer cargo libc 0.2.152 unix/linux_like/ip_mreqn# { |
| 244 | imr_multiaddrrust-analyzer cargo libc 0.2.152 unix/linux_like/ip_mreqn#imr_multiaddr.: libcrust-analyzer cargo libc 0.2.152 crate/::in_addrrust-analyzer cargo libc 0.2.152 unix/linux_like/in_addr# { |
| 245 | s_addrrust-analyzer cargo libc 0.2.152 unix/linux_like/in_addr#s_addr.: u32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_ne_bytes().(self.iprust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/socket_addr/impl#[SocketAddrV4]ip().().octetsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]octets().()), |
| 246 | }, |
| 247 | imr_addressrust-analyzer cargo libc 0.2.152 unix/linux_like/ip_mreqn#imr_address.: libcrust-analyzer cargo libc 0.2.152 crate/::in_addrrust-analyzer cargo libc 0.2.152 unix/linux_like/in_addr# { |
| 248 | s_addrrust-analyzer cargo libc 0.2.152 unix/linux_like/in_addr#s_addr.: u32::from_ne_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]from_ne_bytes().(Ipv4Addrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/Ipv4Addr#::UNSPECIFIEDrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]UNSPECIFIED..octetsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv4Addr]octets().()), |
| 249 | }, |
| 250 | imr_ifindexrust-analyzer cargo libc 0.2.152 unix/linux_like/ip_mreqn#imr_ifindex.: interface |
| 251 | .get_indexrust-analyzer cargo timestamped-socket 0.2.2 interface/impl#[InterfaceName]get_index().() |
| 252 | .ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidInputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidInput#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as _, |
| 253 | }; |
| 254 | // Safety: |
| 255 | // value points to a struct of length option_len, of type ip_mreq as expected for IPPROTO_IP/IP_DROP_MEMBERSHIP |
| 256 | cerrrust-analyzer cargo timestamped-socket 0.2.2 cerr().(unsafe { |
| 257 | libcrust-analyzer cargo libc 0.2.152 crate/::setsockoptrust-analyzer cargo libc 0.2.152 setsockopt().( |
| 258 | socket, |
| 259 | libcrust-analyzer cargo libc 0.2.152 crate/::IPPROTO_IPrust-analyzer cargo libc 0.2.152 unix/IPPROTO_IP., |
| 260 | libcrust-analyzer cargo libc 0.2.152 crate/::IP_DROP_MEMBERSHIPrust-analyzer cargo libc 0.2.152 unix/linux_like/IP_DROP_MEMBERSHIP., |
| 261 | &request as *const _ as *const _, |
| 262 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_of_valrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of_val().(&request) as _, |
| 263 | ) |
| 264 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 265 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | impl SealedMCrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/SealedMC# for SocketAddrV6rust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/socket_addr/SocketAddrV6# {} |
| 270 | |
| 271 | impl MulticastJoinablerust-analyzer cargo timestamped-socket 0.2.2 networkaddress/MulticastJoinable# for SocketAddrV6rust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/socket_addr/SocketAddrV6# { |
| 272 | fn join_multicastrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[SocketAddrV6][MulticastJoinable]join_multicast().( |
| 273 | &self, |
| 274 | socket: RawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/RawFd#, |
| 275 | interface: InterfaceNamerust-analyzer cargo timestamped-socket 0.2.2 interface/InterfaceName#, |
| 276 | _token: PrivateTokenrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/PrivateToken#, |
| 277 | ) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 278 | let request = libcrust-analyzer cargo libc 0.2.152 crate/::ipv6_mreqrust-analyzer cargo libc 0.2.152 unix/ipv6_mreq# { |
| 279 | ipv6mr_multiaddrrust-analyzer cargo libc 0.2.152 unix/ipv6_mreq#ipv6mr_multiaddr.: libcrust-analyzer cargo libc 0.2.152 crate/::in6_addrrust-analyzer cargo libc 0.2.152 unix/align/in6_addr# { |
| 280 | s6_addrrust-analyzer cargo libc 0.2.152 unix/align/in6_addr#s6_addr.: self.iprust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/socket_addr/impl#[SocketAddrV6]ip().().octetsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv6Addr]octets().(), |
| 281 | }, |
| 282 | ipv6mr_interfacerust-analyzer cargo libc 0.2.152 unix/ipv6_mreq#ipv6mr_interface.: interface |
| 283 | .get_indexrust-analyzer cargo timestamped-socket 0.2.2 interface/impl#[InterfaceName]get_index().() |
| 284 | .ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidInputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidInput#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as _, |
| 285 | }; |
| 286 | // Safety: |
| 287 | // value points to a struct of length option_len, of type ip_mreq as expected for IPPROTO_IPV6/IPV6_ADD_MEMBERSHIP |
| 288 | cerrrust-analyzer cargo timestamped-socket 0.2.2 cerr().(unsafe { |
| 289 | libcrust-analyzer cargo libc 0.2.152 crate/::setsockoptrust-analyzer cargo libc 0.2.152 setsockopt().( |
| 290 | socket, |
| 291 | libcrust-analyzer cargo libc 0.2.152 crate/::IPPROTO_IPV6rust-analyzer cargo libc 0.2.152 unix/IPPROTO_IPV6., |
| 292 | libcrust-analyzer cargo libc 0.2.152 crate/::IPV6_ADD_MEMBERSHIPrust-analyzer cargo libc 0.2.152 unix/linux_like/IPV6_ADD_MEMBERSHIP., |
| 293 | &request as *const _ as *const _, |
| 294 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_of_valrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of_val().(&request) as _, |
| 295 | ) |
| 296 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 297 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 298 | } |
| 299 | |
| 300 | fn leave_multicastrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/linux/impl#[SocketAddrV6][MulticastJoinable]leave_multicast().( |
| 301 | &self, |
| 302 | socket: RawFdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std os/fd/raw/RawFd#, |
| 303 | interface: InterfaceNamerust-analyzer cargo timestamped-socket 0.2.2 interface/InterfaceName#, |
| 304 | _token: PrivateTokenrust-analyzer cargo timestamped-socket 0.2.2 networkaddress/sealed/PrivateToken#, |
| 305 | ) -> stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 306 | let request = libcrust-analyzer cargo libc 0.2.152 crate/::ipv6_mreqrust-analyzer cargo libc 0.2.152 unix/ipv6_mreq# { |
| 307 | ipv6mr_multiaddrrust-analyzer cargo libc 0.2.152 unix/ipv6_mreq#ipv6mr_multiaddr.: libcrust-analyzer cargo libc 0.2.152 crate/::in6_addrrust-analyzer cargo libc 0.2.152 unix/align/in6_addr# { |
| 308 | s6_addrrust-analyzer cargo libc 0.2.152 unix/align/in6_addr#s6_addr.: self.iprust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/socket_addr/impl#[SocketAddrV6]ip().().octetsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core net/ip_addr/impl#[Ipv6Addr]octets().(), |
| 309 | }, |
| 310 | ipv6mr_interfacerust-analyzer cargo libc 0.2.152 unix/ipv6_mreq#ipv6mr_interface.: interface |
| 311 | .get_indexrust-analyzer cargo timestamped-socket 0.2.2 interface/impl#[InterfaceName]get_index().() |
| 312 | .ok_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]ok_or().(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidInputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidInput#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). as _, |
| 313 | }; |
| 314 | // Safety: |
| 315 | // value points to a struct of length option_len, of type ip_mreq as expected for IPPROTO_IPV6/IPV6_DROP_MEMBERSHIP |
| 316 | cerrrust-analyzer cargo timestamped-socket 0.2.2 cerr().(unsafe { |
| 317 | libcrust-analyzer cargo libc 0.2.152 crate/::setsockoptrust-analyzer cargo libc 0.2.152 setsockopt().( |
| 318 | socket, |
| 319 | libcrust-analyzer cargo libc 0.2.152 crate/::IPPROTO_IPV6rust-analyzer cargo libc 0.2.152 unix/IPPROTO_IPV6., |
| 320 | libcrust-analyzer cargo libc 0.2.152 crate/::IPV6_DROP_MEMBERSHIPrust-analyzer cargo libc 0.2.152 unix/linux_like/IPV6_DROP_MEMBERSHIP., |
| 321 | &request as *const _ as *const _, |
| 322 | stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::memrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/::size_of_valrust-analyzer cargo core https://github.com/rust-lang/rust/library/core mem/size_of_val().(&request) as _, |
| 323 | ) |
| 324 | })?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 325 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 326 | } |
| 327 | } |