func (rd *OPT_DATA) Decode(b []byte, pos *int, sniffer dns.WireDecodeSniffer) (err error) {
	p0 := &b[*pos]
	if err = (*dns.Octets2)(&rd.Code).Decode(b, pos, sniffer); err != nil {
		return
	}
	var n dns.Octets2
	if err = n.Decode(b, pos, sniffer); err != nil {
		return
	}
	p := *pos
	next := p + int(n)
	if next > len(b) {
		return fmt.Errorf("(*rr.OPT_DATA).Decode() - buffer underflow")
	}
	rd.Data = b[p:next]
	*pos = next
	if next > len(b) {
		sniffer(p0, nil, dns.SniffOPT_DATA, rd)
		return
	}

	if sniffer != nil {
		sniffer(p0, &b[*pos-1], dns.SniffOPT_DATA, rd)
	}
	return
}
// Implementation of dns.Wirer
Implementation of dns.Wirer
// Implementation of dns . Wirer
func (rd *OPT_DATA) Decode(b []byte, pos *int, sniffer dns.WireDecodeSniffer) (err error) {
	p0 := &b[*pos]
	if err = (*dns.Octets2)(&rd.Code).Decode(b, pos, sniffer); err != nil {
		return
	}
	var n dns.Octets2
	if err = n.Decode(b, pos, sniffer); err != nil {
		return
	}
	p := *pos
	next := p + int(n)
	if next > len(b) {
		return fmt.Errorf("(*rr.OPT_DATA).Decode() - buffer underflow")
	}
	rd.Data = b[p:next]
	*pos = next
	if next > len(b) {
		sniffer(p0, nil, dns.SniffOPT_DATA, rd)
		return
	}
	if sniffer != nil {
		sniffer(p0, &b[*pos-1], dns.SniffOPT_DATA, rd)
	}
	return
}
func ( rd * OPT_DATA ) Decode ( b [ ] byte , pos * int , sniffer dns . WireDecodeSniffer ) ( err error ) { p0 := & b [ * pos ] if err = ( * dns . Octets2 ) ( & rd . Code ) . Decode ( b , pos , sniffer ) ; err != nil { return } var n dns . Octets2 if err = n . Decode ( b , pos , sniffer ) ; err != nil { return } p := * pos next := p + int ( n ) if next > len ( b ) { return fmt . Errorf ( " " ) } rd . Data = b [ p : next ] * pos = next if next > len ( b ) { sniffer ( p0 , nil , dns . SniffOPT_DATA , rd ) return } if sniffer != nil { sniffer ( p0 , & b [ * pos - 1 ] , dns . SniffOPT_DATA , rd ) } return }
Implementation of dns.Wirer
Implementation of dns . Wirer