func traceFlows(data []byte, m *base.Monitor) {
	var eventRaw model.FlowRaw
	if err := binary.Read(bytes.NewBuffer(data), utils.GetHostByteOrder(), &eventRaw); err != nil {
		connLogger.Errorf("failed to decode received data (FlowRaw): %s\n", err)
		return
	}
	// Prepare event
	event := model.Flow{
		EventBase: model.EventBase{
			EventMonitorName: m.Name,
			EventType:        model.FlowType,
			Timestamp:        m.Nsp.GetBootTime().Add(time.Duration(eventRaw.Metadata.TimestampRaw) * time.Nanosecond),
			TTYName:          C.GoString((*C.char)(unsafe.Pointer(&eventRaw.Metadata.TTYNameRaw))),
		},
		FlowRaw: &eventRaw,
	}

	switch kernel.SocketFamily(event.Family) {
	case kernel.AFInet:
		event.Addr = utils.Uint64ToIPv4(eventRaw.AddrRaw[0])
	case kernel.AFInet6:
		event.Addr = utils.Uint64sToIPv6(eventRaw.AddrRaw)
	}
	// Dispatch event
	m.Nsp.DispatchEvent(&event)
}
// traceFlows - Traces network flows
Traces network flows
// traceFlows - Traces network flows
func traceFlows(data []byte, m *base.Monitor) {
	var eventRaw model.FlowRaw
	if err := binary.Read(bytes.NewBuffer(data), utils.GetHostByteOrder(), &eventRaw); err != nil {
		connLogger.Errorf("failed to decode received data (FlowRaw): %s\n", err)
		return
	}
	event := model.Flow{
		EventBase: model.EventBase{
			EventMonitorName: m.Name,
			EventType:        model.FlowType,
			Timestamp:        m.Nsp.GetBootTime().Add(time.Duration(eventRaw.Metadata.TimestampRaw) * time.Nanosecond),
			TTYName:          C.GoString((*C.char)(unsafe.Pointer(&eventRaw.Metadata.TTYNameRaw))),
		},
		FlowRaw: &eventRaw,
	}
	switch kernel.SocketFamily(event.Family) {
	case kernel.AFInet:
		event.Addr = utils.Uint64ToIPv4(eventRaw.AddrRaw[0])
	case kernel.AFInet6:
		event.Addr = utils.Uint64sToIPv6(eventRaw.AddrRaw)
	}
	m.Nsp.DispatchEvent(&event)
}
func traceFlows ( data [ ] byte , m * base . Monitor ) { var eventRaw model . FlowRaw if err := binary . Read ( bytes . NewBuffer ( data ) , utils . GetHostByteOrder ( ) , & eventRaw ) ; err != nil { connLogger . Errorf ( " \n " , err ) return } event := model . Flow { EventBase : model . EventBase { EventMonitorName : m . Name , EventType : model . FlowType , Timestamp : m . Nsp . GetBootTime ( ) . Add ( time . Duration ( eventRaw . Metadata . TimestampRaw ) * time . Nanosecond ) , TTYName : C . GoString ( ( * C . char ) ( unsafe . Pointer ( & eventRaw . Metadata . TTYNameRaw ) ) ) , } , FlowRaw : & eventRaw , } switch kernel . SocketFamily ( event . Family ) { case kernel . AFInet : event . Addr = utils . Uint64ToIPv4 ( eventRaw . AddrRaw [ 0 ] ) case kernel . AFInet6 : event . Addr = utils . Uint64sToIPv6 ( eventRaw . AddrRaw ) } m . Nsp . DispatchEvent ( & event ) }
Traces network flows
Traces network flows
// Prepare event // Dispatch event