geolink

package
v0.0.0-...-be289da Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package geolink models a geographic point-to-point link.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extend

func Extend(dev packet.NetworkDevice, config *Config) packet.NetworkDevice

Extend creates a geographic link between the given device and the returned device.

Internally, this creates the following link:

external <=> dev

where:

- dev is the device passed as argument

- external is the device returned to the caller

Packets flowing through this chain experience the configured delay in both directions.

We create two goroutines for forwarding packets, which are closed when dev is closed.

Types

type Config

type Config struct {
	// Delay is the propagation delay.
	Delay time.Duration

	// Log enables logging of delivered packets.
	Log bool
}

Config configures a geographic point-to-point link.

Jump to

Keyboard shortcuts

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