Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE Resolver = POINTER TO ResolverRec; TYPE ResolverRec = RECORD (Services.ObjectRec) END;
TYPE IPv4AddressList = POINTER TO IPv4AddressListRec; TYPE IPv4AddressListRec = RECORD (Objects.ObjectRec) addr: IPv4Addresses.Address; next: IPv4AddressList; END;
TYPE IPv6AddressList = POINTER TO IPv6AddressListRec; TYPE IPv6AddressListRec = RECORD (Objects.ObjectRec) addr: IPv6Addresses.Address; next: IPv6AddressList; END;
TYPE HostnameList = POINTER TO HostnameListRec; TYPE HostnameListRec = RECORD (Objects.ObjectRec) hostname: DNSRecords.Name; next: HostnameList; END;
TYPE MXList = POINTER TO MXListRec; TYPE MXListRec = RECORD (Objects.ObjectRec) hostname: DNSRecords.Name; preference: INTEGER; next: MXList; END;
TYPE TXTList = POINTER TO TXTListRec; TYPE TXTListRec = RECORD (Objects.ObjectRec) text: DNSRecords.Name; next: TXTList; END;
TYPE GetRecordsProc = PROCEDURE(resolver: Resolver; hostname: ARRAY OF CHAR; rrtype: DNSRecords.RRType; trysuffixes: BOOLEAN; VAR records: DNSRecords.Record; errors: RelatedEvents.Object) : BOOLEAN; TYPE Interface = POINTER TO InterfaceRec; TYPE InterfaceRec = RECORD (Objects.ObjectRec) getRecords: GetRecordsProc; END;
CONST corruptedRecords = 0; CONST errors = 1; TYPE ErrorCode = SHORTINT; (* corruptedRecords... *) TYPE ErrorEvent = POINTER TO ErrorEventRec; TYPE ErrorEventRec = RECORD (Events.EventRec) errorcode: ErrorCode; domain: DNSRecords.Name; rrtype: DNSRecords.RRType; END; VAR errormsg: ARRAY errors OF Events.Message; VAR error: Events.EventType;
VAR std: Resolver; (* standard resolver *)
PROCEDURE Init(resolver: Resolver; if: Interface);
PROCEDURE GetRecords(resolver: Resolver; hostname: ARRAY OF CHAR; rrtype: DNSRecords.RRType; trysuffixes: BOOLEAN; VAR records: DNSRecords.Record; errors: RelatedEvents.Object) : BOOLEAN;
PROCEDURE GetIPv4AddrByHost(resolver: Resolver; hostname: ARRAY OF CHAR; VAR addresses: IPv4AddressList; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE GetIPv6AddrByHost(resolver: Resolver; hostname: ARRAY OF CHAR; VAR addresses: IPv6AddressList; errors: RelatedEvents.Object) : BOOLEAN;
PROCEDURE GetReverseRecords(resolver: Resolver; revname: ARRAY OF CHAR; VAR hosts: HostnameList; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE GetHostByIPv4Addr(resolver: Resolver; address: IPv4Addresses.Address; VAR hosts: HostnameList; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE GetHostByIPv6Addr(resolver: Resolver; address: IPv6Addresses.Address; VAR hosts: HostnameList; errors: RelatedEvents.Object) : BOOLEAN;
PROCEDURE GetMXRecords(resolver: Resolver; domain: ARRAY OF CHAR; VAR mxrecords: MXList; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE GetTXTRecords(resolver: Resolver; domain: ARRAY OF CHAR; VAR txtrecords: TXTList; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE GetAttribute(resolver: Resolver; domain: ARRAY OF CHAR; attribute: ARRAY OF CHAR; VAR value: ARRAY OF CHAR; errors: RelatedEvents.Object) : BOOLEAN;
Standard implementations (one candidate is DNSStdResolvers) are expected to make their implementation available through std. Note, however, that this variable is initially NIL as no default implementation is provided by DNSResolvers.
Implementations are required to implement following interface procedure:
GetRecords provides a direct access to the interface procedure.
GetIPv4AddrByHost and GetIPv6AddrByHost return all IPv4 and IPv6 addresses that are associated with hostname, respectively.
GetReverseRecords looks for PTR records associated with revname. As CNAME records are followed, classless delegations according to RFC 2317 are supported. The structure of the domain name revname depends on the address space to be used.
GetHostByIPv4Addr attempts to find the domain names associated with the given IPv4 address using GetReverseRecords with a corresponding revname of the ``in-addr.arpa'' domain according to RFC 1034. Likewise GetHostByIPv6Addr attempts to find the domain names for a given IPv6 address. This is at first attempted using the ``ip6.arpa'' domain according to RFC 3152 and, if this fails, using the ``ip6.int'' domain according to RFC 1886.
GetMXRecords returns all MX records associated with domain in no particular order.
GetTXTRecords returns all TXT records associated with domain in no particular order. Note that this operation presents all texts as flat list independent from their origin, be it from a separate record or be it from a text that is embedded among other texts within one record. GetAttribute supports the retrieval of attributes out of TXT records according to RFC 1464.
Oberon || Library || Module Index || Search Engine || Definition || Module