func RdmaLinkList() ([]*RdmaLink, error) {
	return pkgHandle.RdmaLinkList()
}
RdmaLinkList gets a list of RDMA link devices.
Equivalent to: `rdma dev show`
package netlink
import (
	"bytes"
	"encoding/binary"
	"fmt"
	"net"
	"github.com/vishvananda/netlink/nl"
	"golang.org/x/sys/unix"
)
type RdmaLinkAttrs struct {
	Index           uint32
	Name            string
	FirmwareVersion string
	NodeGuid        string
	SysImageGuid    string
}
type RdmaLink struct {
	Attrs RdmaLinkAttrs
}
func getProtoField(clientType int, op int) int {
	return ((clientType << nl.RDMA_NL_GET_CLIENT_SHIFT) | op)
}
func uint64ToGuidString(guid uint64) string {
	sysGuidBytes := new(bytes.Buffer)
	binary.Write(sysGuidBytes, binary.LittleEndian, guid)
	sysGuidNet := net.HardwareAddr(sysGuidBytes.Bytes())
	return sysGuidNet.String()
}
func executeOneGetRdmaLink(data []byte) (*RdmaLink, error) {
	link := RdmaLink{}
	reader := bytes.NewReader(data)
	for reader.Len() >= 4 {
		_, attrType, len, value := parseNfAttrTLV(reader)
		switch attrType {
		case nl.RDMA_NLDEV_ATTR_DEV_INDEX:
			var Index uint32
			r := bytes.NewReader(value)
			binary.Read(r, nl.NativeEndian(), &Index)
			link.Attrs.Index = Index
		case nl.RDMA_NLDEV_ATTR_DEV_NAME:
			link.Attrs.Name = string(value[0 : len-1])
		case nl.RDMA_NLDEV_ATTR_FW_VERSION:
			link.Attrs.FirmwareVersion = string(value[0 : len-1])
		case nl.RDMA_NLDEV_ATTR_NODE_GUID:
			var guid uint64
			r := bytes.NewReader(value)
			binary.Read(r, nl.NativeEndian(), &guid)
			link.Attrs.NodeGuid = uint64ToGuidString(guid)
		case nl.RDMA_NLDEV_ATTR_SYS_IMAGE_GUID:
			var sysGuid uint64
			r := bytes.NewReader(value)
			binary.Read(r, nl.NativeEndian(), &sysGuid)
			link.Attrs.SysImageGuid = uint64ToGuidString(sysGuid)
		}
		if (len % 4) != 0 {
			reader.Seek(int64(4-(len%4)), seekCurrent)
		}
	}
	return &link, nil
}
func execRdmaSetLink(req *nl.NetlinkRequest) error {
	_, err := req.Execute(unix.NETLINK_RDMA, 0)
	return err
}