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: link_linux.go
    path of file: ./repos/sealer/vendor/github.com/vishvananda/netlink
    
    the code of the file until where you have to start completion: package netlink

import (
	"bytes"
	"encoding/binary"
	"fmt"
	"io/ioutil"
	"net"
	"os"
	"strconv"
	"strings"
	"syscall"
	"unsafe"

	"github.com/vishvananda/netlink/nl"
	"github.com/vishvananda/netns"
	"golang.org/x/sys/unix"
)

const (
	SizeofLinkStats32 = 0x5c
	SizeofLinkStats64 = 0xb8
)

const (
	TUNTAP_MODE_TUN             TuntapMode = unix.IFF_TUN
	TUNTAP_MODE_TAP             TuntapMode = unix.IFF_TAP
	TUNTAP_DEFAULTS             TuntapFlag = unix.IFF_TUN_EXCL | unix.IFF_ONE_QUEUE
	TUNTAP_VNET_HDR             TuntapFlag = unix.IFF_VNET_HDR
	TUNTAP_TUN_EXCL             TuntapFlag = unix.IFF_TUN_EXCL
	TUNTAP
    
func parseVfInfo(data []syscall.NetlinkRouteAttr, id int) VfInfo {
	vf := VfInfo{ID: id}
	for _, element := range data {
		switch element.Attr.Type {
		case nl.IFLA_VF_MAC:
			mac := nl.DeserializeVfMac(element.Value[:])
			vf.Mac = mac.Mac[:6]
		case nl.IFLA_VF_VLAN:
			vl := nl.DeserializeVfVlan(element.Value[:])
			vf.Vlan = int(vl.Vlan)
			vf.Qos = int(vl.Qos)
		case nl.IFLA_VF_TX_RATE:
			txr := nl.DeserializeVfTxRate(element.Value[:])
			vf.TxRate = int(txr.Rate)
		case nl.IFLA_VF_SPOOFCHK:
			sp := nl.DeserializeVfSpoofchk(element.Value[:])
			vf.Spoofchk = sp.Setting != 0
		case nl.IFLA_VF_LINK_STATE:
			ls := nl.DeserializeVfLinkState(element.Value[:])
			vf.LinkState = ls.LinkState
		case nl.IFLA_VF_RATE:
			vfr := nl.DeserializeVfRate(element.Value[:])
			vf.MaxTxRate = vfr.MaxTxRate
			vf.MinTxRate = vfr.MinTxRate
		case nl.IFLA_VF_STATS:
			vfstats := nl.DeserializeVfStats(element.Value[:])
			vf.RxPackets = vfstats.RxPackets
			vf.TxPackets = vfstats.TxPackets
			vf.RxBytes = vfstats.RxBytes
			vf.TxBytes = vfstats.TxBytes
			vf.Multicast = vfstats.Multicast
			vf.Broadcast = vfstats.Broadcast
			vf.RxDropped = vfstats.RxDropped
			vf.TxDropped = vfstats.TxDropped

		case nl.IFLA_VF_RSS_QUERY_EN:
			result := nl.DeserializeVfRssQueryEn(element.Value)
			vf.RssQuery = result.Setting

		case nl.IFLA_VF_TRUST:
			result := nl.DeserializeVfTrust(element.Value)
			vf.Trust = result.Setting
		}
	}
	return vf
}