packets

package
v0.0.0-...-1267fb5 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Command_Version = "version"
	Command_Verack  = "verack"
	Command_Addr    = "addr"
	Command_Inv     = "inv"
	Command_Getdata = "getdata"
	Command_Object  = "object"
)

Variables

This section is empty.

Functions

func Write

func Write(w2 io.Writer, p Packet)

Types

type Addr

type Addr []Address

func (*Addr) Marshal

func (a *Addr) Marshal() []byte

func (*Addr) Unmarshal

func (a *Addr) Unmarshal(b []byte) error

type Address

type Address struct {
	Time     uint64
	Stream   uint32
	Services uint64
	IP       net.IP
	Port     uint16
}

type Collection

type Collection []string

func (*Collection) Marshal

func (in *Collection) Marshal() []byte

func (*Collection) Unmarshal

func (in *Collection) Unmarshal(b []byte) error

type Command

type Command string

type Packet

type Packet struct {
	Command Command
	Payload []byte
}

func Read

func Read(r io.Reader) (*Packet, error)

type Version

type Version struct {
	Version   int32
	Services  uint64
	Timestamp int64

	SrcServices uint64
	SrcIP       net.IP
	SrcPort     uint16

	DstServices uint64
	DstIP       net.IP
	DstPort     uint16

	Nonce     uint64
	UserAgent string
	Streams   []uint64
}

func (*Version) Marshal

func (v *Version) Marshal() []byte

func (*Version) Unmarshal

func (v *Version) Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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