checker

package
v0.0.0-...-7ea8bc4 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPv4

func IPv4(t *testing.T, b []byte, checkers ...NetworkChecker)

IPv4 checks the validity and properties of the given IPv4 packet. It is expected to be used in conjunction with other network checkers for specific properties. For example, to check the source and destination address, one would call:

checker.IPv4(t, b, checker.SrcAddr(x), checker.DstAddr(y))

Types

type NetworkChecker

type NetworkChecker func(*testing.T, []header.Network)

NetworkChecker is a function to check a property of a network packet

func DstAddr

func DstAddr(addr types.Address) NetworkChecker

DstAddr calculates a checker that checks the destination address

func PayloadLen

func PayloadLen(plen int) NetworkChecker

PayloadLen creates a checker that checks the payload length

func SrcAddr

func SrcAddr(addr types.Address) NetworkChecker

SrcAddr creates a checker that checks the source address

func TCP

func TCP(checkers ...TransportChecker) NetworkChecker

TCP creates a checker that checks the transport protocol is TCP and potentially additional transport header fields

type TransportChecker

type TransportChecker func(*testing.T, header.Transport)

TransportChecker is a function to check a property of a transport packet

func AckNum

func AckNum(seq uint32) TransportChecker

AckNum creates a checker that checks the ack number

func DstPort

func DstPort(port uint16) TransportChecker

DstPort creates a checker that checks the destination port

func SeqNum

func SeqNum(seq uint32) TransportChecker

SeqNum creates a checker that checks the sequence number

func SrcPort

func SrcPort(port uint16) TransportChecker

SrcPort creates a checker that checks the source port

func TCPFlags

func TCPFlags(flags uint8) TransportChecker

TCPFlags creates a checker that checks the tcp flags

func TCPFlagsMatch

func TCPFlagsMatch(flags, mask uint8) TransportChecker

TCPFlagsMatch creates a checker that checks the tcp flags, masked by the given mask, match the supplied flags

func TCPSynOptions

func TCPSynOptions(wantOpts header.TCPSynOptions) TransportChecker

TCPSynOptions creates a checker that checks the presence of TCP options in SYN segments.

If wndScale is negative, the window scale option must not be present

func Window

func Window(window uint16) TransportChecker

Window creates a checker that checks the tcp window

Jump to

Keyboard shortcuts

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