func (nsp *NetworkSecurityProbe) SetupDeviceMonitor(event *model.DeviceEvent) error {
	// Ignore lo interfaces
	if event.DeviceName == "lo" {
		return nil
	}
	// Create a new TC monitor for the interface
	monitor := tcsched.NewTCMonitor(event)
	// Init & Start the new monitor
	if err := monitor.Init(nsp); err != nil {
		nspLogger.Errorf("failed to init monitor \"%s\": %v", monitor.GetName(), err)
		return err
	}
	if err := monitor.Start(); err != nil {
		nspLogger.Errorf("failed to start monitor \"%s\": %v", monitor.GetName(), err)
		return err
	}
	// Add monitor to the list of TC monitors
	nsp.TCMonitors[event.Device.Ifindex] = monitor
	return nil
}
// SetupDeviceMonitor - Sets up network monitoring on the newly discovered network device
Sets up network monitoring on the newly discovered network device
// SetupDeviceMonitor - Sets up network monitoring on the newly discovered network device
func (nsp *NetworkSecurityProbe) SetupDeviceMonitor(event *model.DeviceEvent) error {
	if event.DeviceName == "lo" {
		return nil
	}
	monitor := tcsched.NewTCMonitor(event)
	if err := monitor.Init(nsp); err != nil {
		nspLogger.Errorf("failed to init monitor \"%s\": %v", monitor.GetName(), err)
		return err
	}
	if err := monitor.Start(); err != nil {
		nspLogger.Errorf("failed to start monitor \"%s\": %v", monitor.GetName(), err)
		return err
	}
	nsp.TCMonitors[event.Device.Ifindex] = monitor
	return nil
}
func ( nsp * NetworkSecurityProbe ) SetupDeviceMonitor ( event * model . DeviceEvent ) error { if event . DeviceName == " " { return nil } monitor := tcsched . NewTCMonitor ( event ) if err := monitor . Init ( nsp ) ; err != nil { nspLogger . Errorf ( " \" \" " , monitor . GetName ( ) , err ) return err } if err := monitor . Start ( ) ; err != nil { nspLogger . Errorf ( " \" \" " , monitor . GetName ( ) , err ) return err } nsp . TCMonitors [ event . Device . Ifindex ] = monitor return nil }
Sets up network monitoring on the newly discovered network device
Sets up network monitoring on the newly discovered network device
// Ignore lo interfaces // Create a new TC monitor for the interface // Init & Start the new monitor // Add monitor to the list of TC monitors