github.com/aporeto-inc/trireme-lib@v10.358.0+incompatible/controller/pkg/remoteenforcer/interfaces.go (about)

     1  package remoteenforcer
     2  
     3  import (
     4  	"go.aporeto.io/enforcerd/trireme-lib/controller/internal/enforcer/utils/rpcwrapper"
     5  )
     6  
     7  const (
     8  	// InitEnforcer is string for invoking RPC
     9  	InitEnforcer = "RemoteEnforcer.InitEnforcer"
    10  	//Unenforce is string for invoking RPC
    11  	Unenforce = "RemoteEnforcer.Unenforce"
    12  	//Enforce is string for invoking RPC
    13  	Enforce = "RemoteEnforcer.Enforce"
    14  	// EnforcerExit is string for invoking RPC
    15  	EnforcerExit = "RemoteEnforcer.EnforcerExit"
    16  	// UpdateSecrets is string for invoking updatesecrets RPC
    17  	UpdateSecrets = "RemoteEnforcer.UpdateSecrets"
    18  	// SetTargetNetworks is string for invoking SetTargetNetworks RPC
    19  	SetTargetNetworks = "RemoteEnforcer.SetTargetNetworks"
    20  	// EnableIPTablesPacketTracing enable iptables trace mode
    21  	EnableIPTablesPacketTracing = "RemoteEnforcer.EnableIPTablesPacketTracing"
    22  	// EnableDatapathPacketTracing enable datapath packet tracing
    23  	EnableDatapathPacketTracing = "RemoteEnforcer.EnableDatapathPacketTracing"
    24  	// SetLogLevel is string for invoking set log level RPC
    25  	SetLogLevel = "RemoteEnforcer.SetLogLevel"
    26  	// Ping is the string for invoking ping RPC
    27  	Ping = "RemoteEnforcer.Ping"
    28  	// DebugCollect is the string for invoking DebugCollect RPC
    29  	DebugCollect = "RemoteEnforcer.DebugCollect"
    30  )
    31  
    32  // RemoteIntf is the interface implemented by the remote enforcer
    33  type RemoteIntf interface {
    34  	// InitEnforcer is a function called from the controller using RPC.
    35  	// It intializes data structure required by the remote enforcer
    36  	InitEnforcer(req rpcwrapper.Request, resp *rpcwrapper.Response) error
    37  
    38  	//Unenforce this method calls the unenforce method on the enforcer created from initenforcer
    39  	Unenforce(req rpcwrapper.Request, resp *rpcwrapper.Response) error
    40  
    41  	//Enforce this method calls the enforce method on the enforcer created during initenforcer
    42  	Enforce(req rpcwrapper.Request, resp *rpcwrapper.Response) error
    43  
    44  	// EnforcerExit this method is called when  we received a killrpocess message from the controller
    45  	// This allows a graceful exit of the enforcer
    46  	EnforcerExit(req rpcwrapper.Request, resp *rpcwrapper.Response) error
    47  }