2018-05-13 10:07:43 +00:00
|
|
|
/// <reference types="node" />
|
2018-05-13 18:32:55 +00:00
|
|
|
import { Message, MessageHeader, MessageQuestion, MessageRecourceRecord, ErrorCodes } from "./types";
|
2018-05-13 16:57:13 +00:00
|
|
|
export declare enum QueryTypes {
|
2018-05-13 10:07:43 +00:00
|
|
|
/**
|
|
|
|
* IPv4 address
|
|
|
|
*/
|
|
|
|
A = 1,
|
|
|
|
/**
|
|
|
|
* Nameserver
|
|
|
|
*/
|
|
|
|
NS = 2,
|
|
|
|
/**
|
|
|
|
* Obsolete
|
|
|
|
*/
|
|
|
|
MD = 3,
|
|
|
|
/**
|
|
|
|
* Obsolete
|
|
|
|
*/
|
|
|
|
MF = 4,
|
|
|
|
/**
|
|
|
|
* Alias
|
|
|
|
*/
|
|
|
|
CNAME = 5,
|
|
|
|
/**
|
|
|
|
* Start of authority
|
|
|
|
*/
|
|
|
|
SOA = 6,
|
|
|
|
/**
|
|
|
|
* Experimental
|
|
|
|
*/
|
|
|
|
MB = 7,
|
|
|
|
/**
|
|
|
|
* Experimental
|
|
|
|
*/
|
|
|
|
MG = 8,
|
|
|
|
/**
|
|
|
|
* Experimental
|
|
|
|
*/
|
|
|
|
MR = 9,
|
|
|
|
/**
|
|
|
|
* Experimental
|
|
|
|
*/
|
|
|
|
NULL = 10,
|
|
|
|
/**
|
|
|
|
* Service description
|
|
|
|
*/
|
|
|
|
WKS = 11,
|
|
|
|
/**
|
|
|
|
* Reverse entry (inaddr.arpa)
|
|
|
|
*/
|
|
|
|
PTR = 12,
|
|
|
|
/**
|
|
|
|
* Host information
|
|
|
|
*/
|
|
|
|
HINFO = 13,
|
|
|
|
/**
|
|
|
|
* Mailbox / Mail-list information
|
|
|
|
*/
|
|
|
|
MINFO = 14,
|
|
|
|
/**
|
|
|
|
* Mail exchange
|
|
|
|
*/
|
|
|
|
MX = 15,
|
|
|
|
/**
|
|
|
|
* Text strings
|
|
|
|
*/
|
|
|
|
TXT = 16,
|
|
|
|
/**
|
|
|
|
* IPv6 address
|
|
|
|
*/
|
|
|
|
AAAA = 28,
|
|
|
|
/**
|
|
|
|
* SRV records
|
|
|
|
*/
|
|
|
|
SRV = 33,
|
|
|
|
/**
|
|
|
|
* Request to transfer entire zone
|
|
|
|
*/
|
|
|
|
AXFR = 252,
|
|
|
|
/**
|
|
|
|
* Request for mailbox related records
|
|
|
|
*/
|
|
|
|
MAILA = 254,
|
|
|
|
/**
|
|
|
|
* Request for mail agend RRs
|
|
|
|
*/
|
|
|
|
MAILB = 253,
|
|
|
|
/**
|
|
|
|
* Any class
|
|
|
|
*/
|
|
|
|
ANY = 255,
|
|
|
|
}
|
2018-05-13 20:27:16 +00:00
|
|
|
export declare function SerializeName(name: string): Buffer;
|
2018-05-13 10:07:43 +00:00
|
|
|
export declare class Request implements Message {
|
|
|
|
private sendCallback;
|
2018-05-13 20:36:06 +00:00
|
|
|
private _header;
|
2018-05-13 10:07:43 +00:00
|
|
|
readonly header: MessageHeader;
|
2018-05-13 20:36:06 +00:00
|
|
|
private _questions;
|
2018-05-13 10:07:43 +00:00
|
|
|
readonly questions: MessageQuestion[];
|
|
|
|
answers: RecourceRecord[];
|
|
|
|
authorities: RecourceRecord[];
|
|
|
|
additionals: RecourceRecord[];
|
|
|
|
constructor(packet: Buffer, sendCallback: (packet: Buffer) => any);
|
2018-05-13 18:32:55 +00:00
|
|
|
error(error: ErrorCodes): void;
|
2018-05-13 20:34:20 +00:00
|
|
|
noRecursion(): void;
|
2018-05-13 10:07:43 +00:00
|
|
|
send(): void;
|
2018-05-13 17:27:40 +00:00
|
|
|
serialize(truncate?: boolean, rcode?: 0 | 1 | 2 | 3 | 4 | 5): Buffer;
|
2018-05-13 10:07:43 +00:00
|
|
|
private serializeHeader();
|
|
|
|
private serializeQuestion(question);
|
|
|
|
private serializeResourceRecord(record);
|
|
|
|
}
|
|
|
|
export declare class RecourceRecord implements MessageRecourceRecord {
|
|
|
|
NAME: string;
|
|
|
|
private _TYPE;
|
|
|
|
TYPE: number;
|
|
|
|
private _CLASS;
|
|
|
|
CLASS: number;
|
2018-05-13 17:27:40 +00:00
|
|
|
private _TTL;
|
2018-05-13 10:07:43 +00:00
|
|
|
TTL: number;
|
|
|
|
RDATA: Buffer;
|
|
|
|
readonly RDLENGTH: number;
|
|
|
|
}
|