pub struct DnsInterceptor { /* private fields */ }Expand description
DNS interceptor that resolves queries via host nameservers.
Implementations§
Source§impl DnsInterceptor
impl DnsInterceptor
Sourcepub fn new(
filter: DnsFilter,
pin_set: Arc<RwLock<DnsPinSet>>,
gateway_ips: Vec<IpAddr>,
) -> Result<Self>
pub fn new( filter: DnsFilter, pin_set: Arc<RwLock<DnsPinSet>>, gateway_ips: Vec<IpAddr>, ) -> Result<Self>
Creates a new DNS interceptor.
Returns an error if the system DNS resolver configuration cannot be read.
Sourcepub async fn maybe_intercept(
&self,
frame: &ParsedFrame<'_>,
) -> DnsInterceptResult
pub async fn maybe_intercept( &self, frame: &ParsedFrame<'_>, ) -> DnsInterceptResult
Checks if a frame is a DNS query to the gateway and resolves it locally.
Returns NotIntercepted if the frame should continue to the backend,
Intercepted if the frame was consumed locally without a response yet,
or one or more synthesized DNS responses.
Auto Trait Implementations§
impl !Freeze for DnsInterceptor
impl !RefUnwindSafe for DnsInterceptor
impl Send for DnsInterceptor
impl Sync for DnsInterceptor
impl Unpin for DnsInterceptor
impl UnsafeUnpin for DnsInterceptor
impl !UnwindSafe for DnsInterceptor
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more