Documentation ¶
Index ¶
- Constants
- Variables
- func CompleteTCPFlow(raw []byte) ([][]byte, error)
- func CreateTCPFlowFromPayload(src, dst string, payload []byte) ([][]byte, error)
- func GetPublicLinkLayer(t layers.EthernetType, toServer bool) (*layers.Ethernet, error)
- func GetPublicToClientLinkLayerIPv4() (*layers.Ethernet, error)
- func GetPublicToClientLinkLayerIPv6() (*layers.Ethernet, error)
- func GetPublicToServerLinkLayerIPv4() (*layers.Ethernet, error)
- func GetPublicToServerLinkLayerIPv6() (*layers.Ethernet, error)
- func InjectChaosTraffic(t *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 NewDefaultIPv4Layer() *layers.IPv4
- func NewDefaultTCPLayer() *layers.TCP
- func PacketBuilder(opts ...any) ([]byte, error)
- func ParseEthernetLinkLayer(raw []byte) (gopacket.LinkLayer, gopacket.NetworkLayer, gopacket.TransportLayer, ...)
- func ParseICMPIPv4(raw []byte) (*layers.IPv4, *layers.ICMPv4, gopacket.Payload, error)
- func ParseRaw(raw []byte) (gopacket.LinkLayer, gopacket.NetworkLayer, gopacket.TransportLayer, ...)
- 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 ArpConfig
- type BuilderConfig
- type BuilderConfigOption
- type ChaosTraffic
- type Config
- type ConfigOption
- type EthernetOption
- type ICMPOption
- type IPv4Option
- func WithIPv4_DstIP(i any) IPv4Option
- func WithIPv4_Flags(i any) IPv4Option
- func WithIPv4_FragmentOffset(i any) IPv4Option
- func WithIPv4_ID(i any) IPv4Option
- func WithIPv4_NextProtocol(i any) IPv4Option
- func WithIPv4_Option(optType any, data []byte) IPv4Option
- func WithIPv4_SrcIP(i any) IPv4Option
- func WithIPv4_TOS(i any) IPv4Option
- func WithIPv4_TTL(i any) IPv4Option
- type Statistics
- type TCPIPFrame
- type TCPOption
- func WithTCP_Ack(ack any) TCPOption
- func WithTCP_DataOffset(dataOffset any) TCPOption
- func WithTCP_DstPort(dstPort any) TCPOption
- func WithTCP_Flags(in any) TCPOption
- func WithTCP_OptionMSS(i any) TCPOption
- func WithTCP_OptionSACK(i ...any) TCPOption
- func WithTCP_OptionSACKPermitted() TCPOption
- func WithTCP_OptionTimestamp(i any) TCPOption
- func WithTCP_OptionWindowScale(i any) TCPOption
- func WithTCP_Options(optionType any, data []byte) TCPOption
- func WithTCP_Seq(seq any) TCPOption
- func WithTCP_SrcPort(srcPort any) TCPOption
- func WithTCP_Urgent(urgent any) TCPOption
- func WithTCP_Window(window any) TCPOption
- type UDPOption
Constants ¶
View Source
const ( TCP_FLAG_FIN = 1 << iota TCP_FLAG_SYN TCP_FLAG_RST TCP_FLAG_PSH TCP_FLAG_ACK TCP_FLAG_URG TCP_FLAG_ECE TCP_FLAG_CWR TCP_FLAG_NS )
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 CompleteTCPFlow ¶ added in v1.2.6
func CreateTCPFlowFromPayload ¶ added in v1.2.6
func GetPublicLinkLayer ¶
func InjectChaosTraffic ¶
func InjectChaosTraffic(t *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 NewDefaultIPv4Layer ¶ added in v1.2.5
func NewDefaultTCPLayer ¶ added in v1.2.5
func PacketBuilder ¶ added in v1.2.3
func ParseEthernetLinkLayer ¶ added in v1.2.7
func ParseEthernetLinkLayer(raw []byte) (gopacket.LinkLayer, gopacket.NetworkLayer, gopacket.TransportLayer, gopacket.Payload, error)
func ParseICMPIPv4 ¶
func ParseRaw ¶ added in v1.2.7
func ParseRaw(raw []byte) (gopacket.LinkLayer, gopacket.NetworkLayer, gopacket.TransportLayer, gopacket.Payload, error)
func ParseSrcNDstAddress ¶
func ParseTCPIPv4 ¶
func ParseTCPRaw ¶
func ParseUDPIPv4 ¶
func RegenerateTCPTraffic ¶
func RegenerateTCPTraffic(raw []byte, localIPAddress string, opt ...ConfigOption)
Types ¶
type ArpConfig ¶ added in v1.2.5
func WithArp_ReplyTo ¶ added in v1.2.5
func WithArp_ReplyToEx ¶ added in v1.2.5
func WithArp_RequestAuto ¶ added in v1.2.5
func WithArp_RequestEx ¶ added in v1.2.5
type BuilderConfig ¶ added in v1.2.3
type BuilderConfigOption ¶ added in v1.2.3
type BuilderConfigOption func(config *BuilderConfig)
func WithLoopback ¶ added in v1.2.3
func WithLoopback() BuilderConfigOption
func WithPayload ¶ added in v1.2.3
func WithPayload(payload []byte) BuilderConfigOption
type ChaosTraffic ¶ added in v1.2.6
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 EthernetOption ¶ added in v1.2.5
func WithEthernet_DstMac ¶ added in v1.2.5
func WithEthernet_DstMac(dstMac any) EthernetOption
func WithEthernet_NextLayerType ¶ added in v1.2.5
func WithEthernet_NextLayerType(i any) EthernetOption
func WithEthernet_SrcMac ¶ added in v1.2.5
func WithEthernet_SrcMac(srcMac any) EthernetOption
type ICMPOption ¶ added in v1.2.5
func WithICMP_Id ¶ added in v1.2.5
func WithICMP_Id(id any) ICMPOption
func WithICMP_Payload ¶ added in v1.2.5
func WithICMP_Payload(i []byte) ICMPOption
func WithICMP_Sequence ¶ added in v1.2.5
func WithICMP_Sequence(sequence any) ICMPOption
func WithICMP_Type ¶ added in v1.2.5
func WithICMP_Type(icmpType any, icmpCode any) ICMPOption
type IPv4Option ¶ added in v1.2.5
func WithIPv4_DstIP ¶ added in v1.2.5
func WithIPv4_DstIP(i any) IPv4Option
func WithIPv4_Flags ¶ added in v1.2.5
func WithIPv4_Flags(i any) IPv4Option
func WithIPv4_FragmentOffset ¶ added in v1.2.5
func WithIPv4_FragmentOffset(i any) IPv4Option
func WithIPv4_ID ¶ added in v1.2.5
func WithIPv4_ID(i any) IPv4Option
func WithIPv4_NextProtocol ¶ added in v1.2.5
func WithIPv4_NextProtocol(i any) IPv4Option
func WithIPv4_Option ¶ added in v1.2.5
func WithIPv4_Option(optType any, data []byte) IPv4Option
func WithIPv4_SrcIP ¶ added in v1.2.5
func WithIPv4_SrcIP(i any) IPv4Option
func WithIPv4_TOS ¶ added in v1.2.5
func WithIPv4_TOS(i any) IPv4Option
func WithIPv4_TTL ¶ added in v1.2.5
func WithIPv4_TTL(i any) IPv4Option
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)
type TCPOption ¶ added in v1.2.5
func WithTCP_Ack ¶ added in v1.2.5
func WithTCP_DataOffset ¶ added in v1.2.5
func WithTCP_DstPort ¶ added in v1.2.5
func WithTCP_Flags ¶ added in v1.2.5
func WithTCP_OptionMSS ¶ added in v1.2.5
WithTCP_OptionMSS is a IPv4Option default 1460
func WithTCP_OptionSACK ¶ added in v1.2.5
func WithTCP_OptionSACKPermitted ¶ added in v1.2.5
func WithTCP_OptionSACKPermitted() TCPOption
func WithTCP_OptionTimestamp ¶ added in v1.2.5
func WithTCP_OptionWindowScale ¶ added in v1.2.5
func WithTCP_Options ¶ added in v1.2.5
func WithTCP_Seq ¶ added in v1.2.5
func WithTCP_SrcPort ¶ added in v1.2.5
func WithTCP_Urgent ¶ added in v1.2.5
func WithTCP_Window ¶ added in v1.2.5
Source Files ¶
Click to show internal directories.
Click to hide internal directories.