• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang flow.Flow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/redhat-cip/skydive/flow.Flow的典型用法代码示例。如果您正苦于以下问题:Golang Flow类的具体用法?Golang Flow怎么用?Golang Flow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Flow类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: SendFlow

func (c *Client) SendFlow(f *flow.Flow) error {
	data, err := f.GetData()
	if err != nil {
		return err
	}

	c.connection.Write(data)

	return nil
}
开发者ID:lebauce,项目名称:skydive,代码行数:10,代码来源:client.go


示例2: CheckFlow

func (s *TestStorage) CheckFlow(t *testing.T, f *flow.Flow, trace *flowsTraceInfo) bool {
	eth := f.GetStatistics().Endpoints[flow.FlowEndpointType_ETHERNET.Value()]

	for _, fi := range trace.flowStat {
		if fi.Path == f.LayersPath {
			if (fi.ABPackets == eth.AB.Packets) && (fi.ABBytes == eth.AB.Bytes) && (fi.BAPackets == eth.BA.Packets) && (fi.BABytes == eth.BA.Bytes) {
				fi.Checked = true
				return true
			}
		}
	}

	return false
}
开发者ID:mestery,项目名称:skydive,代码行数:14,代码来源:agent_sflow_test.go


示例3: flow2OldFlow

func flow2OldFlow(f *flow.Flow) OldFlow {
	fs := f.GetStatistics()
	eth := fs.Endpoints[flow.FlowEndpointType_ETHERNET.Value()]
	ip := fs.Endpoints[flow.FlowEndpointType_IPV4.Value()]
	port := fs.Endpoints[flow.FlowEndpointType_TCPPORT.Value()]
	if port != nil {
		port = fs.Endpoints[flow.FlowEndpointType_UDPPORT.Value()]
		if port != nil {
			port = fs.Endpoints[flow.FlowEndpointType_SCTPPORT.Value()]
		}
	}

	of := OldFlow{}
	of.UUID = f.UUID
	of.LayersPath = f.LayersPath
	of.EtherSrc = eth.AB.Value
	of.EtherDst = eth.BA.Value
	of.Ipv4Src = ""
	of.Ipv4Dst = ""
	of.PortSrc = 0
	of.PortDst = 0
	if ip != nil {
		of.Ipv4Src = ip.AB.Value
		of.Ipv4Dst = ip.BA.Value
	}
	if port != nil {
		portInt, _ := strconv.Atoi(port.AB.Value)
		of.PortSrc = uint32(portInt)
		portInt, _ = strconv.Atoi(port.BA.Value)
		of.PortDst = uint32(portInt)
	}
	of.ID = 0
	of.Timestamp = uint64(fs.Start)

	of.ProbeGraphPath = f.ProbeGraphPath

	of.IfSrcName = ""
	of.IfSrcType = ""
	of.IfSrcGraphPath = ""
	of.IfSrcTenantID = ""
	of.IfSrcVNI = 0

	of.IfDstName = ""
	of.IfDstType = ""
	of.IfDstGraphPath = ""
	of.IfDstTenantID = ""
	of.IfDstVNI = 0
	return of
}
开发者ID:mestery,项目名称:skydive,代码行数:49,代码来源:elasticsearch.go


示例4: Enhance

func (gfe *OvsFlowEnhancer) Enhance(f *flow.Flow) {
	var eth *flow.FlowEndpointsStatistics
	if f.IfSrcGraphPath == "" || f.IfDstGraphPath == "" {
		eth = f.GetStatistics().GetEndpointsType(flow.FlowEndpointType_ETHERNET)
		if eth == nil {
			return
		}
	}
	if f.IfSrcGraphPath == "" {
		f.IfSrcGraphPath = gfe.getPath(eth.AB.Value)
	}
	if f.IfDstGraphPath == "" {
		f.IfDstGraphPath = gfe.getPath(eth.BA.Value)
	}
}
开发者ID:lebauce,项目名称:skydive,代码行数:15,代码来源:ovs.go


示例5: pcapTraceCheckFlow

func pcapTraceCheckFlow(t *testing.T, f *flow.Flow, trace *flowsTraceInfo) bool {
	eth := f.GetStatistics().GetEndpointsType(flow.FlowEndpointType_ETHERNET)
	if eth == nil {
		t.Fail()
	}

	for _, fi := range trace.flowStat {
		if fi.Path == f.LayersPath {
			if (fi.ABPackets == eth.AB.Packets) && (fi.ABBytes == eth.AB.Bytes) && (fi.BAPackets == eth.BA.Packets) && (fi.BABytes == eth.BA.Bytes) {
				fi.Checked = true
				return true
			}
		}
	}

	return false
}
开发者ID:lebauce,项目名称:skydive,代码行数:17,代码来源:flow_test.go


示例6: Enhance

func (gfe *GraphFlowEnhancer) Enhance(f *flow.Flow) {
	if f.IfSrcGraphPath == "" {
		f.IfSrcGraphPath = gfe.getPath(f.GetStatistics().Endpoints[flow.FlowEndpointType_ETHERNET.Value()].AB.Value)
	}
	if f.IfDstGraphPath == "" {
		f.IfDstGraphPath = gfe.getPath(f.GetStatistics().Endpoints[flow.FlowEndpointType_ETHERNET.Value()].BA.Value)
	}
}
开发者ID:mestery,项目名称:skydive,代码行数:8,代码来源:graph.go


示例7: SetProbePath

func (p *OvsSFlowProbe) SetProbePath(flow *flow.Flow) bool {
	flow.ProbeGraphPath = p.ProbeGraphPath
	return true
}
开发者ID:lebauce,项目名称:skydive,代码行数:4,代码来源:ovssflow.go


示例8: EnhanceInterfaces

func (fm *FlowMapper) EnhanceInterfaces(flow *flow.Flow) {
	fm.InterfaceMapper.Enhance(flow.GetEtherSrc(), flow.GetAttributes().GetIntfAttrSrc())
	fm.InterfaceMapper.Enhance(flow.GetEtherDst(), flow.GetAttributes().GetIntfAttrDst())
}
开发者ID:razorinc,项目名称:skydive,代码行数:4,代码来源:mapper.go


示例9: SetProbePath

func (p *PcapProbe) SetProbePath(flow *flow.Flow) bool {
	flow.ProbeGraphPath = p.probePath
	return true
}
开发者ID:lebauce,项目名称:skydive,代码行数:4,代码来源:pcap.go



注:本文中的github.com/redhat-cip/skydive/flow.Flow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang logging.GetLogger函数代码示例发布时间:2022-05-28
下一篇:
Golang config.GetConfig函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap