network

package
v0.0.0-...-70695b7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MPL-2.0 Imports: 9 Imported by: 0

README

ipv4 - rdtp/IPv4 interface

Documentation license

// TODO

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPv4

type IPv4 struct {
	// contains filtered or unexported fields
}

IPv4 represents the underlying IPv4 network and functions to interact with the network interface

func NewIPv4

func NewIPv4() (*IPv4, error)

NewIPv4 returns a new ipv4 network interface

func (*IPv4) Send

func (ip *IPv4) Send(pck *packet.Packet) error

Send sends a packet to the destination IP address

func (*IPv4) StartReceiver

func (ip *IPv4) StartReceiver(forward func(*packet.Packet) error)

StartReceiver forwards all ipv4 packets received which carry rdtp These ipv4 packets are processed until an rdtp packet.Packet is extracted, then the next() function is called with the packet

type Network

type Network interface {
	Send(p *packet.Packet) error
	StartReceiver(fn func(p *packet.Packet) error)
}

Network represents an unreliable channel for sending and receiving rdtp packets

Jump to

Keyboard shortcuts

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