Documentation
¶
Overview ¶
Package testutils contains utilities for testing traceroute code
Index ¶
- func CreateMockICMPLayer(typeCode layers.ICMPv4TypeCode) *layers.ICMPv4
- func CreateMockICMPPacket(ipLayer *layers.IPv4, icmpLayer *layers.ICMPv4, innerIP *layers.IPv4, ...) []byte
- func CreateMockIPv4Header(srcIP, dstIP net.IP, protocol int) *ipv4.Header
- func CreateMockIPv4Layer(srcIP, dstIP net.IP, protocol layers.IPProtocol) *layers.IPv4
- func CreateMockTCPLayer(srcPort uint16, dstPort uint16, seqNum uint32, ackNum uint32, syn bool, ...) *layers.TCP
- func CreateMockTCPPacket(ipHeader *ipv4.Header, tcpLayer *layers.TCP, includeHeader bool) (*layers.TCP, []byte)
- func StructFieldCount(v interface{}) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMockICMPLayer ¶
func CreateMockICMPLayer(typeCode layers.ICMPv4TypeCode) *layers.ICMPv4
CreateMockICMPLayer creates a mock ICMP layer for testing
func CreateMockICMPPacket ¶
func CreateMockICMPPacket(ipLayer *layers.IPv4, icmpLayer *layers.ICMPv4, innerIP *layers.IPv4, innerTCP *layers.TCP, partialTCPHeader bool) []byte
CreateMockICMPPacket creates a mock ICMP packet for testing
func CreateMockIPv4Header ¶
CreateMockIPv4Header creates a mock IPv4 header for testing
func CreateMockIPv4Layer ¶
CreateMockIPv4Layer creates a mock IPv4 layer for testing
func CreateMockTCPLayer ¶
func CreateMockTCPLayer(srcPort uint16, dstPort uint16, seqNum uint32, ackNum uint32, syn bool, ack bool, rst bool) *layers.TCP
CreateMockTCPLayer creates a mock TCP layer for testing
func CreateMockTCPPacket ¶
func CreateMockTCPPacket(ipHeader *ipv4.Header, tcpLayer *layers.TCP, includeHeader bool) (*layers.TCP, []byte)
CreateMockTCPPacket creates a mock TCP packet for testing
func StructFieldCount ¶
func StructFieldCount(v interface{}) int
StructFieldCount returns the number of fields in a struct
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.