CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/net/dns/rr/null.rb
Views: 11784
1
# -*- coding: binary -*-
2
##
3
#
4
# Net::DNS::RR::NULL
5
#
6
# $Id: NULL.rb,v 1.5 2006/07/28 07:33:36 bluemonk Exp $
7
#
8
##
9
10
11
module Net
12
module DNS
13
class RR
14
15
#------------------------------------------------------------
16
# RR type NULL
17
#------------------------------------------------------------
18
class NULL < RR
19
attr_reader :null
20
21
private
22
23
def build_pack
24
@null_pack = @null
25
@rdlength = @null_pack.size
26
end
27
28
def set_type
29
@type = Net::DNS::RR::RRTypes.new("NULL")
30
end
31
32
def get_data
33
@null_pack
34
end
35
36
def get_inspect
37
"#@null"
38
end
39
40
def subclass_new_from_hash(args)
41
if args.has_key? :null
42
@null = args[:null]
43
else
44
raise RRArgumentError, ":null field is mandatory but missing"
45
end
46
end
47
48
def subclass_new_from_string(str)
49
@null = str.strip
50
end
51
52
def subclass_new_from_binary(data,offset)
53
@null = data[offset..offset+@rdlength]
54
return offset + @rdlength
55
end
56
57
end # class NULL
58
59
end # class RR
60
end # module DNS
61
end # module Net
62
63