From 57c638316ece55c69bae3c6ea3a2ceee5ec963f9 Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Sun, 13 May 2018 20:32:55 +0200 Subject: [PATCH] Adding ErrorCode enum --- lib/request.d.ts | 3 ++- lib/request.js | 3 +++ lib/request.js.map | 2 +- lib/types.d.ts | 10 +++++++++- lib/types.js | 17 +++++++++++++++++ lib/types.js.map | 2 +- package.json | 2 +- src/request.ts | 6 +++++- src/types.ts | 20 +++++++++++++++++++- 9 files changed, 58 insertions(+), 7 deletions(-) diff --git a/lib/request.d.ts b/lib/request.d.ts index 523b663..74f118f 100644 --- a/lib/request.d.ts +++ b/lib/request.d.ts @@ -1,5 +1,5 @@ /// -import { Message, MessageHeader, MessageQuestion, MessageRecourceRecord } from "./types"; +import { Message, MessageHeader, MessageQuestion, MessageRecourceRecord, ErrorCodes } from "./types"; export declare enum QueryTypes { /** * IPv4 address @@ -101,6 +101,7 @@ export declare class Request implements Message { additionals: RecourceRecord[]; _packet: Buffer; constructor(packet: Buffer, sendCallback: (packet: Buffer) => any); + error(error: ErrorCodes): void; send(): void; serialize(truncate?: boolean, rcode?: 0 | 1 | 2 | 3 | 4 | 5): Buffer; private serializeHeader(); diff --git a/lib/request.js b/lib/request.js index 38254b5..1ab0060 100644 --- a/lib/request.js +++ b/lib/request.js @@ -160,6 +160,9 @@ class Request { get questions() { return this._questions.map(e => e); } + error(error) { + this._header.RCODE = error; + } send() { this.sendCallback(this.serialize()); } diff --git a/lib/request.js.map b/lib/request.js.map index 67f6b07..141af7d 100644 --- a/lib/request.js.map +++ b/lib/request.js.map @@ -1 +1 @@ -{"version":3,"file":"request.js","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":";;AAAA,iDAAsC;AAGtC,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,IAAY,UA8GX;AA9GD,WAAY,UAAU;IACnB;;OAEG;IACH,qCAAQ,CAAA;IAER;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS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,CAAC,CAAA;QAC9E,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,KAAK;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACtB,CAAC;IAGD,IAAI,GAAG,CAAC,KAAK;QACV,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,UAAU;YAAE,MAAM,IAAI,SAAS,CAAC,8BAA8B,CAAC,CAAA;IAC3F,CAAC;IAED,IAAI,GAAG;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC;IACpB,CAAC;IAID,IAAI,QAAQ;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC5B,CAAC;CACH;AApCD,wCAoCC"} \ No newline at end of file +{"version":3,"file":"request.js","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":";;AAAA,iDAAsC;AAGtC,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,IAAY,UA8GX;AA9GD,WAAY,UAAU;IACnB;;OAEG;IACH,qCAAQ,CAAA;IAER;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,6CAAY,CAAA;IAEZ;;OAEG;IACH,yCAAU,CAAA;IAEV;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,uCAAS,CAAA;IAET;;OAEG;IACH,4CAAW,CAAA;IAEX;;OAEG;IACH,0CAAU,CAAA;IAEV;;OAEG;IACH,0CAAU,CAAA;IAEV;;OAEG;IACH,8CAAY,CAAA;IAEZ;;OAEG;IACH,8CAAY,CAAA;IAEZ;;OAEG;IACH,wCAAS,CAAA;IAET;;OAEG;IACH,0CAAU,CAAA;IAEV;;OAEG;IACH,4CAAW,CAAA;IAEX;;OAEG;IACH,0CAAU,CAAA;IAEV;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,+CAAY,CAAA;IAEZ;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of file diff --git a/lib/types.d.ts b/lib/types.d.ts index 6ae6107..3126c4c 100644 --- a/lib/types.d.ts +++ b/lib/types.d.ts @@ -1,4 +1,12 @@ /// +export declare enum ErrorCodes { + NoError = 0, + FormatError = 1, + ServerFailure = 2, + NameError = 3, + NotImplemented = 4, + Refused = 5, +} export interface MessageHeader { /** * A 16 bit identifier assigned by the program that @@ -61,7 +69,7 @@ export interface MessageHeader { * 5 Refused - Nameserver refuses request * 6-15 Reserved for future usage */ - RCODE: 0 | 1 | 2 | 3 | 4 | 5; + RCODE: ErrorCodes; /** * Number of entries in question section * uint16 diff --git a/lib/types.js b/lib/types.js index 11e638d..613ffa9 100644 --- a/lib/types.js +++ b/lib/types.js @@ -1,3 +1,20 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +// 0 No error condition +// * 1 Format error - unable to interpret query +// * 2 Server failure - internal problem +// * 3 Name error - Only for authorative name server, domain name of query does not exist +// * 4 Not implemented - Request not supported +// * 5 Refused - Nameserver refuses request +// * 6 - 15 Reserved for future usage +// * +var ErrorCodes; +(function (ErrorCodes) { + ErrorCodes[ErrorCodes["NoError"] = 0] = "NoError"; + ErrorCodes[ErrorCodes["FormatError"] = 1] = "FormatError"; + ErrorCodes[ErrorCodes["ServerFailure"] = 2] = "ServerFailure"; + ErrorCodes[ErrorCodes["NameError"] = 3] = "NameError"; + ErrorCodes[ErrorCodes["NotImplemented"] = 4] = "NotImplemented"; + ErrorCodes[ErrorCodes["Refused"] = 5] = "Refused"; +})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {})); //# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/lib/types.js.map b/lib/types.js.map index c768b79..d3c1f30 100644 --- a/lib/types.js.map +++ b/lib/types.js.map @@ -1 +1 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AACA,uBAAuB;AACvB,kDAAkD;AAClD,8CAA8C;AAC9C,kGAAkG;AAClG,0DAA0D;AAC1D,0DAA0D;AAC1D,wCAAwC;AACxC,WAAW;AACX,IAAY,UAOX;AAPD,WAAY,UAAU;IACnB,iDAAW,CAAA;IACX,yDAAW,CAAA;IACX,6DAAa,CAAA;IACb,qDAAS,CAAA;IACT,+DAAc,CAAA;IACd,iDAAO,CAAA;AACV,CAAC,EAPW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAOrB"} \ No newline at end of file diff --git a/package.json b/package.json index f2c78f2..b7008e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodename-core", - "version": "0.1.3", + "version": "0.1.4", "main": "lib/listener.js", "types": "lib/listener.d.ts", "author": "Fabian Stamm ", diff --git a/src/request.ts b/src/request.ts index 80435b0..3835254 100644 --- a/src/request.ts +++ b/src/request.ts @@ -1,5 +1,5 @@ import { Parser } from "binary-parser" -import { Message, MessageHeader, MessageQuestion, MessageRecourceRecord } from "./types" +import { Message, MessageHeader, MessageQuestion, MessageRecourceRecord, ErrorCodes } from "./types" const MAX_LABEL_SIZE = 63; @@ -193,6 +193,10 @@ export class Request implements Message { this._questions = parseQuestions(this._header.QDCOUNT, bodyData); } + error(error: ErrorCodes) { + this._header.RCODE = error; + } + send() { this.sendCallback(this.serialize()); } diff --git a/src/types.ts b/src/types.ts index b0b1523..3b77193 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,3 +1,21 @@ + +// 0 No error condition +// * 1 Format error - unable to interpret query +// * 2 Server failure - internal problem +// * 3 Name error - Only for authorative name server, domain name of query does not exist +// * 4 Not implemented - Request not supported +// * 5 Refused - Nameserver refuses request +// * 6 - 15 Reserved for future usage +// * +export enum ErrorCodes { + NoError = 0, + FormatError, + ServerFailure, + NameError, + NotImplemented, + Refused +} + export interface MessageHeader { /** * A 16 bit identifier assigned by the program that @@ -69,7 +87,7 @@ export interface MessageHeader { * 5 Refused - Nameserver refuses request * 6-15 Reserved for future usage */ - RCODE: 0 | 1 | 2 | 3 | 4 | 5; + RCODE: ErrorCodes; /** * Number of entries in question section