@@ -58,16 +58,15 @@ func makeDataOpt(code uint16) EDNS0 {
58
58
case EDNS0EDE :
59
59
return new (EDNS0_EDE )
60
60
case EDNS0ESU :
61
- return & EDNS0_ESU { Code : EDNS0ESU }
61
+ return new ( EDNS0_ESU )
62
62
default :
63
63
e := new (EDNS0_LOCAL )
64
64
e .Code = code
65
65
return e
66
66
}
67
67
}
68
68
69
- // OPT is the EDNS0 RR appended to messages to convey extra (meta) information.
70
- // See RFC 6891.
69
+ // OPT is the EDNS0 RR appended to messages to convey extra (meta) information. See RFC 6891.
71
70
type OPT struct {
72
71
Hdr RR_Header
73
72
Option []EDNS0 `dns:"opt"`
@@ -144,8 +143,6 @@ func (*OPT) parse(c *zlexer, origin string) *ParseError {
144
143
145
144
func (rr * OPT ) isDuplicate (r2 RR ) bool { return false }
146
145
147
- // return the old value -> delete SetVersion?
148
-
149
146
// Version returns the EDNS version used. Only zero is defined.
150
147
func (rr * OPT ) Version () uint8 {
151
148
return uint8 (rr .Hdr .Ttl & 0x00FF0000 >> 16 )
@@ -236,8 +233,8 @@ type EDNS0 interface {
236
233
// e.Nsid = "AA"
237
234
// o.Option = append(o.Option, e)
238
235
type EDNS0_NSID struct {
239
- Code uint16 // Always EDNS0NSID
240
- Nsid string // This string needs to be hex encoded
236
+ Code uint16 // always EDNS0NSID
237
+ Nsid string // string needs to be hex encoded
241
238
}
242
239
243
240
func (e * EDNS0_NSID ) pack () ([]byte , error ) {
@@ -275,7 +272,7 @@ func (e *EDNS0_NSID) copy() EDNS0 { return &EDNS0_NSID{e.Code, e.Nsid}
275
272
// When packing it will apply SourceNetmask. If you need more advanced logic,
276
273
// patches welcome and good luck.
277
274
type EDNS0_SUBNET struct {
278
- Code uint16 // Always EDNS0SUBNET
275
+ Code uint16 // always EDNS0SUBNET
279
276
Family uint16 // 1 for IP, 2 for IP6
280
277
SourceNetmask uint8
281
278
SourceScope uint8
@@ -399,8 +396,8 @@ func (e *EDNS0_SUBNET) copy() EDNS0 {
399
396
//
400
397
// There is no guarantee that the Cookie string has a specific length.
401
398
type EDNS0_COOKIE struct {
402
- Code uint16 // Always EDNS0COOKIE
403
- Cookie string // Hex- encoded cookie data
399
+ Code uint16 // always EDNS0COOKIE
400
+ Cookie string // hex encoded cookie data
404
401
}
405
402
406
403
func (e * EDNS0_COOKIE ) pack () ([]byte , error ) {
@@ -430,7 +427,7 @@ func (e *EDNS0_COOKIE) copy() EDNS0 { return &EDNS0_COOKIE{e.Code, e.C
430
427
// e.Lease = 120 // in seconds
431
428
// o.Option = append(o.Option, e)
432
429
type EDNS0_UL struct {
433
- Code uint16 // Always EDNS0UL
430
+ Code uint16 // always EDNS0UL
434
431
Lease uint32
435
432
KeyLease uint32
436
433
}
@@ -469,7 +466,7 @@ func (e *EDNS0_UL) unpack(b []byte) error {
469
466
// EDNS0_LLQ stands for Long Lived Queries: http://tools.ietf.org/html/draft-sekar-dns-llq-01
470
467
// Implemented for completeness, as the EDNS0 type code is assigned.
471
468
type EDNS0_LLQ struct {
472
- Code uint16 // Always EDNS0LLQ
469
+ Code uint16 // always EDNS0LLQ
473
470
Version uint16
474
471
Opcode uint16
475
472
Error uint16
@@ -515,7 +512,7 @@ func (e *EDNS0_LLQ) copy() EDNS0 {
515
512
516
513
// EDNS0_DAU implements the EDNS0 "DNSSEC Algorithm Understood" option. See RFC 6975.
517
514
type EDNS0_DAU struct {
518
- Code uint16 // Always EDNS0DAU
515
+ Code uint16 // always EDNS0DAU
519
516
AlgCode []uint8
520
517
}
521
518
@@ -539,7 +536,7 @@ func (e *EDNS0_DAU) copy() EDNS0 { return &EDNS0_DAU{e.Code, e.AlgCode} }
539
536
540
537
// EDNS0_DHU implements the EDNS0 "DS Hash Understood" option. See RFC 6975.
541
538
type EDNS0_DHU struct {
542
- Code uint16 // Always EDNS0DHU
539
+ Code uint16 // always EDNS0DHU
543
540
AlgCode []uint8
544
541
}
545
542
@@ -563,7 +560,7 @@ func (e *EDNS0_DHU) copy() EDNS0 { return &EDNS0_DHU{e.Code, e.AlgCode} }
563
560
564
561
// EDNS0_N3U implements the EDNS0 "NSEC3 Hash Understood" option. See RFC 6975.
565
562
type EDNS0_N3U struct {
566
- Code uint16 // Always EDNS0N3U
563
+ Code uint16 // always EDNS0N3U
567
564
AlgCode []uint8
568
565
}
569
566
@@ -588,7 +585,7 @@ func (e *EDNS0_N3U) copy() EDNS0 { return &EDNS0_N3U{e.Code, e.AlgCode} }
588
585
589
586
// EDNS0_EXPIRE implements the EDNS0 option as described in RFC 7314.
590
587
type EDNS0_EXPIRE struct {
591
- Code uint16 // Always EDNS0EXPIRE
588
+ Code uint16 // always EDNS0EXPIRE
592
589
Expire uint32
593
590
Empty bool // Empty is used to signal an empty Expire option in a backwards compatible way, it's not used on the wire.
594
591
}
@@ -668,7 +665,7 @@ func (e *EDNS0_LOCAL) unpack(b []byte) error {
668
665
// EDNS0_TCP_KEEPALIVE is an EDNS0 option that instructs the server to keep
669
666
// the TCP connection alive. See RFC 7828.
670
667
type EDNS0_TCP_KEEPALIVE struct {
671
- Code uint16 // Always EDNSTCPKEEPALIVE
668
+ Code uint16 // always EDNSTCPKEEPALIVE
672
669
673
670
// Timeout is an idle timeout value for the TCP connection, specified in
674
671
// units of 100 milliseconds, encoded in network byte order. If set to 0,
@@ -839,13 +836,12 @@ func (e *EDNS0_EDE) unpack(b []byte) error {
839
836
return nil
840
837
}
841
838
842
- // The EDNS0_ESU option for ENUM Source-URI Extension
839
+ // The EDNS0_ESU option for ENUM Source-URI Extension.
843
840
type EDNS0_ESU struct {
844
- Code uint16
841
+ Code uint16 // always EDNS0ESU
845
842
Uri string
846
843
}
847
844
848
- // Option implements the EDNS0 interface.
849
845
func (e * EDNS0_ESU ) Option () uint16 { return EDNS0ESU }
850
846
func (e * EDNS0_ESU ) String () string { return e .Uri }
851
847
func (e * EDNS0_ESU ) copy () EDNS0 { return & EDNS0_ESU {e .Code , e .Uri } }
0 commit comments