Documentation ¶
Index ¶
- Variables
- func CreateTCPHandshakePackets(src, dst string, payload []byte) (*TCPIPFrame, *TCPIPFrame, *TCPIPFrame, []*TCPIPFrame, *TCPIPFrame, error)
- func GetPublicLinkLayer(t layers.EthernetType, toServer bool) (*layers.Ethernet, error)
- func GetPublicRoute() (*net.Interface, net.IP, net.IP, error)
- func GetPublicToClientLinkLayerIPv4() (*layers.Ethernet, error)
- func GetPublicToClientLinkLayerIPv6() (*layers.Ethernet, error)
- func GetPublicToServerLinkLayerIPv4() (*layers.Ethernet, error)
- func GetPublicToServerLinkLayerIPv6() (*layers.Ethernet, error)
- func InjectChaosTraffic(t *chaosmaker.ChaosTraffic, opts ...ConfigOption)
- func InjectHTTPRequest(raw []byte, opt ...ConfigOption)
- func InjectICMPIP(raw []byte, opt ...ConfigOption)
- func InjectRaw(raw []byte, opt ...ConfigOption)
- func InjectTCPIP(raw []byte, opt ...ConfigOption)
- func InjectTCPIPInstance(raw *TCPIPFrame, opt ...ConfigOption)
- func InjectTCPPayload(payload []byte, opt ...ConfigOption)
- func InjectUDPIP(raw []byte, opt ...ConfigOption)
- func ParseICMPIPv4(raw []byte) (*layers.IPv4, *layers.ICMPv4, gopacket.Payload, error)
- func ParseLinkLayer(raw []byte) (*layers.Ethernet, *layers.IPv4, *layers.TCP, error)
- func ParseSrcNDstAddress(src, dst string) (net.IP, net.IP, uint16, uint16, error)
- func ParseTCPIPv4(raw []byte) (*layers.IPv4, *layers.TCP, gopacket.Payload, error)
- func ParseTCPRaw(raw []byte) (*layers.IPv4, *layers.TCP, gopacket.Payload, error)
- func ParseUDPIPv4(raw []byte) (*layers.IPv4, *layers.UDP, gopacket.Payload, error)
- func RegenerateTCPTraffic(raw []byte, localIPAddress string, opt ...ConfigOption)
- type Config
- type ConfigOption
- type Statistics
- type TCPIPFrame
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PublicGatewayAddress net.IP PublicPreferredAddress net.IP PublicInterface *net.Interface )
View Source
var ( Exports = map[string]interface{}{ "GetStatistics": getStatistics, "InjectRaw": InjectRaw, "InjectIP": InjectTCPIP, "InjectTCP": InjectTCPIP, "InjectHTTPRequest": InjectHTTPRequest, "InjectChaosTraffic": InjectChaosTraffic, } )
Functions ¶
func CreateTCPHandshakePackets ¶
func CreateTCPHandshakePackets(src, dst string, payload []byte) ( *TCPIPFrame, *TCPIPFrame, *TCPIPFrame, []*TCPIPFrame, *TCPIPFrame, error, )
func GetPublicLinkLayer ¶
func InjectChaosTraffic ¶
func InjectChaosTraffic(t *chaosmaker.ChaosTraffic, opts ...ConfigOption)
func InjectHTTPRequest ¶
func InjectHTTPRequest(raw []byte, opt ...ConfigOption)
func InjectICMPIP ¶
func InjectICMPIP(raw []byte, opt ...ConfigOption)
func InjectRaw ¶
func InjectRaw(raw []byte, opt ...ConfigOption)
func InjectTCPIP ¶
func InjectTCPIP(raw []byte, opt ...ConfigOption)
func InjectTCPIPInstance ¶
func InjectTCPIPInstance(raw *TCPIPFrame, opt ...ConfigOption)
func InjectTCPPayload ¶
func InjectTCPPayload(payload []byte, opt ...ConfigOption)
func InjectUDPIP ¶
func InjectUDPIP(raw []byte, opt ...ConfigOption)
func ParseICMPIPv4 ¶
func ParseLinkLayer ¶
func ParseSrcNDstAddress ¶
func ParseTCPIPv4 ¶
func ParseTCPRaw ¶
func ParseUDPIPv4 ¶
func RegenerateTCPTraffic ¶
func RegenerateTCPTraffic(raw []byte, localIPAddress string, opt ...ConfigOption)
Types ¶
type ConfigOption ¶
type ConfigOption func(config *Config)
func WithIface ¶
func WithIface(iface string) ConfigOption
func WithLocalAddress ¶
func WithLocalAddress(addr string) ConfigOption
func WithRemoteAddress ¶
func WithRemoteAddress(addr string) ConfigOption
func WithToClient ¶
func WithToClient() ConfigOption
func WithToServer ¶
func WithToServer() ConfigOption
type Statistics ¶
type Statistics struct { LinkLayerStatistics map[string]int64 NetworkLayerStatistics map[string]int64 TransportationLayerStatistics map[string]int64 ICMPStatistics map[string]int64 }
func GetGlobalStatistics ¶
func GetGlobalStatistics() *Statistics
func NewStatistics ¶
func NewStatistics() *Statistics
func (*Statistics) AddICMPStatistics ¶
func (s *Statistics) AddICMPStatistics(name string)
func (*Statistics) AddLinkLayerStatistics ¶
func (s *Statistics) AddLinkLayerStatistics(name string)
func (*Statistics) AddNetworkLayerStatistics ¶
func (s *Statistics) AddNetworkLayerStatistics(name string)
func (*Statistics) AddTransportationLayerStatistics ¶
func (s *Statistics) AddTransportationLayerStatistics(name string)
Click to show internal directories.
Click to hide internal directories.