CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/net/dns/dns.rb
Views: 1904
1
# -*- coding: binary -*-
2
##
3
#
4
# dns.rb
5
#
6
# $id$
7
#
8
##
9
10
module Net # :nodoc:
11
module DNS
12
13
# Version of the library
14
VERSION = "0.4"
15
16
# Packet size in bytes
17
PACKETSZ = 512
18
19
# Size of the header
20
HFIXEDSZ = 12
21
22
# Size of the question portion (type and class)
23
QFIXEDSZ = 4
24
25
# Size of an RR portion (type,class,length and ttl)
26
RRFIXEDSZ = 10
27
28
# Size of an int 32 bit
29
INT32SZ = 4
30
31
# Size of a short int
32
INT16SZ = 2
33
34
module QueryTypes
35
36
SIGZERO = 0
37
A = 1
38
NS = 2
39
MD = 3
40
MF = 4
41
CNAME = 5
42
SOA = 6
43
MB = 7
44
MG = 8
45
MR = 9
46
NULL = 10
47
WKS = 11
48
PTR = 12
49
HINFO = 13
50
MINFO = 14
51
MX = 15
52
TXT = 16
53
RP = 17
54
AFSDB = 18
55
X25 = 19
56
ISDN = 20
57
RT = 21
58
NSAP = 22
59
NSAPPTR = 23
60
SIG = 24
61
KEY = 25
62
PX = 26
63
GPOS = 27
64
AAAA = 28
65
LOC = 29
66
NXT = 30
67
EID = 31
68
NIMLOC = 32
69
SRV = 33
70
ATMA = 34
71
NAPTR = 35
72
KX = 36
73
CERT = 37
74
DNAME = 39
75
OPT = 41
76
DS = 43
77
SSHFP = 44
78
RRSIG = 46
79
NSEC = 47
80
DNSKEY = 48
81
UINFO = 100
82
UID = 101
83
GID = 102
84
UNSPEC = 103
85
TKEY = 249
86
TSIG = 250
87
IXFR = 251
88
AXFR = 252
89
MAILB = 253
90
MAILA = 254
91
ANY = 255
92
93
end
94
95
module QueryClasses
96
97
# Internet class
98
IN = 1
99
100
# Chaos class
101
CH = 3
102
103
# Hesiod class
104
HS = 4
105
106
# None class
107
NONE = 254
108
109
# Any class
110
ANY = 255
111
112
end
113
114
include QueryTypes
115
include QueryClasses
116
117
end # module DNS
118
end # module Net
119
120