Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added compatibility with node 0.6.x (enum function => _enum)

  • Loading branch information...
commit 95fc8b4e305082f4ec44473f0ac53df33a97bf49 1 parent 2ad6630
@stefounet authored
Showing with 11 additions and 11 deletions.
  1. +11 −11 lib/ndns.js
View
22 lib/ndns.js
@@ -30,14 +30,14 @@ var ns_in6addrsz = 16; // IPv6 T_AAAA
var ns_cmprsflgs = 0xc0;// Flag bits indicating name compression.
var ns_defaultport = 53;// For both UDP and TCP.
-function enum (obj) {
+function _enum (obj) {
for (key in obj) {
global[key] = obj[key];
}
return obj;
}
-var ns_sect = enum({
+var ns_sect = _enum({
'ns_s_qd': 0, // Query: Question.
'ns_s_zn': 0, // Update: Zone.
'ns_s_an': 1, // Query: Answer.
@@ -48,7 +48,7 @@ var ns_sect = enum({
'ns_s_max': 4,
});
-var ns_flag = enum({
+var ns_flag = _enum({
'ns_f_qr': 0, // Question/Response.
'ns_f_opcode': 1, // Operation code.
'ns_f_aa': 2, // Authorative Answer.
@@ -63,7 +63,7 @@ var ns_flag = enum({
});
// Currently defined opcodes.
-var ns_opcode = enum({
+var ns_opcode = _enum({
'ns_o_query': 0, // Standard query.
'ns_o_iquery': 1, // Inverse query (deprecated/unsupported).
'ns_o_status': 2, // Name server status query (unsupported).
@@ -73,7 +73,7 @@ var ns_opcode = enum({
});
// Currently defined response codes
-var ns_rcode = enum({
+var ns_rcode = _enum({
'ns_r_noerror': 0, // No error occured.
'ns_r_formerr': 1, // Format error.
'ns_r_servfail': 2, // Server failure.
@@ -96,13 +96,13 @@ var ns_rcode = enum({
});
// BIND_UPDATE
-var ns_update_operation = enum({
+var ns_update_operation = _enum({
'ns_oup_delete': 0,
'ns_oup_add': 1,
'ns_oup_max': 2,
});
-var NS_TSIG = enum({
+var NS_TSIG = _enum({
'NS_TSIG_FUDGE': 300,
'NS_TSIG_TCP_COUNT': 100,
'NS_TSIG_ALG_HMAC_MD5': "HMAC-MD5.SIG-ALG.REG.INT",
@@ -113,7 +113,7 @@ var NS_TSIG = enum({
});
// Currently defined type values for resources and queries.
-var ns_type = enum({
+var ns_type = _enum({
'ns_t_invalid': 0, // Cookie.
'ns_t_a': 1, // Host address.
'ns_t_ns': 2, // Authoritative server.
@@ -182,7 +182,7 @@ var ns_type = enum({
exports.ns_type = ns_type;
// Values for class field
-var ns_class = enum({
+var ns_class = _enum({
'ns_c_invalid': 0, // Cookie.
'ns_c_in': 1, // Internet.
'ns_c_2': 2, // unallocated/unsupported.
@@ -196,14 +196,14 @@ var ns_class = enum({
exports.ns_class = ns_class;
// DNSSEC constants.
-var ns_key_types = enum({
+var ns_key_types = _enum({
'ns_kt_rsa': 1, // key type RSA/MD5
'ns_kt_dh': 2, // Diffie Hellman
'ns_kt_dsa': 3, // Digital Signature Standard (MANDATORY)
'ns_kt_private': 4 // Private key type starts with OID
});
-var ns_cert_type = enum({
+var ns_cert_type = _enum({
'cert_t_pkix': 1, // PKIX (X.509v3)
'cert_t_spki': 2, // SPKI
'cert_t_pgp': 3, // PGP
Please sign in to comment.
Something went wrong with that request. Please try again.