func (rd *IPSECKEY) Encode(b *dns.Wirebuf) {
	dns.Octet(rd.Precedence).Encode(b)
	dns.Octet(rd.GatewayType).Encode(b)
	dns.Octet(rd.Algorithm).Encode(b)
	switch rd.GatewayType {
	case GatewayNone:
		// nop
	case GatewayIPV4:
		b.Buf = append(b.Buf, rd.Gateway.(net.IP).To4()...)
	case GatewayIPV6:
		b.Buf = append(b.Buf, rd.Gateway.(net.IP).To16()...)
	case GatewayDomain:
		b.DisableCompression()
		dns.DomainName(rd.Gateway.(string)).Encode(b)
		b.EnableCompression()
	}
	b.Buf = append(b.Buf, rd.PublicKey...)
}
// Implementation of dns.Wirer
Implementation of dns.Wirer
// Implementation of dns . Wirer
func (rd *IPSECKEY) Encode(b *dns.Wirebuf) {
	dns.Octet(rd.Precedence).Encode(b)
	dns.Octet(rd.GatewayType).Encode(b)
	dns.Octet(rd.Algorithm).Encode(b)
	switch rd.GatewayType {
	case GatewayNone:
	case GatewayIPV4:
		b.Buf = append(b.Buf, rd.Gateway.(net.IP).To4()...)
	case GatewayIPV6:
		b.Buf = append(b.Buf, rd.Gateway.(net.IP).To16()...)
	case GatewayDomain:
		b.DisableCompression()
		dns.DomainName(rd.Gateway.(string)).Encode(b)
		b.EnableCompression()
	}
	b.Buf = append(b.Buf, rd.PublicKey...)
}
func ( rd * IPSECKEY ) Encode ( b * dns . Wirebuf ) { dns . Octet ( rd . Precedence ) . Encode ( b ) dns . Octet ( rd . GatewayType ) . Encode ( b ) dns . Octet ( rd . Algorithm ) . Encode ( b ) switch rd . GatewayType { case GatewayNone : case GatewayIPV4 : b . Buf = append ( b . Buf , rd . Gateway . ( net . IP ) . To4 ( ) ... ) case GatewayIPV6 : b . Buf = append ( b . Buf , rd . Gateway . ( net . IP ) . To16 ( ) ... ) case GatewayDomain : b . DisableCompression ( ) dns . DomainName ( rd . Gateway . ( string ) ) . Encode ( b ) b . EnableCompression ( ) } b . Buf = append ( b . Buf , rd . PublicKey ... ) }
Implementation of dns.Wirer
Implementation of dns . Wirer
// nop