File: dns.rb

package info (click to toggle)
ruby-net-dns 0.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 452 kB
  • sloc: ruby: 3,944; makefile: 6
file content (104 lines) | stat: -rw-r--r-- 1,954 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
require_relative 'dns/version'
require_relative 'dns/resolver'
require_relative 'dns/rr'

module Net
  module DNS
    # Packet size in bytes
    PACKETSZ  = 512

    # Size of the header
    HFIXEDSZ  = 12

    # Size of the question portion (type and class)
    QFIXEDSZ  = 4

    # Size of an RR portion (type,class,lenght and ttl)
    RRFIXEDSZ = 10

    # Size of an int 32 bit
    INT32SZ   = 4

    # Size of a short int
    INT16SZ   = 2

    module QueryTypes
      SIGZERO   = 0
      A         = 1
      NS        = 2
      MD        = 3
      MF        = 4
      CNAME     = 5
      SOA       = 6
      MB        = 7
      MG        = 8
      MR        = 9
      NULL      = 10
      WKS       = 11
      PTR       = 12
      HINFO     = 13
      MINFO     = 14
      MX        = 15
      TXT       = 16
      RP        = 17
      AFSDB     = 18
      X25       = 19
      ISDN      = 20
      RT        = 21
      NSAP      = 22
      NSAPPTR   = 23
      SIG       = 24
      KEY       = 25
      PX        = 26
      GPOS      = 27
      AAAA      = 28
      LOC       = 29
      NXT       = 30
      EID       = 31
      NIMLOC    = 32
      SRV       = 33
      ATMA      = 34
      NAPTR     = 35
      KX        = 36
      CERT      = 37
      DNAME     = 39
      OPT       = 41
      DS        = 43
      SSHFP     = 44
      RRSIG     = 46
      NSEC      = 47
      DNSKEY    = 48
      UINFO     = 100
      UID       = 101
      GID       = 102
      UNSPEC    = 103
      TKEY      = 249
      TSIG      = 250
      IXFR      = 251
      AXFR      = 252
      MAILB     = 253
      MAILA     = 254
      ANY       = 255
    end

    module QueryClasses
      # Internet class
      IN        = 1

      # Chaos class
      CH        = 3

      # Hesiod class
      HS        = 4

      # None class
      NONE      = 254

      # Any class
      ANY       = 255
    end

    include QueryTypes
    include QueryClasses
  end
end