Rename Cargo features: socket-* → proto-*.
This commit is contained in:
parent
e495544a85
commit
a9a00baa49
16
.travis.yml
16
.travis.yml
|
@ -10,21 +10,21 @@ matrix:
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: FEATURES='default' MODE='test'
|
env: FEATURES='default' MODE='test'
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: FEATURES='phy-raw_socket socket-udp' MODE='build'
|
env: FEATURES='phy-raw_socket proto-udp' MODE='build'
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: FEATURES='phy-tap_interface socket-udp' MODE='build'
|
env: FEATURES='phy-tap_interface proto-udp' MODE='build'
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: FEATURES='socket-raw' MODE='build'
|
env: FEATURES='proto-raw' MODE='build'
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: FEATURES='socket-udp' MODE='build'
|
env: FEATURES='proto-udp' MODE='build'
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: FEATURES='socket-tcp' MODE='build'
|
env: FEATURES='proto-tcp' MODE='build'
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: FEATURES='socket-raw socket-udp socket-tcp' MODE='build'
|
env: FEATURES='proto-raw proto-udp proto-tcp' MODE='build'
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: FEATURES='socket-raw socket-udp socket-tcp std' MODE='build'
|
env: FEATURES='proto-raw proto-udp proto-tcp std' MODE='build'
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
env: FEATURES='socket-raw socket-udp socket-tcp alloc' MODE='build'
|
env: FEATURES='proto-raw proto-udp proto-tcp alloc' MODE='build'
|
||||||
script:
|
script:
|
||||||
- cargo "$MODE" --no-default-features --features "$FEATURES"
|
- cargo "$MODE" --no-default-features --features "$FEATURES"
|
||||||
notifications:
|
notifications:
|
||||||
|
|
|
@ -28,12 +28,12 @@ alloc = ["managed/alloc"]
|
||||||
verbose = []
|
verbose = []
|
||||||
"phy-raw_socket" = ["std", "libc"]
|
"phy-raw_socket" = ["std", "libc"]
|
||||||
"phy-tap_interface" = ["std", "libc"]
|
"phy-tap_interface" = ["std", "libc"]
|
||||||
"socket-raw" = []
|
"proto-raw" = []
|
||||||
"socket-udp" = []
|
"proto-udp" = []
|
||||||
"socket-tcp" = []
|
"proto-tcp" = []
|
||||||
default = ["std", "log",
|
default = ["std", "log",
|
||||||
"phy-raw_socket", "phy-tap_interface",
|
"phy-raw_socket", "phy-tap_interface",
|
||||||
"socket-raw", "socket-udp", "socket-tcp"]
|
"proto-raw", "proto-udp", "proto-tcp"]
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "tcpdump"
|
name = "tcpdump"
|
||||||
|
|
|
@ -11,12 +11,12 @@ use wire::{IpAddress, IpProtocol, IpRepr, IpCidr};
|
||||||
use wire::{ArpPacket, ArpRepr, ArpOperation};
|
use wire::{ArpPacket, ArpRepr, ArpOperation};
|
||||||
use wire::{Ipv4Packet, Ipv4Repr};
|
use wire::{Ipv4Packet, Ipv4Repr};
|
||||||
use wire::{Icmpv4Packet, Icmpv4Repr, Icmpv4DstUnreachable};
|
use wire::{Icmpv4Packet, Icmpv4Repr, Icmpv4DstUnreachable};
|
||||||
#[cfg(feature = "socket-udp")] use wire::{UdpPacket, UdpRepr};
|
#[cfg(feature = "proto-udp")] use wire::{UdpPacket, UdpRepr};
|
||||||
#[cfg(feature = "socket-tcp")] use wire::{TcpPacket, TcpRepr, TcpControl};
|
#[cfg(feature = "proto-tcp")] use wire::{TcpPacket, TcpRepr, TcpControl};
|
||||||
use socket::{Socket, SocketSet, AnySocket};
|
use socket::{Socket, SocketSet, AnySocket};
|
||||||
#[cfg(feature = "socket-raw")] use socket::RawSocket;
|
#[cfg(feature = "proto-raw")] use socket::RawSocket;
|
||||||
#[cfg(feature = "socket-udp")] use socket::UdpSocket;
|
#[cfg(feature = "proto-udp")] use socket::UdpSocket;
|
||||||
#[cfg(feature = "socket-tcp")] use socket::TcpSocket;
|
#[cfg(feature = "proto-tcp")] use socket::TcpSocket;
|
||||||
use super::ArpCache;
|
use super::ArpCache;
|
||||||
|
|
||||||
/// An Ethernet network interface.
|
/// An Ethernet network interface.
|
||||||
|
@ -36,11 +36,11 @@ enum Packet<'a> {
|
||||||
None,
|
None,
|
||||||
Arp(ArpRepr),
|
Arp(ArpRepr),
|
||||||
Icmpv4(Ipv4Repr, Icmpv4Repr<'a>),
|
Icmpv4(Ipv4Repr, Icmpv4Repr<'a>),
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
Raw((IpRepr, &'a [u8])),
|
Raw((IpRepr, &'a [u8])),
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
Udp((IpRepr, UdpRepr<'a>)),
|
Udp((IpRepr, UdpRepr<'a>)),
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
Tcp((IpRepr, TcpRepr<'a>))
|
Tcp((IpRepr, TcpRepr<'a>))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,19 +203,19 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
|
||||||
let mut device_result = Ok(());
|
let mut device_result = Ok(());
|
||||||
let socket_result =
|
let socket_result =
|
||||||
match *socket {
|
match *socket {
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
Socket::Raw(ref mut socket) =>
|
Socket::Raw(ref mut socket) =>
|
||||||
socket.dispatch(|response| {
|
socket.dispatch(|response| {
|
||||||
device_result = self.dispatch(timestamp, Packet::Raw(response));
|
device_result = self.dispatch(timestamp, Packet::Raw(response));
|
||||||
device_result
|
device_result
|
||||||
}, &caps.checksum),
|
}, &caps.checksum),
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
Socket::Udp(ref mut socket) =>
|
Socket::Udp(ref mut socket) =>
|
||||||
socket.dispatch(|response| {
|
socket.dispatch(|response| {
|
||||||
device_result = self.dispatch(timestamp, Packet::Udp(response));
|
device_result = self.dispatch(timestamp, Packet::Udp(response));
|
||||||
device_result
|
device_result
|
||||||
}),
|
}),
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
Socket::Tcp(ref mut socket) =>
|
Socket::Tcp(ref mut socket) =>
|
||||||
socket.dispatch(timestamp, &caps, |response| {
|
socket.dispatch(timestamp, &caps, |response| {
|
||||||
device_result = self.dispatch(timestamp, Packet::Tcp(response));
|
device_result = self.dispatch(timestamp, Packet::Tcp(response));
|
||||||
|
@ -322,11 +322,11 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
|
||||||
let ip_repr = IpRepr::Ipv4(ipv4_repr);
|
let ip_repr = IpRepr::Ipv4(ipv4_repr);
|
||||||
let ip_payload = ipv4_packet.payload();
|
let ip_payload = ipv4_packet.payload();
|
||||||
|
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
let mut handled_by_raw_socket = false;
|
let mut handled_by_raw_socket = false;
|
||||||
|
|
||||||
// Pass every IP packet to all raw sockets we have registered.
|
// Pass every IP packet to all raw sockets we have registered.
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
for mut raw_socket in sockets.iter_mut().filter_map(RawSocket::downcast) {
|
for mut raw_socket in sockets.iter_mut().filter_map(RawSocket::downcast) {
|
||||||
if !raw_socket.accepts(&ip_repr) { continue }
|
if !raw_socket.accepts(&ip_repr) { continue }
|
||||||
|
|
||||||
|
@ -349,15 +349,15 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
|
||||||
IpProtocol::Icmp =>
|
IpProtocol::Icmp =>
|
||||||
self.process_icmpv4(ipv4_repr, ip_payload),
|
self.process_icmpv4(ipv4_repr, ip_payload),
|
||||||
|
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
IpProtocol::Udp =>
|
IpProtocol::Udp =>
|
||||||
self.process_udp(sockets, ip_repr, ip_payload),
|
self.process_udp(sockets, ip_repr, ip_payload),
|
||||||
|
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
IpProtocol::Tcp =>
|
IpProtocol::Tcp =>
|
||||||
self.process_tcp(sockets, _timestamp, ip_repr, ip_payload),
|
self.process_tcp(sockets, _timestamp, ip_repr, ip_payload),
|
||||||
|
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
_ if handled_by_raw_socket =>
|
_ if handled_by_raw_socket =>
|
||||||
Ok(Packet::None),
|
Ok(Packet::None),
|
||||||
|
|
||||||
|
@ -411,7 +411,7 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
fn process_udp<'frame>(&self, sockets: &mut SocketSet,
|
fn process_udp<'frame>(&self, sockets: &mut SocketSet,
|
||||||
ip_repr: IpRepr, ip_payload: &'frame [u8]) ->
|
ip_repr: IpRepr, ip_payload: &'frame [u8]) ->
|
||||||
Result<Packet<'frame>> {
|
Result<Packet<'frame>> {
|
||||||
|
@ -454,7 +454,7 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
fn process_tcp<'frame>(&self, sockets: &mut SocketSet, timestamp: u64,
|
fn process_tcp<'frame>(&self, sockets: &mut SocketSet, timestamp: u64,
|
||||||
ip_repr: IpRepr, ip_payload: &'frame [u8]) ->
|
ip_repr: IpRepr, ip_payload: &'frame [u8]) ->
|
||||||
Result<Packet<'frame>> {
|
Result<Packet<'frame>> {
|
||||||
|
@ -507,13 +507,13 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
|
||||||
icmpv4_repr.emit(&mut Icmpv4Packet::new(payload), &checksum_caps);
|
icmpv4_repr.emit(&mut Icmpv4Packet::new(payload), &checksum_caps);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
Packet::Raw((ip_repr, raw_packet)) => {
|
Packet::Raw((ip_repr, raw_packet)) => {
|
||||||
self.dispatch_ip(timestamp, ip_repr, |_ip_repr, payload| {
|
self.dispatch_ip(timestamp, ip_repr, |_ip_repr, payload| {
|
||||||
payload.copy_from_slice(raw_packet);
|
payload.copy_from_slice(raw_packet);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
Packet::Udp((ip_repr, udp_repr)) => {
|
Packet::Udp((ip_repr, udp_repr)) => {
|
||||||
self.dispatch_ip(timestamp, ip_repr, |ip_repr, payload| {
|
self.dispatch_ip(timestamp, ip_repr, |ip_repr, payload| {
|
||||||
udp_repr.emit(&mut UdpPacket::new(payload),
|
udp_repr.emit(&mut UdpPacket::new(payload),
|
||||||
|
@ -521,7 +521,7 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
|
||||||
&checksum_caps);
|
&checksum_caps);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
Packet::Tcp((ip_repr, mut tcp_repr)) => {
|
Packet::Tcp((ip_repr, mut tcp_repr)) => {
|
||||||
let caps = self.device.capabilities();
|
let caps = self.device.capabilities();
|
||||||
self.dispatch_ip(timestamp, ip_repr, |ip_repr, payload| {
|
self.dispatch_ip(timestamp, ip_repr, |ip_repr, payload| {
|
||||||
|
|
|
@ -69,9 +69,9 @@
|
||||||
//! of a packet, it is still logged correctly and in full.
|
//! of a packet, it is still logged correctly and in full.
|
||||||
|
|
||||||
/* XXX compiler bug
|
/* XXX compiler bug
|
||||||
#![cfg(not(any(feature = "socket-raw",
|
#![cfg(not(any(feature = "proto-raw",
|
||||||
feature = "socket-udp",
|
feature = "proto-udp",
|
||||||
feature = "socket-tcp")))]
|
feature = "proto-tcp")))]
|
||||||
compile_error!("at least one socket needs to be enabled"); */
|
compile_error!("at least one socket needs to be enabled"); */
|
||||||
|
|
||||||
extern crate byteorder;
|
extern crate byteorder;
|
||||||
|
|
|
@ -13,23 +13,23 @@
|
||||||
use core::marker::PhantomData;
|
use core::marker::PhantomData;
|
||||||
use wire::IpRepr;
|
use wire::IpRepr;
|
||||||
|
|
||||||
#[cfg(feature = "socket-raw")] mod raw;
|
#[cfg(feature = "proto-raw")] mod raw;
|
||||||
#[cfg(feature = "socket-udp")] mod udp;
|
#[cfg(feature = "proto-udp")] mod udp;
|
||||||
#[cfg(feature = "socket-tcp")] mod tcp;
|
#[cfg(feature = "proto-tcp")] mod tcp;
|
||||||
mod set;
|
mod set;
|
||||||
mod ref_;
|
mod ref_;
|
||||||
|
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
pub use self::raw::{PacketBuffer as RawPacketBuffer,
|
pub use self::raw::{PacketBuffer as RawPacketBuffer,
|
||||||
SocketBuffer as RawSocketBuffer,
|
SocketBuffer as RawSocketBuffer,
|
||||||
RawSocket};
|
RawSocket};
|
||||||
|
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
pub use self::udp::{PacketBuffer as UdpPacketBuffer,
|
pub use self::udp::{PacketBuffer as UdpPacketBuffer,
|
||||||
SocketBuffer as UdpSocketBuffer,
|
SocketBuffer as UdpSocketBuffer,
|
||||||
UdpSocket};
|
UdpSocket};
|
||||||
|
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
pub use self::tcp::{SocketBuffer as TcpSocketBuffer,
|
pub use self::tcp::{SocketBuffer as TcpSocketBuffer,
|
||||||
State as TcpState,
|
State as TcpState,
|
||||||
TcpSocket};
|
TcpSocket};
|
||||||
|
@ -52,11 +52,11 @@ pub(crate) use self::ref_::Session as SocketSession;
|
||||||
/// [SocketSet::get]: struct.SocketSet.html#method.get
|
/// [SocketSet::get]: struct.SocketSet.html#method.get
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum Socket<'a, 'b: 'a> {
|
pub enum Socket<'a, 'b: 'a> {
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
Raw(RawSocket<'a, 'b>),
|
Raw(RawSocket<'a, 'b>),
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
Udp(UdpSocket<'a, 'b>),
|
Udp(UdpSocket<'a, 'b>),
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
Tcp(TcpSocket<'a>),
|
Tcp(TcpSocket<'a>),
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
__Nonexhaustive(PhantomData<(&'a (), &'b ())>)
|
__Nonexhaustive(PhantomData<(&'a (), &'b ())>)
|
||||||
|
@ -65,11 +65,11 @@ pub enum Socket<'a, 'b: 'a> {
|
||||||
macro_rules! dispatch_socket {
|
macro_rules! dispatch_socket {
|
||||||
($self_:expr, |$socket:ident [$( $mut_:tt )*]| $code:expr) => ({
|
($self_:expr, |$socket:ident [$( $mut_:tt )*]| $code:expr) => ({
|
||||||
match $self_ {
|
match $self_ {
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
&$( $mut_ )* Socket::Raw(ref $( $mut_ )* $socket) => $code,
|
&$( $mut_ )* Socket::Raw(ref $( $mut_ )* $socket) => $code,
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
&$( $mut_ )* Socket::Udp(ref $( $mut_ )* $socket) => $code,
|
&$( $mut_ )* Socket::Udp(ref $( $mut_ )* $socket) => $code,
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
&$( $mut_ )* Socket::Tcp(ref $( $mut_ )* $socket) => $code,
|
&$( $mut_ )* Socket::Tcp(ref $( $mut_ )* $socket) => $code,
|
||||||
&$( $mut_ )* Socket::__Nonexhaustive(_) => unreachable!()
|
&$( $mut_ )* Socket::__Nonexhaustive(_) => unreachable!()
|
||||||
}
|
}
|
||||||
|
@ -119,9 +119,9 @@ macro_rules! from_socket {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
from_socket!(RawSocket<'a, 'b>, Raw);
|
from_socket!(RawSocket<'a, 'b>, Raw);
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
from_socket!(UdpSocket<'a, 'b>, Udp);
|
from_socket!(UdpSocket<'a, 'b>, Udp);
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
from_socket!(TcpSocket<'a>, Tcp);
|
from_socket!(TcpSocket<'a>, Tcp);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
use core::ops::{Deref, DerefMut};
|
use core::ops::{Deref, DerefMut};
|
||||||
|
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
use socket::RawSocket;
|
use socket::RawSocket;
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
use socket::UdpSocket;
|
use socket::UdpSocket;
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
use socket::TcpSocket;
|
use socket::TcpSocket;
|
||||||
|
|
||||||
/// A trait for tracking a socket usage session.
|
/// A trait for tracking a socket usage session.
|
||||||
|
@ -17,11 +17,11 @@ pub trait Session {
|
||||||
fn finish(&mut self) {}
|
fn finish(&mut self) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
impl<'a, 'b> Session for RawSocket<'a, 'b> {}
|
impl<'a, 'b> Session for RawSocket<'a, 'b> {}
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
impl<'a, 'b> Session for UdpSocket<'a, 'b> {}
|
impl<'a, 'b> Session for UdpSocket<'a, 'b> {}
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
impl<'a> Session for TcpSocket<'a> {}
|
impl<'a> Session for TcpSocket<'a> {}
|
||||||
|
|
||||||
/// A smart pointer to a socket.
|
/// A smart pointer to a socket.
|
||||||
|
|
|
@ -2,7 +2,7 @@ use core::{fmt, slice};
|
||||||
use managed::ManagedSlice;
|
use managed::ManagedSlice;
|
||||||
|
|
||||||
use super::{Socket, SocketRef, AnySocket};
|
use super::{Socket, SocketRef, AnySocket};
|
||||||
#[cfg(feature = "socket-tcp")] use super::TcpState;
|
#[cfg(feature = "proto-tcp")] use super::TcpState;
|
||||||
|
|
||||||
/// An item of a socket set.
|
/// An item of a socket set.
|
||||||
///
|
///
|
||||||
|
@ -140,13 +140,13 @@ impl<'a, 'b: 'a, 'c: 'a + 'b> Set<'a, 'b, 'c> {
|
||||||
let mut may_remove = false;
|
let mut may_remove = false;
|
||||||
if let &mut Some(Item { refs: 0, ref mut socket }) = item {
|
if let &mut Some(Item { refs: 0, ref mut socket }) = item {
|
||||||
match socket {
|
match socket {
|
||||||
#[cfg(feature = "socket-raw")]
|
#[cfg(feature = "proto-raw")]
|
||||||
&mut Socket::Raw(_) =>
|
&mut Socket::Raw(_) =>
|
||||||
may_remove = true,
|
may_remove = true,
|
||||||
#[cfg(feature = "socket-udp")]
|
#[cfg(feature = "proto-udp")]
|
||||||
&mut Socket::Udp(_) =>
|
&mut Socket::Udp(_) =>
|
||||||
may_remove = true,
|
may_remove = true,
|
||||||
#[cfg(feature = "socket-tcp")]
|
#[cfg(feature = "proto-tcp")]
|
||||||
&mut Socket::Tcp(ref mut socket) =>
|
&mut Socket::Tcp(ref mut socket) =>
|
||||||
if socket.state() == TcpState::Closed {
|
if socket.state() == TcpState::Closed {
|
||||||
may_remove = true
|
may_remove = true
|
||||||
|
|
Loading…
Reference in New Issue