// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq

package mocks

import (
	"github.com/schmitthub/clawker/internal/controlplane/firewall/ebpf"
	"sync"
)

// Ensure, that EBPFManagerMock does implement ebpf.EBPFManager.
// If this is not the case, regenerate this file with moq.
var _ ebpf.EBPFManager = &EBPFManagerMock{}

// EBPFManagerMock is a mock implementation of ebpf.EBPFManager.
//
//	func TestSomethingThatUsesEBPFManager(t *testing.T) {
//
//		// make and configure a mocked ebpf.EBPFManager
//		mockedEBPFManager := &EBPFManagerMock{
//			DisableFunc: func(cgroupID uint64) error {
//				panic("mock out the Disable method")
//			},
//			EnableFunc: func(cgroupID uint64) error {
//				panic("mock out the Enable method")
//			},
//			FlushAllFunc: func() error {
//				panic("mock out the FlushAll method")
//			},
//			InstallFunc: func(cgroupID uint64, cgroupPath string, cfg ebpf.BPFContainerConfig) error {
//				panic("mock out the Install method")
//			},
//			RemoveFunc: func(cgroupID uint64) error {
//				panic("mock out the Remove method")
//			},
//			SyncRoutesFunc: func(routes []ebpf.Route) error {
//				panic("mock out the SyncRoutes method")
//			},
//		}
//
//		// use mockedEBPFManager in code that requires ebpf.EBPFManager
//		// and then make assertions.
//
//	}
type EBPFManagerMock struct {
	// DisableFunc mocks the Disable method.
	DisableFunc func(cgroupID uint64) error

	// EnableFunc mocks the Enable method.
	EnableFunc func(cgroupID uint64) error

	// FlushAllFunc mocks the FlushAll method.
	FlushAllFunc func() error

	// InstallFunc mocks the Install method.
	InstallFunc func(cgroupID uint64, cgroupPath string, cfg ebpf.BPFContainerConfig) error

	// RemoveFunc mocks the Remove method.
	RemoveFunc func(cgroupID uint64) error

	// SyncRoutesFunc mocks the SyncRoutes method.
	SyncRoutesFunc func(routes []ebpf.Route) error

	// calls tracks calls to the methods.
	calls struct {
		// Disable holds details about calls to the Disable method.
		Disable []struct {
			// CgroupID is the cgroupID argument value.
			CgroupID uint64
		}
		// Enable holds details about calls to the Enable method.
		Enable []struct {
			// CgroupID is the cgroupID argument value.
			CgroupID uint64
		}
		// FlushAll holds details about calls to the FlushAll method.
		FlushAll []struct {
		}
		// Install holds details about calls to the Install method.
		Install []struct {
			// CgroupID is the cgroupID argument value.
			CgroupID uint64
			// CgroupPath is the cgroupPath argument value.
			CgroupPath string
			// Cfg is the cfg argument value.
			Cfg ebpf.BPFContainerConfig
		}
		// Remove holds details about calls to the Remove method.
		Remove []struct {
			// CgroupID is the cgroupID argument value.
			CgroupID uint64
		}
		// SyncRoutes holds details about calls to the SyncRoutes method.
		SyncRoutes []struct {
			// Routes is the routes argument value.
			Routes []ebpf.Route
		}
	}
	lockDisable    sync.RWMutex
	lockEnable     sync.RWMutex
	lockFlushAll   sync.RWMutex
	lockInstall    sync.RWMutex
	lockRemove     sync.RWMutex
	lockSyncRoutes sync.RWMutex
}

// Disable calls DisableFunc.
func (mock *EBPFManagerMock) Disable(cgroupID uint64) error {
	if mock.DisableFunc == nil {
		panic("EBPFManagerMock.DisableFunc: method is nil but EBPFManager.Disable was just called")
	}
	callInfo := struct {
		CgroupID uint64
	}{
		CgroupID: cgroupID,
	}
	mock.lockDisable.Lock()
	mock.calls.Disable = append(mock.calls.Disable, callInfo)
	mock.lockDisable.Unlock()
	return mock.DisableFunc(cgroupID)
}

// DisableCalls gets all the calls that were made to Disable.
// Check the length with:
//
//	len(mockedEBPFManager.DisableCalls())
func (mock *EBPFManagerMock) DisableCalls() []struct {
	CgroupID uint64
} {
	var calls []struct {
		CgroupID uint64
	}
	mock.lockDisable.RLock()
	calls = mock.calls.Disable
	mock.lockDisable.RUnlock()
	return calls
}

// Enable calls EnableFunc.
func (mock *EBPFManagerMock) Enable(cgroupID uint64) error {
	if mock.EnableFunc == nil {
		panic("EBPFManagerMock.EnableFunc: method is nil but EBPFManager.Enable was just called")
	}
	callInfo := struct {
		CgroupID uint64
	}{
		CgroupID: cgroupID,
	}
	mock.lockEnable.Lock()
	mock.calls.Enable = append(mock.calls.Enable, callInfo)
	mock.lockEnable.Unlock()
	return mock.EnableFunc(cgroupID)
}

// EnableCalls gets all the calls that were made to Enable.
// Check the length with:
//
//	len(mockedEBPFManager.EnableCalls())
func (mock *EBPFManagerMock) EnableCalls() []struct {
	CgroupID uint64
} {
	var calls []struct {
		CgroupID uint64
	}
	mock.lockEnable.RLock()
	calls = mock.calls.Enable
	mock.lockEnable.RUnlock()
	return calls
}

// FlushAll calls FlushAllFunc.
func (mock *EBPFManagerMock) FlushAll() error {
	if mock.FlushAllFunc == nil {
		panic("EBPFManagerMock.FlushAllFunc: method is nil but EBPFManager.FlushAll was just called")
	}
	callInfo := struct {
	}{}
	mock.lockFlushAll.Lock()
	mock.calls.FlushAll = append(mock.calls.FlushAll, callInfo)
	mock.lockFlushAll.Unlock()
	return mock.FlushAllFunc()
}

// FlushAllCalls gets all the calls that were made to FlushAll.
// Check the length with:
//
//	len(mockedEBPFManager.FlushAllCalls())
func (mock *EBPFManagerMock) FlushAllCalls() []struct {
} {
	var calls []struct {
	}
	mock.lockFlushAll.RLock()
	calls = mock.calls.FlushAll
	mock.lockFlushAll.RUnlock()
	return calls
}

// Install calls InstallFunc.
func (mock *EBPFManagerMock) Install(cgroupID uint64, cgroupPath string, cfg ebpf.BPFContainerConfig) error {
	if mock.InstallFunc == nil {
		panic("EBPFManagerMock.InstallFunc: method is nil but EBPFManager.Install was just called")
	}
	callInfo := struct {
		CgroupID   uint64
		CgroupPath string
		Cfg        ebpf.BPFContainerConfig
	}{
		CgroupID:   cgroupID,
		CgroupPath: cgroupPath,
		Cfg:        cfg,
	}
	mock.lockInstall.Lock()
	mock.calls.Install = append(mock.calls.Install, callInfo)
	mock.lockInstall.Unlock()
	return mock.InstallFunc(cgroupID, cgroupPath, cfg)
}

// InstallCalls gets all the calls that were made to Install.
// Check the length with:
//
//	len(mockedEBPFManager.InstallCalls())
func (mock *EBPFManagerMock) InstallCalls() []struct {
	CgroupID   uint64
	CgroupPath string
	Cfg        ebpf.BPFContainerConfig
} {
	var calls []struct {
		CgroupID   uint64
		CgroupPath string
		Cfg        ebpf.BPFContainerConfig
	}
	mock.lockInstall.RLock()
	calls = mock.calls.Install
	mock.lockInstall.RUnlock()
	return calls
}

// Remove calls RemoveFunc.
func (mock *EBPFManagerMock) Remove(cgroupID uint64) error {
	if mock.RemoveFunc == nil {
		panic("EBPFManagerMock.RemoveFunc: method is nil but EBPFManager.Remove was just called")
	}
	callInfo := struct {
		CgroupID uint64
	}{
		CgroupID: cgroupID,
	}
	mock.lockRemove.Lock()
	mock.calls.Remove = append(mock.calls.Remove, callInfo)
	mock.lockRemove.Unlock()
	return mock.RemoveFunc(cgroupID)
}

// RemoveCalls gets all the calls that were made to Remove.
// Check the length with:
//
//	len(mockedEBPFManager.RemoveCalls())
func (mock *EBPFManagerMock) RemoveCalls() []struct {
	CgroupID uint64
} {
	var calls []struct {
		CgroupID uint64
	}
	mock.lockRemove.RLock()
	calls = mock.calls.Remove
	mock.lockRemove.RUnlock()
	return calls
}

// SyncRoutes calls SyncRoutesFunc.
func (mock *EBPFManagerMock) SyncRoutes(routes []ebpf.Route) error {
	if mock.SyncRoutesFunc == nil {
		panic("EBPFManagerMock.SyncRoutesFunc: method is nil but EBPFManager.SyncRoutes was just called")
	}
	callInfo := struct {
		Routes []ebpf.Route
	}{
		Routes: routes,
	}
	mock.lockSyncRoutes.Lock()
	mock.calls.SyncRoutes = append(mock.calls.SyncRoutes, callInfo)
	mock.lockSyncRoutes.Unlock()
	return mock.SyncRoutesFunc(routes)
}

// SyncRoutesCalls gets all the calls that were made to SyncRoutes.
// Check the length with:
//
//	len(mockedEBPFManager.SyncRoutesCalls())
func (mock *EBPFManagerMock) SyncRoutesCalls() []struct {
	Routes []ebpf.Route
} {
	var calls []struct {
		Routes []ebpf.Route
	}
	mock.lockSyncRoutes.RLock()
	calls = mock.calls.SyncRoutes
	mock.lockSyncRoutes.RUnlock()
	return calls
}
