func (f *STAGFields) HasVID() bool {
	return has3rdBit(f.Flags)
}
HasVID reports whether VID flag is set.
package ie
import (
	"encoding/binary"
	"io"
)
func NewSTAG(flags, pcp, deiFlag uint8, cvid uint16) *IE {
	fields := NewSTAGFields(flags, pcp, deiFlag, cvid)
	b, err := fields.Marshal()
	if err != nil {
		return nil
	}
	return New(STAG, b)
}
func (i *IE) STAG() (*STAGFields, error) {
	switch i.Type {
	case STAG:
		fields, err := ParseSTAGFields(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.STAG()
			}
		}
		return nil, ErrIENotFound
	case EthernetPacketFilter:
		ies, err := i.EthernetPacketFilter()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == STAG {
				return x.STAG()
			}
		}
		return nil, ErrIENotFound
	case MACAddressesDetected:
		x, err := i.MACAddressesDetected()
		if err != nil {
			return nil, err
		}
		return ParseSTAGFields(x.STAG)
	case MACAddressesRemoved:
		x, err := i.MACAddressesRemoved()
		if err != nil {
			return nil, err
		}
		return ParseSTAGFields(x.STAG)
	case EthernetContextInformation:
		ies, err := i.EthernetContextInformation()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == MACAddressesDetected {
				return x.STAG()
			}
		}
		return nil, ErrIENotFound
	default:
		return nil, &InvalidTypeError{Type: i.Type}
	}
}
type STAGFields struct {
	Flags   uint8
	PCP     uint8   
	DEIFlag uint8   
	CVID    uint16  
}
func NewSTAGFields(flags, pcp, deiFlag uint8, cvid uint16) *STAGFields {
	return &STAGFields{
		Flags:   flags,
		PCP:     pcp,
		DEIFlag: deiFlag,
		CVID:    cvid,
	}
}