Documentation
¶
Index ¶
Constants ¶
View Source
const (
// Namespace Packet_Injector
Namespace = "Packet_Injector"
)
Variables ¶
This section is empty.
Functions ¶
func InjectPacket ¶
func InjectPacket(pp *PacketParams, g *graph.Graph) (string, error)
InjectPacket inject some packets based on the graph
Types ¶
type PacketInjectorClient ¶
type PacketInjectorClient struct { shttp.DefaultWSServerEventHandler WSServer *shttp.WSServer // contains filtered or unexported fields }
func NewPacketInjectorClient ¶
func NewPacketInjectorClient(w *shttp.WSServer) *PacketInjectorClient
func (*PacketInjectorClient) InjectPacket ¶
func (pc *PacketInjectorClient) InjectPacket(host string, pp *PacketParams) (string, error)
type PacketInjectorReply ¶
type PacketInjectorReply struct { TrackingID string // contains filtered or unexported fields }
type PacketInjectorServer ¶
type PacketInjectorServer struct { shttp.DefaultWSClientEventHandler WSAsyncClientPool *shttp.WSAsyncClientPool Graph *graph.Graph }
PacketInjectorServer creates a packet injector server API
func NewServer ¶
func NewServer(wspool *shttp.WSAsyncClientPool, graph *graph.Graph) *PacketInjectorServer
NewServer creates a new packet injector server API based on websocket server
func (*PacketInjectorServer) OnMessage ¶
func (pis *PacketInjectorServer) OnMessage(c *shttp.WSAsyncClient, msg shttp.WSMessage)
OnMessage event, websocket PIRequest message
type PacketParams ¶
type PacketParams struct { SrcNodeID graph.Identifier `valid:"nonzero"` SrcIP string `valid:"nonzero"` SrcMAC string `valid:"nonzero"` DstIP string `valid:"nonzero"` DstMAC string `valid:"nonzero"` Type string `valid:"regexp=^(icmp4|icmp6)$"` 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.