tcp

package module
v0.0.0-...-cb716af Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2015 License: MPL-2.0 Imports: 0 Imported by: 3

README

tcp

Go TCP packet structure

I have since moved to use: github.com/google/gopacket

p := gopacket.NewPacket(packet, layers.LayerTypeTCP, gopacket.DecodeOptions{Lazy: true, NoCopy: true})

if tcpLayer := p.Layer(layers.LayerTypeTCP); tcpLayer != nil {
	    tcp, ok := tcpLayer.(*layers.TCP)
	    if !ok {
		    return ap, errors.New("Unable to convert packet to TCP")
	    }
	
	    //tcp <- has what we want.
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	SourcePort      uint16
	DestinationPort uint16
	Sequence        uint32
	Acknowledgement uint32
	DataOffset      uint8
	//Unused Bytes Here..
	WindowSize    uint16
	Checksum      uint16
	UrgentPointer uint16
	Options       []byte
}

func ParseHeader

func ParseHeader(m []byte) (*Header, error)

Jump to

Keyboard shortcuts

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