Ai
2 Star 1 Fork 0

李玮/trireme-lib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
interfaces.go 1.86 KB
一键复制 编辑 原始数据 按行查看 历史
李玮 提交于 2020-01-29 13:23 +08:00 . v1
package remoteenforcer
import (
"git.cloud.top/DSec/trireme-lib/controller/internal/enforcer/utils/rpcwrapper"
)
const (
// InitEnforcer is string for invoking RPC
InitEnforcer = "RemoteEnforcer.InitEnforcer"
//Unenforce is string for invoking RPC
Unenforce = "RemoteEnforcer.Unenforce"
//Enforce is string for invoking RPC
Enforce = "RemoteEnforcer.Enforce"
// EnforcerExit is string for invoking RPC
EnforcerExit = "RemoteEnforcer.EnforcerExit"
// UpdateSecrets is string for invoking updatesecrets RPC
UpdateSecrets = "RemoteEnforcer.UpdateSecrets"
// SetTargetNetworks is string for invoking SetTargetNetworks RPC
SetTargetNetworks = "RemoteEnforcer.SetTargetNetworks"
// EnableIPTablesPacketTracing enable iptables trace mode
EnableIPTablesPacketTracing = "RemoteEnforcer.EnableIPTablesPacketTracing"
// EnableDatapathPacketTracing enable datapath packet tracing
EnableDatapathPacketTracing = "RemoteEnforcer.EnableDatapathPacketTracing"
// SetLogLevel is string for invoking set log level RPC
SetLogLevel = "RemoteEnforcer.SetLogLevel"
)
// RemoteIntf is the interface implemented by the remote enforcer
type RemoteIntf interface {
// InitEnforcer is a function called from the controller using RPC.
// It intializes data structure required by the remote enforcer
InitEnforcer(req rpcwrapper.Request, resp *rpcwrapper.Response) error
//Unenforce this method calls the unenforce method on the enforcer created from initenforcer
Unenforce(req rpcwrapper.Request, resp *rpcwrapper.Response) error
//Enforce this method calls the enforce method on the enforcer created during initenforcer
Enforce(req rpcwrapper.Request, resp *rpcwrapper.Response) error
// EnforcerExit this method is called when we received a killrpocess message from the controller
// This allows a graceful exit of the enforcer
EnforcerExit(req rpcwrapper.Request, resp *rpcwrapper.Response) error
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/emmoblin/trireme-lib.git
git@gitee.com:emmoblin/trireme-lib.git
emmoblin
trireme-lib
trireme-lib
7726874a2b9a

搜索帮助