You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: transparentproxy_v2.go
    path of file: ./repos/kuma/pkg/transparentproxy
    
    the code of the file until where you have to start completion: package transparentproxy

import (
	"fmt"
	"net"
	"os/exec"
	"strconv"
	"strings"

	"github.com/pkg/errors"

	"github.com/kumahq/kuma/pkg/transparentproxy/config"
)

var _ TransparentProxy = &TransparentProxyV2{}

type TransparentProxyV2 struct{}

func V2() TransparentProxy {
	return &TransparentProxyV2{}
}

func hasLocalIPv6() (bool, error) {
	addrs, err := net.InterfaceAddrs()
	if err != nil {
		return false, err
	}

	for _, a := range addrs {
		if ipnet, ok := a.(*net.IPNet); ok &&
			!ipnet.IP.IsLoopback() &&
			ipnet.IP.To4() == nil {
			return true, nil
		}
	}

	return false, nil
}

// ShouldEnableIPv6 checks if system supports IP
    
func ParseExcludePortsForUIDs(excludeOutboundPortsForUIDs []string) ([]config.UIDsToPorts, error) {
	var uidsToPorts []config.UIDsToPorts
	for _, excludePort := range excludeOutboundPortsForUIDs {
		parts := strings.Split(excludePort, ":")
		if len(parts) == 0 || len(parts) > 3 {
			return nil, fmt.Errorf("value: '%s' is invalid - format for excluding ports by uids <protocol:>?<ports:>?uids", excludePort)
		}
		var portValuesOrRange string
		var protocolOpts string
		var uidValuesOrRange string
		switch len(parts) {
		case 1:
			protocolOpts = "*"
			portValuesOrRange = "*"
			uidValuesOrRange = parts[0]
		case 2:
			protocolOpts = "*"
			portValuesOrRange = parts[0]
			uidValuesOrRange = parts[1]
		case 3:
			protocolOpts = parts[0]
			portValuesOrRange = parts[1]
			uidValuesOrRange = parts[2]
		}
		if uidValuesOrRange == "*" {
			return nil, errors.New("can't use wildcard '*' for uids")
		}
		if portValuesOrRange == "*" || portValuesOrRange == "" {
			portValuesOrRange = "1-65535"
		}

		if err := validateUintValueOrRange(portValuesOrRange); err != nil {
			return nil, err
		}

		if strings.Contains(uidValuesOrRange, ",") {
			return nil, fmt.Errorf("uid entry invalid:'%s', it should either be a single item or a range", uidValuesOrRange)
		}
		if err := validateUintValueOrRange(uidValuesOrRange); err != nil {
			return nil, err
		}

		var protocols []string
		if protocolOpts == "" || protocolOpts == "*" {
			protocols = []string{"tcp", "udp"}
		} else {
			for _, p := range strings.Split(protocolOpts, ",") {
				pCleaned := strings.ToLower(strings.TrimSpace(p))
				if pCleaned != "tcp" && pCleaned != "udp" {
					return nil, fmt.Errorf("protocol '%s' is invalid or unsupported", pCleaned)
				}
				protocols = append(protocols, pCleaned)
			}
		}
		for _, p := range protocols {
			uidsToPorts = append(uidsToPorts, config.UIDsToPorts{
				Ports:    config.ValueOrRangeList(strings.ReplaceAll(portValuesOrRange, "-", ":")),
				UIDs:     config.ValueOrRangeList(strings.ReplaceAll(uidValuesOrRange, "-", ":")),
				Protocol: p,
			})
		}
	}

	return uidsToPorts, nil
}