use std::ffi::c_int;
use crate::{IPPROTO_TCP, SockOptMarker, OptRMarker, OptWMarker, TCP_THIN_LINEAR_TIMEOUTS};
#[repr(transparent)]
#[derive(Debug, Clone, Copy)]
pub struct IpProtoTcpThinLinearTimeouts(c_int);
impl SockOptMarker for IpProtoTcpThinLinearTimeouts
{
const SO_LEVEL: c_int = IPPROTO_TCP;
const SO_OPTNAME: c_int = TCP_THIN_LINEAR_TIMEOUTS;
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(inp: Self::DataType) -> Self where Self: Sized
{
return Self(inp as Self::InputType);
}
}
impl OptWMarker for IpProtoTcpThinLinearTimeouts {}
impl OptRMarker for IpProtoTcpThinLinearTimeouts {}