Documentation
¶
Index ¶
- Constants
- func InjectionsMetadataDecoder(raw json.RawMessage) (common.Getter, error)
- func NewOnDemandInjectionClient(g *graph.Graph, ch apiServer.Handler, agentPool ws.StructSpeakerPool, ...) *client.OnDemandClient
- func NewOnDemandInjectionServer(g *graph.Graph, pool *ws.StructClientPool) (*server.OnDemandServer, error)
- type Client
- type ForgedPacketGenerator
- type InjectionMetadata
- type Injections
- type Packet
- type PacketForger
- type PacketInjectionRequest
- type PcapPacketGenerator
- type Reply
Constants ¶
const (
// Namespace PacketInjector
Namespace = "PacketInjector"
)
Variables ¶
This section is empty.
Functions ¶
func InjectionsMetadataDecoder ¶ added in v0.24.0
func InjectionsMetadataDecoder(raw json.RawMessage) (common.Getter, error)
InjectionsMetadataDecoder implements a json message raw decoder
func NewOnDemandInjectionClient ¶ added in v0.24.0
func NewOnDemandInjectionClient(g *graph.Graph, ch apiServer.Handler, agentPool ws.StructSpeakerPool, subscriberPool ws.StructSpeakerPool, etcdClient *etcd.Client) *client.OnDemandClient
NewOnDemandInjectionClient creates a new ondemand client based on API, graph and websocket
func NewOnDemandInjectionServer ¶ added in v0.24.0
func NewOnDemandInjectionServer(g *graph.Graph, pool *ws.StructClientPool) (*server.OnDemandServer, error)
NewOnDemandInjectionServer creates a new Ondemand probes server based on graph and websocket
Types ¶
type Client ¶
type Client struct {
common.MasterElection
// contains filtered or unexported fields
}
Client describes a packet injector client
type ForgedPacketGenerator ¶
type ForgedPacketGenerator struct {
*PacketInjectionRequest
LayerType gopacket.LayerType
// contains filtered or unexported fields
}
ForgedPacketGenerator is used to forge packets. It creates a gopacket.Packet with the proper layers that can be directly inserted into a socket.
func NewForgedPacketGenerator ¶
func NewForgedPacketGenerator(pp *PacketInjectionRequest, encapType string) (*ForgedPacketGenerator, error)
NewForgedPacketGenerator returns a new generator of forged packets
func (*ForgedPacketGenerator) Close ¶ added in v0.24.0
func (f *ForgedPacketGenerator) Close()
Close the packet generator
func (*ForgedPacketGenerator) PacketSource ¶
func (f *ForgedPacketGenerator) PacketSource() chan *Packet
PacketSource returns a channel when forged packets are pushed
type InjectionMetadata ¶ added in v0.24.0
type InjectionMetadata struct {
PacketInjectionRequest
ID string
State string
PacketCount int64
}
InjectionMetadata holds attributes and statistics about an injection easyjson:json gendecoder
type Injections ¶ added in v0.24.0
type Injections []*InjectionMetadata
Injections holds the injections metadata easyjson:json gendecoder
type Packet ¶
type Packet struct {
// contains filtered or unexported fields
}
Packet is defined as a gopacket and it byte representation
type PacketForger ¶
type PacketForger interface {
PacketSource() chan *Packet
Close()
}
PacketForger describes an objects that feeds a channel with packets
type PacketInjectionRequest ¶ added in v0.24.0
type PacketInjectionRequest struct {
UUID string
SrcIP net.IP `valid:"isIP"`
SrcMAC net.HardwareAddr `valid:"isMAC"`
SrcPort uint16
DstIP net.IP `valid:"isIP"`
DstMAC net.HardwareAddr `valid:"isMAC"`
DstPort uint16
Type string `valid:"regexp=^(icmp4|icmp6|tcp4|tcp6|udp4|udp6)$"`
Count uint64 `valid:"min=1"`
ICMPID uint16
Interval uint64
Increment bool
IncrementPayload int64
Payload string
Pcap []byte
TTL uint8
}
PacketInjectionRequest describes the packet parameters to be injected easyjson:json
func (*PacketInjectionRequest) GetName ¶ added in v0.24.0
func (r *PacketInjectionRequest) GetName() string
GetName returns the name of the resource
func (*PacketInjectionRequest) ID ¶ added in v0.24.0
func (r *PacketInjectionRequest) ID() string
ID returns the id of the packet injection request
func (*PacketInjectionRequest) SetID ¶ added in v0.24.0
func (r *PacketInjectionRequest) SetID(id string)
SetID sets the id of the packet injection request
type PcapPacketGenerator ¶
type PcapPacketGenerator struct {
*PacketInjectionRequest
// contains filtered or unexported fields
}
PcapPacketGenerator reads packets from a pcap file and inject it into a channel
func NewPcapPacketGenerator ¶
func NewPcapPacketGenerator(pp *PacketInjectionRequest) (*PcapPacketGenerator, error)
NewPcapPacketGenerator returns a new pcap packet generator
func (*PcapPacketGenerator) Close ¶ added in v0.24.0
func (p *PcapPacketGenerator) Close()
Close the packet generator
func (*PcapPacketGenerator) PacketSource ¶
func (p *PcapPacketGenerator) PacketSource() chan *Packet
PacketSource returns a channel when pcap packets are pushed
Source Files
¶
- client.go
- forge.go
- injector.go
- pcap.go
- server.go