func (f *PFDContentsFields) HasADNP() bool {
	return has8thBit(f.Flags)
}
HasADNP reports whether ADNP flag is set.
package ie
import (
	"encoding/binary"
	"io"
)
func NewPFDContents(fd, url, dn, cp, dnp string, afd, aurl, adnp []string) *IE {
	f := NewPFDContentsFields(fd, url, dn, cp, dnp, afd, aurl, adnp)
	b, err := f.Marshal()
	if err != nil {
		return nil
	}
	return New(PFDContents, b)
}
func (i *IE) PFDContents() (*PFDContentsFields, error) {
	switch i.Type {
	case PFDContents:
		s, err := ParsePFDContentsFields(i.Payload)
		if err != nil {
			return nil, err
		}
		return s, nil
	case PFDContext:
		ies, err := i.PFDContext()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == PFDContents {
				return x.PFDContents()
			}
		}
		return nil, ErrIENotFound
	case ApplicationIDsPFDs:
		ies, err := i.ApplicationIDsPFDs()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == PFDContext {
				return x.PFDContents()
			}
		}
		return nil, ErrIENotFound
	default:
		return nil, &InvalidTypeError{Type: i.Type}
	}
}
type PFDContentsFields struct {
	Flags                           uint8
	FDLength                        uint16
	FlowDescription                 string
	URLLength                       uint16
	URL                             string
	DNLength                        uint16
	DomainName                      string
	CPLength                        uint16
	CustomPFDContent                string
	DNPLength                       uint16
	DomainNameProtocol              string
	AFDLength                       uint16
	AdditionalFlowDescription       []string
	AURLLength                      uint16
	AdditionalURL                   []string
	ADNPLength                      uint16
	AdditionalDomainNameAndProtocol []string
}
func NewPFDContentsFields(fd, url, dn, cp, dnp string, afd, aurl, adnp []string) *PFDContentsFields {
	f := &PFDContentsFields{}
	if fd != "" {
		f.FlowDescription = fd
		f.FDLength = uint16(len([]byte(fd)))
		f.SetFDFlag()
	}
	if url != "" {
		f.URL = url
		f.URLLength = uint16(len([]byte(url)))
		f.SetURLFlag()
	}
	if dn != "" {
		f.DomainName = dn
		f.DNLength = uint16(len([]byte(dn)))
		f.SetDNFlag()
	}
	if cp != "" {
		f.CustomPFDContent = cp
		f.CPLength = uint16(len([]byte(cp)))
		f.SetCPFlag()
	}
	if dnp != "" {
		f.DomainNameProtocol = dnp
		f.DNPLength = uint16(len([]byte(dnp)))
		f.SetDNPFlag()
	}
	if afd != nil {
		l := 0
		for _, a := range afd {
			l += 2 + len([]byte(a))
		}
		f.AdditionalFlowDescription = afd
		f.AFDLength = uint16(l)
		f.SetAFDFlag()
	}
	if aurl != nil {
		l := 0
		for _, a := range aurl {
			l += 2 + len([]byte(a))
		}
		f.AdditionalURL = aurl
		f.AURLLength = uint16(l)
		f.SetAURLFlag()
	}
	if adnp != nil {
		l := 0
		for _, a := range adnp {
			l += 2 + len([]byte(a))
		}
		f.AdditionalDomainNameAndProtocol = adnp
		f.ADNPLength = uint16(l)
		f.SetADNPFlag()
	}
	return f
}