packet_injector

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

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 {
	// contains filtered or unexported fields
}

func NewPacketInjectorClient

func NewPacketInjectorClient(pool shttp.WSJSONSpeakerPool) *PacketInjectorClient

func (*PacketInjectorClient) InjectPacket

func (pc *PacketInjectorClient) InjectPacket(host string, pp *PacketParams) (string, error)

type PacketInjectorReply added in v0.12.0

type PacketInjectorReply struct {
	TrackingID string
	Error      string
}

type PacketInjectorServer

type PacketInjectorServer struct {
	Graph *graph.Graph
}

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 {
	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

Source Files

  • client.go
  • inject_packet.go
  • server.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL