Trait DNSResolverMessageHandler
pub trait DNSResolverMessageHandler {
// Required methods
fn handle_dnssec_query(
&self,
message: DNSSECQuery,
responder: Option<Responder>,
) -> Option<(DNSResolverMessage, ResponseInstruction)>;
fn handle_dnssec_proof(
&self,
message: DNSSECProof,
context: DNSResolverContext,
);
// Provided methods
fn provided_node_features(&self) -> Features<NodeContext> { ... }
fn release_pending_messages(
&self,
) -> Vec<(DNSResolverMessage, MessageSendInstructions)> { ... }
}
Expand description
A handler for an OnionMessage
containing a DNS(SEC) query or a DNSSEC proof
Required Methods§
fn handle_dnssec_query(
&self,
message: DNSSECQuery,
responder: Option<Responder>,
) -> Option<(DNSResolverMessage, ResponseInstruction)>
fn handle_dnssec_query( &self, message: DNSSECQuery, responder: Option<Responder>, ) -> Option<(DNSResolverMessage, ResponseInstruction)>
Handle a DNSSECQuery
message.
If we provide DNS resolution services to third parties, we should respond with a
DNSSECProof
message.
fn handle_dnssec_proof(&self, message: DNSSECProof, context: DNSResolverContext)
fn handle_dnssec_proof(&self, message: DNSSECProof, context: DNSResolverContext)
Handle a DNSSECProof
message (in response to a DNSSECQuery
we presumably sent).
With this, we should be able to validate the DNS record we requested.
Provided Methods§
fn provided_node_features(&self) -> Features<NodeContext>
fn provided_node_features(&self) -> Features<NodeContext>
Gets the node feature flags which this handler itself supports. Useful for setting the
dns_resolver
flag if this handler supports returning DNSSECProof
messages in response
to DNSSECQuery
messages.
fn release_pending_messages(
&self,
) -> Vec<(DNSResolverMessage, MessageSendInstructions)>
fn release_pending_messages( &self, ) -> Vec<(DNSResolverMessage, MessageSendInstructions)>
Release any DNSResolverMessage
s that need to be sent.