Skip to content

Commit

Permalink
Also introduces iOS to allow using on libs
Browse files Browse the repository at this point in the history
  • Loading branch information
bltavares committed Jun 30, 2020
1 parent 46df7b9 commit d12943d
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/sys/socket/mod.rs
Expand Up @@ -725,7 +725,8 @@ pub enum ControlMessage<'a> {
#[cfg(any(target_os = "linux",
target_os = "macos",
target_os = "netbsd",
target_os = "android"))]
target_os = "android",
target_os = "ios",))]
Ipv4PacketInfo(&'a libc::in_pktinfo),

/// Configure the sending addressing and interface for v6
Expand All @@ -736,7 +737,8 @@ pub enum ControlMessage<'a> {
target_os = "macos",
target_os = "netbsd",
target_os = "freebsd",
target_os = "android"))]
target_os = "android",
target_os = "ios",))]
Ipv6PacketInfo(&'a libc::in6_pktinfo),
}

Expand Down Expand Up @@ -820,11 +822,12 @@ impl<'a> ControlMessage<'a> {
gso_size as *const _ as *const u8
},
#[cfg(any(target_os = "linux", target_os = "macos",
target_os = "netbsd", target_os = "android"))]
target_os = "netbsd", target_os = "android",
target_os = "ios",))]
ControlMessage::Ipv4PacketInfo(info) => info as *const _ as *const u8,
#[cfg(any(target_os = "linux", target_os = "macos",
target_os = "netbsd", target_os = "freebsd",
target_os = "android"))]
target_os = "android", target_os = "ios",))]
ControlMessage::Ipv6PacketInfo(info) => info as *const _ as *const u8,
};
unsafe {
Expand Down Expand Up @@ -867,11 +870,12 @@ impl<'a> ControlMessage<'a> {
mem::size_of_val(gso_size)
},
#[cfg(any(target_os = "linux", target_os = "macos",
target_os = "netbsd", target_os = "android"))]
target_os = "netbsd", target_os = "android",
target_os = "ios",))]
ControlMessage::Ipv4PacketInfo(info) => mem::size_of_val(info),
#[cfg(any(target_os = "linux", target_os = "macos",
target_os = "netbsd", target_os = "freebsd",
target_os = "android"))]
target_os = "android", target_os = "ios",))]
ControlMessage::Ipv6PacketInfo(info) => mem::size_of_val(info),
}
}
Expand All @@ -890,11 +894,12 @@ impl<'a> ControlMessage<'a> {
#[cfg(target_os = "linux")]
ControlMessage::UdpGsoSegments(_) => libc::SOL_UDP,
#[cfg(any(target_os = "linux", target_os = "macos",
target_os = "netbsd", target_os = "android"))]
target_os = "netbsd", target_os = "android",
target_os = "ios",))]
ControlMessage::Ipv4PacketInfo(_) => libc::IPPROTO_IP,
#[cfg(any(target_os = "linux", target_os = "macos",
target_os = "netbsd", target_os = "freebsd",
target_os = "android"))]
target_os = "android", target_os = "ios",))]
ControlMessage::Ipv6PacketInfo(_) => libc::IPPROTO_IPV6,
}
}
Expand Down Expand Up @@ -924,11 +929,12 @@ impl<'a> ControlMessage<'a> {
libc::UDP_SEGMENT
},
#[cfg(any(target_os = "linux", target_os = "macos",
target_os = "netbsd", target_os = "android"))]
target_os = "netbsd", target_os = "android",
target_os = "ios",))]
ControlMessage::Ipv4PacketInfo(_) => libc::IP_PKTINFO,
#[cfg(any(target_os = "linux", target_os = "macos",
target_os = "netbsd", target_os = "freebsd",
target_os = "android"))]
target_os = "android", target_os = "ios",))]
ControlMessage::Ipv6PacketInfo(_) => libc::IPV6_PKTINFO,
}
}
Expand Down

0 comments on commit d12943d

Please sign in to comment.