Documentation ¶
Index ¶
- Constants
- func InjectPacket(pp *PacketParams, g *graph.Graph, chnl *Channels) (string, error)
- type Channels
- type PacketInjectorClient
- func (pc *PacketInjectorClient) InjectPacket(host string, pp *PacketParams) (string, error)
- func (pc *PacketInjectorClient) OnStartAsMaster()
- func (pc *PacketInjectorClient) OnStartAsSlave()
- func (pc *PacketInjectorClient) OnSwitchToMaster()
- func (pc *PacketInjectorClient) OnSwitchToSlave()
- func (pc *PacketInjectorClient) Start()
- func (pc *PacketInjectorClient) Stop()
- func (pc *PacketInjectorClient) StopInjection(host string, uuid string) error
- type PacketInjectorReply
- type PacketInjectorServer
- type PacketParams
Constants ¶
View Source
const (
// Namespace Packet_Injector
Namespace = "Packet_Injector"
)
Variables ¶
This section is empty.
Functions ¶
func InjectPacket ¶
InjectPacket inject some packets based on the graph
Types ¶
type PacketInjectorClient ¶
type PacketInjectorClient struct { *etcd.EtcdMasterElector // contains filtered or unexported fields }
func NewPacketInjectorClient ¶
func NewPacketInjectorClient(pool shttp.WSJSONSpeakerPool, etcdClient *etcd.EtcdClient, piHandler *apiServer.PacketInjectorAPI, g *graph.Graph) *PacketInjectorClient
func (*PacketInjectorClient) InjectPacket ¶
func (pc *PacketInjectorClient) InjectPacket(host string, pp *PacketParams) (string, error)
func (*PacketInjectorClient) OnStartAsMaster ¶ added in v0.16.0
func (pc *PacketInjectorClient) OnStartAsMaster()
OnStartAsMaster event
func (*PacketInjectorClient) OnStartAsSlave ¶ added in v0.16.0
func (pc *PacketInjectorClient) OnStartAsSlave()
OnStartAsSlave event
func (*PacketInjectorClient) OnSwitchToMaster ¶ added in v0.16.0
func (pc *PacketInjectorClient) OnSwitchToMaster()
OnSwitchToMaster event
func (*PacketInjectorClient) OnSwitchToSlave ¶ added in v0.16.0
func (pc *PacketInjectorClient) OnSwitchToSlave()
OnSwitchToSlave event
func (*PacketInjectorClient) Start ¶ added in v0.16.0
func (pc *PacketInjectorClient) Start()
Start the PI client
func (*PacketInjectorClient) Stop ¶ added in v0.16.0
func (pc *PacketInjectorClient) Stop()
Stop the PI client
func (*PacketInjectorClient) StopInjection ¶ added in v0.16.0
func (pc *PacketInjectorClient) StopInjection(host string, uuid string) error
type PacketInjectorReply ¶ added in v0.12.0
type PacketInjectorServer ¶
PacketInjectorServer creates a packet injector server API
func NewServer ¶
func NewServer(graph *graph.Graph, pool shttp.WSJSONSpeakerPool) *PacketInjectorServer
NewServer creates a new packet injector server API based on websocket server
func (*PacketInjectorServer) OnWSJSONMessage ¶ added in v0.13.0
func (pis *PacketInjectorServer) OnWSJSONMessage(c shttp.WSSpeaker, msg *shttp.WSJSONMessage)
OnWSMessage event, websocket PIRequest message
type PacketParams ¶
type PacketParams struct { UUID string SrcNodeID graph.Identifier `valid:"nonzero"` SrcIP string `valid:"nonzero"` SrcMAC string `valid:"nonzero"` SrcPort int64 `valid:"min=0"` DstIP string `valid:"nonzero"` DstMAC string `valid:"nonzero"` DstPort int64 `valid:"min=0"` Type string `valid:"regexp=^(icmp4|icmp6|tcp4|tcp6|udp4|udp6)$"` Count int64 `valid:"min=1"` ID int64 `valid:"min=0"` Interval int64 `valid:"min=0"` Payload string }
PacketParams describes the packet parameters to be injected
Click to show internal directories.
Click to hide internal directories.