mirror of
https://github.com/golang/go
synced 2024-11-24 06:30:22 -07:00
net: remove unneeded tags from dnsRR structs
DNS packing and unpacking uses hand-coded struct walking functions rather than reflection, so these tags are unneeded and just contribute to their runtime reflect metadata size. Change-Id: I2db09d5159912bcbc3b482cbf23a50fa8fa807fa Reviewed-on: https://go-review.googlesource.com/22594 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
c231dd21e1
commit
bec0863b53
@ -109,7 +109,7 @@ const (
|
||||
|
||||
// DNS queries.
|
||||
type dnsQuestion struct {
|
||||
Name string `net:"domain-name"` // `net:"domain-name"` specifies encoding; see packers below
|
||||
Name string
|
||||
Qtype uint16
|
||||
Qclass uint16
|
||||
}
|
||||
@ -124,7 +124,7 @@ func (q *dnsQuestion) Walk(f func(v interface{}, name, tag string) bool) bool {
|
||||
// There are many types of messages,
|
||||
// but they all share the same header.
|
||||
type dnsRR_Header struct {
|
||||
Name string `net:"domain-name"`
|
||||
Name string
|
||||
Rrtype uint16
|
||||
Class uint16
|
||||
Ttl uint32
|
||||
@ -152,7 +152,7 @@ type dnsRR interface {
|
||||
|
||||
type dnsRR_CNAME struct {
|
||||
Hdr dnsRR_Header
|
||||
Cname string `net:"domain-name"`
|
||||
Cname string
|
||||
}
|
||||
|
||||
func (rr *dnsRR_CNAME) Header() *dnsRR_Header {
|
||||
@ -166,7 +166,7 @@ func (rr *dnsRR_CNAME) Walk(f func(v interface{}, name, tag string) bool) bool {
|
||||
type dnsRR_MX struct {
|
||||
Hdr dnsRR_Header
|
||||
Pref uint16
|
||||
Mx string `net:"domain-name"`
|
||||
Mx string
|
||||
}
|
||||
|
||||
func (rr *dnsRR_MX) Header() *dnsRR_Header {
|
||||
@ -179,7 +179,7 @@ func (rr *dnsRR_MX) Walk(f func(v interface{}, name, tag string) bool) bool {
|
||||
|
||||
type dnsRR_NS struct {
|
||||
Hdr dnsRR_Header
|
||||
Ns string `net:"domain-name"`
|
||||
Ns string
|
||||
}
|
||||
|
||||
func (rr *dnsRR_NS) Header() *dnsRR_Header {
|
||||
@ -192,7 +192,7 @@ func (rr *dnsRR_NS) Walk(f func(v interface{}, name, tag string) bool) bool {
|
||||
|
||||
type dnsRR_PTR struct {
|
||||
Hdr dnsRR_Header
|
||||
Ptr string `net:"domain-name"`
|
||||
Ptr string
|
||||
}
|
||||
|
||||
func (rr *dnsRR_PTR) Header() *dnsRR_Header {
|
||||
@ -205,8 +205,8 @@ func (rr *dnsRR_PTR) Walk(f func(v interface{}, name, tag string) bool) bool {
|
||||
|
||||
type dnsRR_SOA struct {
|
||||
Hdr dnsRR_Header
|
||||
Ns string `net:"domain-name"`
|
||||
Mbox string `net:"domain-name"`
|
||||
Ns string
|
||||
Mbox string
|
||||
Serial uint32
|
||||
Refresh uint32
|
||||
Retry uint32
|
||||
@ -263,7 +263,7 @@ type dnsRR_SRV struct {
|
||||
Priority uint16
|
||||
Weight uint16
|
||||
Port uint16
|
||||
Target string `net:"domain-name"`
|
||||
Target string
|
||||
}
|
||||
|
||||
func (rr *dnsRR_SRV) Header() *dnsRR_Header {
|
||||
@ -280,7 +280,7 @@ func (rr *dnsRR_SRV) Walk(f func(v interface{}, name, tag string) bool) bool {
|
||||
|
||||
type dnsRR_A struct {
|
||||
Hdr dnsRR_Header
|
||||
A uint32 `net:"ipv4"`
|
||||
A uint32
|
||||
}
|
||||
|
||||
func (rr *dnsRR_A) Header() *dnsRR_Header {
|
||||
@ -293,7 +293,7 @@ func (rr *dnsRR_A) Walk(f func(v interface{}, name, tag string) bool) bool {
|
||||
|
||||
type dnsRR_AAAA struct {
|
||||
Hdr dnsRR_Header
|
||||
AAAA [16]byte `net:"ipv6"`
|
||||
AAAA [16]byte
|
||||
}
|
||||
|
||||
func (rr *dnsRR_AAAA) Header() *dnsRR_Header {
|
||||
|
Loading…
Reference in New Issue
Block a user