func ParseMACAddressFields(b []byte) (*MACAddressFields, error) {
	f := &MACAddressFields{}
	if err := f.UnmarshalBinary(b); err != nil {
		return nil, err
	}
	return f, nil
}
ParseMACAddressFields parses b into MACAddressFields.
package ie
import (
	"io"
	"net"
)
func NewMACAddress(src, dst, upperSrc, upperDst net.HardwareAddr) *IE {
	fields := NewMACAddressFields(src, dst, upperSrc, upperDst)
	b, err := fields.Marshal()
	if err != nil {
		return nil
	}
	return New(MACAddress, b)
}
func (i *IE) MACAddress() (*MACAddressFields, error) {
	switch i.Type {
	case MACAddress:
		fields, err := ParseMACAddressFields(i.Payload)
		if err != nil {
			return nil, err
		}
		return fields, nil
	case PDI:
		ies, err := i.PDI()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == EthernetPacketFilter {
				return x.MACAddress()
			}
		}
		return nil, ErrIENotFound
	case EthernetPacketFilter:
		ies, err := i.EthernetPacketFilter()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == MACAddress {
				return x.MACAddress()
			}
		}
		return nil, ErrIENotFound
	default:
		return nil, &InvalidTypeError{Type: i.Type}
	}
}
type MACAddressFields struct {
	Flags                      uint8
	SourceMACAddress           net.HardwareAddr
	DestinationMACAddress      net.HardwareAddr
	UpperSourceMACAddress      net.HardwareAddr
	UpperDestinationMACAddress net.HardwareAddr
}
func NewMACAddressFields(src, dst, upperSrc, upperDst net.HardwareAddr) *MACAddressFields {
	f := &MACAddressFields{}
	if src != nil {
		f.SetSOURFlag()
		f.SourceMACAddress = src
	}
	if dst != nil {
		f.SetDESTFlag()
		f.DestinationMACAddress = dst
	}
	if upperSrc != nil {
		f.SetUSOUFlag()
		f.UpperSourceMACAddress = upperSrc
	}
	if upperDst != nil {
		f.SetUDESFlag()
		f.UpperDestinationMACAddress = upperDst
	}
	return f
}
func (f *MACAddressFields) HasUDES() bool {
	return has4thBit(f.Flags)
}
func (f *MACAddressFields) SetUDESFlag() {
	f.Flags |= 0x08
}
func (f *MACAddressFields) HasUSOU() bool {
	return has3rdBit(f.Flags)
}
func (f *MACAddressFields) SetUSOUFlag() {
	f.Flags |= 0x04
}
func (f *MACAddressFields) HasDEST() bool {
	return has2ndBit(f.Flags)
}
func (f *MACAddressFields) SetDESTFlag() {
	f.Flags |= 0x02
}
func (f *MACAddressFields) HasSOUR() bool {
	return has1stBit(f.Flags)
}
func (f *MACAddressFields) SetSOURFlag() {
	f.Flags |= 0x01
}