func (f *MPTCPAddressInformationFields) SetIPv6Flag() {
	f.Flags |= 0x02
}
SetIPv6Flag sets IPv6 flag in MPTCPAddressInformation.
package ie
import (
	"encoding/binary"
	"io"
	"net"
)
const (
	MPTCPProxyTransportConverter uint8 = 1
)
func NewMPTCPAddressInformation(ptype uint8, port uint16, v4, v6 net.IP) *IE {
	fields := NewMPTCPAddressInformationFields(ptype, port, v4, v6)
	b, err := fields.Marshal()
	if err != nil {
		return nil
	}
	return New(MPTCPAddressInformation, b)
}
func (i *IE) MPTCPAddressInformation() (*MPTCPAddressInformationFields, error) {
	switch i.Type {
	case MPTCPAddressInformation:
		fields, err := ParseMPTCPAddressInformationFields(i.Payload)
		if err != nil {
			return nil, err
		}
		return fields, nil
	case ATSSSControlParameters:
		ies, err := i.ATSSSControlParameters()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == MPTCPParameters {
				return x.MPTCPAddressInformation()
			}
		}
		return nil, ErrIENotFound
	case MPTCPParameters:
		ies, err := i.MPTCPParameters()
		if err != nil {
			return nil, err
		}
		for _, x := range ies {
			if x.Type == MPTCPAddressInformation {
				return x.MPTCPAddressInformation()
			}
		}
		return nil, ErrIENotFound
	default:
		return nil, &InvalidTypeError{Type: i.Type}
	}
}
type MPTCPAddressInformationFields struct {
	Flags            uint8
	MPTCPProxyType   uint8
	MPTCPProxyPort   uint16
	MPTCPIPv4Address net.IP
	MPTCPIPv6Address net.IP
}
func NewMPTCPAddressInformationFields(ptype uint8, port uint16, v4, v6 net.IP) *MPTCPAddressInformationFields {
	f := &MPTCPAddressInformationFields{
		Flags:          0x00,
		MPTCPProxyType: ptype,
		MPTCPProxyPort: port,
	}
	if v4 != nil {
		f.SetIPv4Flag()
		f.MPTCPIPv4Address = v4
	}
	if v6 != nil {
		f.SetIPv6Flag()
		f.MPTCPIPv6Address = v6
	}
	return f
}
func (f *MPTCPAddressInformationFields) HasIPv6() bool {
	return has2ndBit(f.Flags)
}