func (rd *TKEY) Decode(b []byte, pos *int, sniffer dns.WireDecodeSniffer) (err error) {
	//BUG Supports times only up to 2106-02-07 06:28:15 +0000 UTC
	p0 := &b[*pos]
	if err = (*dns.DomainName)(&rd.Algorithm).Decode(b, pos, sniffer); err != nil {
		return
	}

	var u32 dns.Octets4
	if err = u32.Decode(b, pos, sniffer); err != nil {
		return
	}

	rd.Inception = time.Unix(int64(u32), 0)

	if err = u32.Decode(b, pos, sniffer); err != nil {
		return
	}

	rd.Expiration = time.Unix(int64(u32), 0)

	if err = (*dns.Octets2)(&rd.Mode).Decode(b, pos, sniffer); err != nil {
		return
	}

	if err = (*dns.Octets2)(&rd.Error).Decode(b, pos, sniffer); err != nil {
		return
	}

	var u16 dns.Octets2
	if err = u16.Decode(b, pos, sniffer); err != nil {
		return
	}

	n := int(u16)
	if *pos+n > len(b)+1 {
		return fmt.Errorf("(*rr.TKEY).Decode() - buffer underflow")
	}

	rd.KeyData = make([]byte, n)
	copy(rd.KeyData, b[*pos:])
	*pos += n

	if err = u16.Decode(b, pos, sniffer); err != nil {
		return
	}

	n = int(u16)
	if *pos+n > len(b)+1 {
		return fmt.Errorf("(*rr.TKEY).Decode() - buffer underflow")
	}

	rd.OtherData = make([]byte, n)
	copy(rd.OtherData, b[*pos:])
	*pos += n

	if sniffer != nil {
		sniffer(p0, &b[*pos-1], dns.SniffRDataTKEY, rd)
	}
	return
}
// Implementation of dns.Wirer
Implementation of dns.Wirer
// Implementation of dns . Wirer
func (rd *TKEY) Decode(b []byte, pos *int, sniffer dns.WireDecodeSniffer) (err error) {
	p0 := &b[*pos]
	if err = (*dns.DomainName)(&rd.Algorithm).Decode(b, pos, sniffer); err != nil {
		return
	}
	var u32 dns.Octets4
	if err = u32.Decode(b, pos, sniffer); err != nil {
		return
	}
	rd.Inception = time.Unix(int64(u32), 0)
	if err = u32.Decode(b, pos, sniffer); err != nil {
		return
	}
	rd.Expiration = time.Unix(int64(u32), 0)
	if err = (*dns.Octets2)(&rd.Mode).Decode(b, pos, sniffer); err != nil {
		return
	}
	if err = (*dns.Octets2)(&rd.Error).Decode(b, pos, sniffer); err != nil {
		return
	}
	var u16 dns.Octets2
	if err = u16.Decode(b, pos, sniffer); err != nil {
		return
	}
	n := int(u16)
	if *pos+n > len(b)+1 {
		return fmt.Errorf("(*rr.TKEY).Decode() - buffer underflow")
	}
	rd.KeyData = make([]byte, n)
	copy(rd.KeyData, b[*pos:])
	*pos += n
	if err = u16.Decode(b, pos, sniffer); err != nil {
		return
	}
	n = int(u16)
	if *pos+n > len(b)+1 {
		return fmt.Errorf("(*rr.TKEY).Decode() - buffer underflow")
	}
	rd.OtherData = make([]byte, n)
	copy(rd.OtherData, b[*pos:])
	*pos += n
	if sniffer != nil {
		sniffer(p0, &b[*pos-1], dns.SniffRDataTKEY, rd)
	}
	return
}
func ( rd * TKEY ) Decode ( b [ ] byte , pos * int , sniffer dns . WireDecodeSniffer ) ( err error ) { p0 := & b [ * pos ] if err = ( * dns . DomainName ) ( & rd . Algorithm ) . Decode ( b , pos , sniffer ) ; err != nil { return } var u32 dns . Octets4 if err = u32 . Decode ( b , pos , sniffer ) ; err != nil { return } rd . Inception = time . Unix ( int64 ( u32 ) , 0 ) if err = u32 . Decode ( b , pos , sniffer ) ; err != nil { return } rd . Expiration = time . Unix ( int64 ( u32 ) , 0 ) if err = ( * dns . Octets2 ) ( & rd . Mode ) . Decode ( b , pos , sniffer ) ; err != nil { return } if err = ( * dns . Octets2 ) ( & rd . Error ) . Decode ( b , pos , sniffer ) ; err != nil { return } var u16 dns . Octets2 if err = u16 . Decode ( b , pos , sniffer ) ; err != nil { return } n := int ( u16 ) if * pos + n > len ( b ) + 1 { return fmt . Errorf ( " " ) } rd . KeyData = make ( [ ] byte , n ) copy ( rd . KeyData , b [ * pos : ] ) * pos += n if err = u16 . Decode ( b , pos , sniffer ) ; err != nil { return } n = int ( u16 ) if * pos + n > len ( b ) + 1 { return fmt . Errorf ( " " ) } rd . OtherData = make ( [ ] byte , n ) copy ( rd . OtherData , b [ * pos : ] ) * pos += n if sniffer != nil { sniffer ( p0 , & b [ * pos - 1 ] , dns . SniffRDataTKEY , rd ) } return }
Implementation of dns.Wirer
Implementation of dns . Wirer
//BUG Supports times only up to 2106-02-07 06:28:15 +0000 UTC