Commit bec0863b authored by Matthew Dempsky's avatar Matthew Dempsky

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: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent c231dd21
...@@ -109,7 +109,7 @@ const ( ...@@ -109,7 +109,7 @@ const (
// DNS queries. // DNS queries.
type dnsQuestion struct { type dnsQuestion struct {
Name string `net:"domain-name"` // `net:"domain-name"` specifies encoding; see packers below Name string
Qtype uint16 Qtype uint16
Qclass uint16 Qclass uint16
} }
...@@ -124,7 +124,7 @@ func (q *dnsQuestion) Walk(f func(v interface{}, name, tag string) bool) bool { ...@@ -124,7 +124,7 @@ func (q *dnsQuestion) Walk(f func(v interface{}, name, tag string) bool) bool {
// There are many types of messages, // There are many types of messages,
// but they all share the same header. // but they all share the same header.
type dnsRR_Header struct { type dnsRR_Header struct {
Name string `net:"domain-name"` Name string
Rrtype uint16 Rrtype uint16
Class uint16 Class uint16
Ttl uint32 Ttl uint32
...@@ -152,7 +152,7 @@ type dnsRR interface { ...@@ -152,7 +152,7 @@ type dnsRR interface {
type dnsRR_CNAME struct { type dnsRR_CNAME struct {
Hdr dnsRR_Header Hdr dnsRR_Header
Cname string `net:"domain-name"` Cname string
} }
func (rr *dnsRR_CNAME) Header() *dnsRR_Header { 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 { ...@@ -166,7 +166,7 @@ func (rr *dnsRR_CNAME) Walk(f func(v interface{}, name, tag string) bool) bool {
type dnsRR_MX struct { type dnsRR_MX struct {
Hdr dnsRR_Header Hdr dnsRR_Header
Pref uint16 Pref uint16
Mx string `net:"domain-name"` Mx string
} }
func (rr *dnsRR_MX) Header() *dnsRR_Header { 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 { ...@@ -179,7 +179,7 @@ func (rr *dnsRR_MX) Walk(f func(v interface{}, name, tag string) bool) bool {
type dnsRR_NS struct { type dnsRR_NS struct {
Hdr dnsRR_Header Hdr dnsRR_Header
Ns string `net:"domain-name"` Ns string
} }
func (rr *dnsRR_NS) Header() *dnsRR_Header { 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 { ...@@ -192,7 +192,7 @@ func (rr *dnsRR_NS) Walk(f func(v interface{}, name, tag string) bool) bool {
type dnsRR_PTR struct { type dnsRR_PTR struct {
Hdr dnsRR_Header Hdr dnsRR_Header
Ptr string `net:"domain-name"` Ptr string
} }
func (rr *dnsRR_PTR) Header() *dnsRR_Header { 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 { ...@@ -205,8 +205,8 @@ func (rr *dnsRR_PTR) Walk(f func(v interface{}, name, tag string) bool) bool {
type dnsRR_SOA struct { type dnsRR_SOA struct {
Hdr dnsRR_Header Hdr dnsRR_Header
Ns string `net:"domain-name"` Ns string
Mbox string `net:"domain-name"` Mbox string
Serial uint32 Serial uint32
Refresh uint32 Refresh uint32
Retry uint32 Retry uint32
...@@ -263,7 +263,7 @@ type dnsRR_SRV struct { ...@@ -263,7 +263,7 @@ type dnsRR_SRV struct {
Priority uint16 Priority uint16
Weight uint16 Weight uint16
Port uint16 Port uint16
Target string `net:"domain-name"` Target string
} }
func (rr *dnsRR_SRV) Header() *dnsRR_Header { 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 { ...@@ -280,7 +280,7 @@ func (rr *dnsRR_SRV) Walk(f func(v interface{}, name, tag string) bool) bool {
type dnsRR_A struct { type dnsRR_A struct {
Hdr dnsRR_Header Hdr dnsRR_Header
A uint32 `net:"ipv4"` A uint32
} }
func (rr *dnsRR_A) Header() *dnsRR_Header { 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 { ...@@ -293,7 +293,7 @@ func (rr *dnsRR_A) Walk(f func(v interface{}, name, tag string) bool) bool {
type dnsRR_AAAA struct { type dnsRR_AAAA struct {
Hdr dnsRR_Header Hdr dnsRR_Header
AAAA [16]byte `net:"ipv6"` AAAA [16]byte
} }
func (rr *dnsRR_AAAA) Header() *dnsRR_Header { func (rr *dnsRR_AAAA) Header() *dnsRR_Header {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment