当前位置: 首页>>代码示例>>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;未经允许,请勿转载。