1Net::DNS::RR::OPT(3) User Contributed Perl Documentation Net::DNS::RR::OPT(3)
2
3
4
6 Net::DNS::RR::OPT - DNS OPT resource record
7
9 use Net::DNS;
10 $packet = new Net::DNS::Packet( ... );
11
12 $packet->header->do(1); # extended flag
13
14 $packet->edns->size(1280); # UDP payload size
15
16 $packet->edns->option( COOKIE => $cookie );
17
18 $packet->edns->print;
19
20 ;; EDNS version 0
21 ;; flags: 8000
22 ;; rcode: NOERROR
23 ;; size: 1280
24 ;; option: DAU => ( 8, 10, 13, 14, 15, 16 )
25 ;; DHU => ( 1, 2, 4 )
26 ;; COOKIE => ( CLIENT-COOKIE => 7261776279746573,
27 ;; SERVER-COOKIE => )
28
30 EDNS OPT pseudo resource record.
31
32 The OPT record supports EDNS protocol extensions and is not intended to
33 be created, accessed or modified directly by user applications.
34
35 All EDNS features are performed indirectly by operations on the objects
36 returned by the $packet->header and $packet->edns creator methods. The
37 underlying mechanisms are entirely hidden from the user.
38
40 The available methods are those inherited from the base class augmented
41 by the type-specific methods defined in this package.
42
43 Use of undocumented package features or direct access to internal data
44 structures is discouraged and could result in program termination or
45 other unpredictable behaviour.
46
47 version
48 $version = $rr->version;
49
50 The version of EDNS used by this OPT record.
51
52 size
53 $size = $packet->edns->size;
54 $more = $packet->edns->size(1280);
55
56 size() advertises the maximum size (octets) of UDP packet that can be
57 reassembled in the network stack of the originating host.
58
59 rcode
60 $extended_rcode = $packet->header->rcode;
61 $incomplete_rcode = $packet->edns->rcode;
62
63 The 12 bit extended RCODE. The most significant 8 bits reside in the
64 OPT record. The least significant 4 bits can only be obtained from the
65 packet header.
66
67 flags
68 $edns_flags = $packet->edns->flags;
69
70 $do = $packet->header->do;
71 $packet->header->do(1);
72
73 16 bit field containing EDNS extended header flags.
74
75 options, option
76 @option = $packet->edns->options;
77
78 $octets = $packet->edns->option($option_code);
79
80 $packet->edns->option( COOKIE => $cookie );
81 $packet->edns->option( 10 => $cookie );
82
83 When called in a list context, options() returns a list of option codes
84 found in the OPT record.
85
86 When called in a scalar context with a single argument, option()
87 returns the uninterpreted octet string corresponding to the specified
88 option. The method returns undef if the specified option is absent.
89
90 Options can be added or replaced by providing the (name => string)
91 pair. The option is deleted if the value is undefined.
92
93 When option() is called in a list context with a single argument, the
94 returned array provides a structured interpretation appropriate to the
95 specified option.
96
97 For the example above:
98
99 %hash = $packet->edns->option(10);
100
101 %hash = (
102 'CLIENT-COOKIE' => 'rawbytes',
103 'SERVER-COOKIE' => ''
104 );
105
106 For some options, an array is more appropriate:
107
108 @algorithms = $packet->edns->option(6);
109
110 Similar forms of array syntax may be used to construct the option
111 value:
112
113 $packet->edns->option( DHU => [1, 2, 4] );
114 $packet->edns->option( 6 => (1, 2, 4) );
115
116 $packet->edns->option( COOKIE => {'CLIENT-COOKIE' => $cookie} );
117 $packet->edns->option( 10 => ('CLIENT-COOKIE' => $cookie) );
118
120 Copyright (c)2001,2002 RIPE NCC. Author Olaf M. Kolkman.
121
122 Portions Copyright (c)2012,2017 Dick Franks.
123
124 All rights reserved.
125
126 Package template (c)2009,2012 O.M.Kolkman and R.W.Franks.
127
129 Permission to use, copy, modify, and distribute this software and its
130 documentation for any purpose and without fee is hereby granted,
131 provided that the above copyright notice appear in all copies and that
132 both that copyright notice and this permission notice appear in
133 supporting documentation, and that the name of the author not be used
134 in advertising or publicity pertaining to distribution of the software
135 without specific prior written permission.
136
137 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
138 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
139 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
140 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
141 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
142 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
143 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
144
146 perl, Net::DNS, Net::DNS::RR, RFC6891, RFC3225
147
148
149
150perl v5.28.0 2018-11-14 Net::DNS::RR::OPT(3)