ip

package
v0.0.0-...-3ea0f55 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2014 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_HEADER_LENGTH = 20
	MAX_HEADER_LENGTH = 24
)
View Source
const (
	PROTO_TCP = 6
	PROTO_UDP = 17
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	Addr4
	Addr6
}

func NewAddr4

func NewAddr4(addr Addr4) Addr

func NewAddr6

func NewAddr6(addr Addr6) Addr

func (Addr) String

func (ip Addr) String() string

type Addr4

type Addr4 uint32

func (Addr4) String

func (ip Addr4) String() string

type Addr6

type Addr6 uint64

func (Addr6) String

func (ip Addr6) String() string
type Header Header4

func NewHeader

func NewHeader(packet []byte) *Header

func (*Header) DataLen

func (header *Header) DataLen() int

func (*Header) DestIP

func (header *Header) DestIP() string

func (*Header) HeaderLen

func (header *Header) HeaderLen() uint16

func (*Header) IHL

func (header *Header) IHL() uint8

func (*Header) SourceIP

func (header *Header) SourceIP() string

func (*Header) Version

func (header *Header) Version() byte

type Header4

type Header4 struct {
	VersionIHL      byte
	Tos             byte
	TotalLen        uint16
	Identification  uint16
	FlagsFragOffset uint16
	TTL             byte
	Protocol        byte
	Checksum        uint16
	Source          Addr4
	Dest            Addr4
	Options         uint64

	ValidChecksum bool
}

type StreamId

type StreamId uint64

unique identifier for an IP stream between two IP addresses.

Jump to

Keyboard shortcuts

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