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

	c.connection.Write(data)

	return nil
}
Beispiel #2
0
func (gfe *OvsFlowEnhancer) Enhance(f *flow.Flow) {
	if f.ANodeUUID == "" || f.BNodeUUID == "" {
		if f.Link == nil {
			return
		}
	}
	if f.ANodeUUID == "" {
		f.ANodeUUID = gfe.getNodeUUID(f.Link.A)
	}
	if f.BNodeUUID == "" {
		f.BNodeUUID = gfe.getNodeUUID(f.Link.B)
	}
}
Beispiel #3
0
func (c *Client) SendFlow(f *flow.Flow) error {
	data, err := f.GetData()
	if err != nil {
		return err
	}

retry:
	_, err = c.connection.Write(data)
	if err != nil {
		logging.GetLogger().Errorf("flows connection to analyzer error %s : try to reconnect" + err.Error())
		c.connection.Close()
		c.connect()
		goto retry
	}

	return nil
}
Beispiel #4
0
func (p *OvsSFlowProbe) SetProbeNode(flow *flow.Flow) bool {
	flow.NodeUUID = p.NodeUUID
	return true
}
Beispiel #5
0
func (p *GoPacketProbe) SetProbeNode(flow *flow.Flow) bool {
	flow.NodeUUID = p.NodeUUID
	return true
}