當前位置: 首頁>>代碼示例>>Golang>>正文


Golang types.GetMacCopy函數代碼示例

本文整理匯總了Golang中github.com/docker/libnetwork/types.GetMacCopy函數的典型用法代碼示例。如果您正苦於以下問題:Golang GetMacCopy函數的具體用法?Golang GetMacCopy怎麽用?Golang GetMacCopy使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetMacCopy函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: SetMacAddress

func (i *testInterface) SetMacAddress(mac net.HardwareAddr) error {
	if i.mac != nil {
		return types.ForbiddenErrorf("endpoint interface MAC address present (%s). Cannot be modified with %s.", i.mac, mac)
	}
	if mac == nil {
		return types.BadRequestErrorf("tried to set nil MAC address to endpoint interface")
	}
	i.mac = types.GetMacCopy(mac)
	return nil
}
開發者ID:winsx,項目名稱:libnetwork,代碼行數:10,代碼來源:bridge_test.go

示例2: AddInterface

func (ep *endpoint) AddInterface(mac net.HardwareAddr, ipv4 net.IPNet, ipv6 net.IPNet) error {
	ep.Lock()
	defer ep.Unlock()

	iface := &endpointInterface{
		addr:   *types.GetIPNetCopy(&ipv4),
		addrv6: *types.GetIPNetCopy(&ipv6),
	}
	iface.mac = types.GetMacCopy(mac)

	ep.iface = iface
	return nil
}
開發者ID:waterytowers,項目名稱:global-hack-day-3,代碼行數:13,代碼來源:endpoint_info.go

示例3: CopyTo

func (epi *endpointInterface) CopyTo(dstEpi *endpointInterface) error {
	dstEpi.mac = types.GetMacCopy(epi.mac)
	dstEpi.addr = types.GetIPNetCopy(epi.addr)
	dstEpi.addrv6 = types.GetIPNetCopy(epi.addrv6)
	dstEpi.srcName = epi.srcName
	dstEpi.dstPrefix = epi.dstPrefix
	dstEpi.poolID = epi.poolID

	for _, route := range epi.routes {
		dstEpi.routes = append(dstEpi.routes, types.GetIPNetCopy(route))
	}

	return nil
}
開發者ID:dhiltgen,項目名稱:libnetwork,代碼行數:14,代碼來源:endpoint_info.go

示例4: CopyTo

func (epi *endpointInterface) CopyTo(dstEpi *endpointInterface) error {
	dstEpi.mac = types.GetMacCopy(epi.mac)
	dstEpi.addr = types.GetIPNetCopy(epi.addr)
	dstEpi.addrv6 = types.GetIPNetCopy(epi.addrv6)
	dstEpi.srcName = epi.srcName
	dstEpi.dstPrefix = epi.dstPrefix
	dstEpi.v4PoolID = epi.v4PoolID
	dstEpi.v6PoolID = epi.v6PoolID
	if len(epi.llAddrs) != 0 {
		dstEpi.llAddrs = make([]*net.IPNet, 0, len(epi.llAddrs))
		for _, ll := range epi.llAddrs {
			dstEpi.llAddrs = append(dstEpi.llAddrs, ll)
		}
	}

	for _, route := range epi.routes {
		dstEpi.routes = append(dstEpi.routes, types.GetIPNetCopy(route))
	}

	return nil
}
開發者ID:harche,項目名稱:docker,代碼行數:21,代碼來源:endpoint_info.go

示例5: MacAddress

func (epi *endpointInterface) MacAddress() net.HardwareAddr {
	return types.GetMacCopy(epi.mac)
}
開發者ID:MathewAniyan,項目名稱:docker,代碼行數:3,代碼來源:endpoint_info.go

示例6: MacAddress

func (i *nwIface) MacAddress() net.HardwareAddr {
	i.Lock()
	defer i.Unlock()

	return types.GetMacCopy(i.mac)
}
開發者ID:ailispaw,項目名稱:docker,代碼行數:6,代碼來源:interface_linux.go

示例7: MacAddress

func (ep *endpoint) MacAddress() net.HardwareAddr {
	return types.GetMacCopy(ep.mac)
}
開發者ID:c0b,項目名稱:libnetwork,代碼行數:3,代碼來源:ovrouter.go


注:本文中的github.com/docker/libnetwork/types.GetMacCopy函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。