Sign in

    chgttyyr/moon_dns/src/transport does not have a README file

    DnsServer

    pub(all) struct DnsServer {
    zone :
    Zone

    query_count : UInt64
    error_count : UInt64
    } derive(
    Debug
    )

    High-level Server Dispatcher representing an Authoritative DNS Server instance

    DnsServer::new

    Create a new DnsServer for a given Zone database

    DnsServer::process_tcp

    fn DnsServer::process_tcp(self : DnsServer, raw_tcp_frame : Bytes) -> Result[Bytes,
    DnsError
    ]

    Process an incoming raw TCP stream payload and return 2-byte prefixed response bytes

    DnsServer::process_udp

    fn DnsServer::process_udp(self : DnsServer, raw_request : Bytes) -> Result[Bytes,
    DnsError
    ]

    Process an incoming raw UDP datagram and return response bytes (or Err)

    decode_tcp_frame

    Unpack a 2-byte length-prefixed DNS message from a TCP stream

    encode_tcp_frame

    fn encode_tcp_frame(message_bytes : Bytes) -> Bytes

    Pack a DNS message with a 2-byte big-endian length prefix for TCP transmission (RFC 1035 Section 4.2.2)

    handle_dns_packet

    fn handle_dns_packet(zone :
    Zone
    , request_bytes : Bytes, is_tcp : Bool) -> Result[Bytes,
    DnsError
    ]

    Core pure-memory DNS packet dispatcher (zero-I/O pipeline)

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io