ipv4

package
Version: v0.0.0-...-0e9ae86 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2015 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type_ICMP     = 0x01
	Type_TCP      = 0x06
	Type_UDP      = 0x11
	Type_IPv6     = 0x29
	Type_IPv6ICMP = 0x3a
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IPv4

type IPv4 struct {
	Version        uint8 //4-bits
	IHL            uint8 //4-bits
	DSCP           uint8 //6-bits
	ECN            uint8 //2-bits
	Length         uint16
	Id             uint16
	Flags          uint16 //3-bits
	FragmentOffset uint16 //13-bits
	TTL            uint8
	Protocol       uint8
	Checksum       uint16
	NWSrc          net.IP
	NWDst          net.IP
	Options        util.Buffer
	Data           util.Message
}

func New

func New() *IPv4

func (*IPv4) Len

func (i *IPv4) Len() (n uint16)

func (*IPv4) MarshalBinary

func (i *IPv4) MarshalBinary() (data []byte, err error)

func (*IPv4) UnmarshalBinary

func (i *IPv4) UnmarshalBinary(data []byte) error

Source Files

Jump to

Keyboard shortcuts

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