pub trait IpSocketProperties<DeviceClass> {
// Required methods
fn family_matches(&self, family: &IpVersion) -> bool;
fn src_addr_matches(&self, addr: &AgnosticAddressMatcher) -> bool;
fn dst_addr_matches(&self, addr: &AgnosticAddressMatcher) -> bool;
fn transport_protocol_matches(
&self,
matcher: &SocketTransportProtocolMatcher,
) -> bool;
fn bound_interface_matches(
&self,
iface: &BoundInterfaceMatcher<DeviceClass>,
) -> bool;
fn cookie_matches(&self, cookie: &SocketCookieMatcher) -> bool;
fn mark1_matches(&self, mark: &MarkMatcher) -> bool;
fn mark2_matches(&self, mark: &MarkMatcher) -> bool;
}
Expand description
Allows code to match on properties of a socket without Netstack3 Core having to specifically expose that state.
Required Methods§
Sourcefn family_matches(&self, family: &IpVersion) -> bool
fn family_matches(&self, family: &IpVersion) -> bool
Returns whether the provided IP version matches the socket.
Sourcefn src_addr_matches(&self, addr: &AgnosticAddressMatcher) -> bool
fn src_addr_matches(&self, addr: &AgnosticAddressMatcher) -> bool
Returns whether the provided address matcher matches the socket’s source address.
Sourcefn dst_addr_matches(&self, addr: &AgnosticAddressMatcher) -> bool
fn dst_addr_matches(&self, addr: &AgnosticAddressMatcher) -> bool
Returns whether the provided address matcher matches the socket’s destination address.
Sourcefn transport_protocol_matches(
&self,
matcher: &SocketTransportProtocolMatcher,
) -> bool
fn transport_protocol_matches( &self, matcher: &SocketTransportProtocolMatcher, ) -> bool
Returns whether the transport protocol matches the socket’s transport-layer information.
Sourcefn bound_interface_matches(
&self,
iface: &BoundInterfaceMatcher<DeviceClass>,
) -> bool
fn bound_interface_matches( &self, iface: &BoundInterfaceMatcher<DeviceClass>, ) -> bool
Returns whether the provided interface matcher matches the socket’s bound interface, if present.
Returns whether the provided cookie matcher matches the socket’s cookie.
Sourcefn mark1_matches(&self, mark: &MarkMatcher) -> bool
fn mark1_matches(&self, mark: &MarkMatcher) -> bool
Returns whether the provided mark matcher matches the socket’s mark 1, if present.
Sourcefn mark2_matches(&self, mark: &MarkMatcher) -> bool
fn mark2_matches(&self, mark: &MarkMatcher) -> bool
Returns whether the provided mark matcher matches the socket’s mark 2, if present.