use std::ffi::c_int;
use crate::{IPPROTO_IPV6, SockOptMarker, OptRMarker, OptWMarker, IPV6_MULTICAST_ALL};
#[repr(transparent)]
#[derive(Debug, Clone, Copy)]
pub struct Ip6MulticastAll(c_int);
impl SockOptMarker for Ip6MulticastAll
{
const SO_LEVEL: c_int = IPPROTO_IPV6;
const SO_OPTNAME: c_int = IPV6_MULTICAST_ALL;
type DataType = bool;
type InputType = c_int;
#[inline]
fn from(value: Self::InputType) -> Self
{
return Self(value);
}
#[inline]
fn get(self) -> Self::DataType
{
return self.0 != 0;
}
#[inline]
fn from_user(ttl: Self::DataType) -> Self where Self: Sized
{
return Self(ttl as Self::InputType);
}
}
impl OptRMarker for Ip6MulticastAll {}
impl OptWMarker for Ip6MulticastAll {}