Struct trust_dns::authority::Catalog [] [src]

pub struct Catalog {
    // some fields omitted

Set of authorities, zones, available to this server.


impl Catalog

fn new() -> Self

fn handle_request(&self, request: &Message) -> Message

Determine's what needs to happen given the type of request, i.e. Query or Update.


  • request - the requested action to perform.

fn error_msg(id: u16, op_code: OpCode, response_code: ResponseCode) -> Message

fn upsert(&mut self, name: Name, authority: Authority)

fn update(&self, update: &Message) -> Message

Update the zone given the Update request.

RFC 2136, DNS Update, April 1997

3.1 - Process Zone Section

  3.1.1. The Zone Section is checked to see that there is exactly one
  RR therein and that the RR's ZTYPE is SOA, else signal FORMERR to the
  requestor.  Next, the ZNAME and ZCLASS are checked to see if the zone
  so named is one of this server's authority zones, else signal NOTAUTH
  to the requestor.  If the server is a zone slave, the request will be
  forwarded toward the primary master.

  3.1.2 - Pseudocode For Zone Section Processing

     if (zcount != 1 || ztype != SOA)
          return (FORMERR)
     if (zone_type(zname, zclass) == SLAVE)
          return forward()
     if (zone_type(zname, zclass) == MASTER)
          return update()
     return (NOTAUTH)

  Sections 3.2 through 3.8 describe the primary master's behaviour,
  whereas Section 6 describes a forwarder's behaviour.

3.8 - Response

  At the end of UPDATE processing, a response code will be known.  A
  response message is generated by copying the ID and Opcode fields
  from the request, and either copying the ZOCOUNT, PRCOUNT, UPCOUNT,
  and ADCOUNT fields and associated sections, or placing zeros (0) in
  the these "count" fields and not including any part of the original
  update.  The QR bit is set to one (1), and the response is sent back
  to the requestor.  If the requestor used UDP, then the response will
  be sent to the requestor's source UDP port.  If the requestor used
  TCP, then the response will be sent back on the requestor's open TCP

The "request" should be an update formatted message. The response will be in the alternate, all 0's format described in RFC 2136 section 3.8 as this is more efficient.


  • request - an update message

fn lookup(&self, request: &Message) -> Message

Given the requested query, lookup and return any matching results.


  • request - the query message.