icx

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 18 Imported by: 4

README

InterCloud eXpress (ICX)

ICX Logo

Notes

On Debian you might need to create this symlink to fix bpf compilation issues:

sudo ln -sf /usr/include/$(uname -m)-linux-gnu/asm /usr/include/asm

Documentation

Index

Constants

View Source
const HeaderSize = 32

The size of the GENEVE header with icx options.

Variables

This section is empty.

Functions

func MTU added in v0.1.1

func MTU(pathMTU int) int

MTU returns the maximum transmission unit for a virtual network.

Types

type Handler

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

func NewHandler

func NewHandler(localAddr *tcpip.FullAddress, virtMAC tcpip.LinkAddress, sourcePortHashing, layer3 bool) (*Handler, error)

func (*Handler) AddVirtualNetwork

func (h *Handler) AddVirtualNetwork(vni uint, remoteAddr *tcpip.FullAddress, addrs []netip.Prefix) error

AddVirtualNetwork adds a new network with the given VNI and remote address.

func (*Handler) AllStats added in v0.6.0

func (h *Handler) AllStats() []VirtualNetworkStats

AllStats returns snapshots for all currently registered virtual networks.

func (*Handler) PhyToVirt

func (h *Handler) PhyToVirt(phyFrame, virtFrame []byte) int

PhyToVirt converts a physical frame to a virtual frame typically by performing decapsulation. Returns the length of the resulting virtual frame.

func (*Handler) RemoveVirtualNetwork

func (h *Handler) RemoveVirtualNetwork(vni uint) error

RemoveVirtualNetwork removes a network by its VNI.

func (*Handler) StatsForVNI added in v0.6.0

func (h *Handler) StatsForVNI(vni uint) (VirtualNetworkStats, bool)

StatsForVNI returns a snapshot for a single virtual network.

func (*Handler) UpdateVirtualNetworkKeys added in v0.5.0

func (h *Handler) UpdateVirtualNetworkKeys(vni uint, epoch uint32, rxKey, txKey [16]byte, expiresAt time.Time) error

UpdateVirtualNetworkKeys sets/rotates the encryption keys for a virtual network. This must be called atleast once every 24 hours or after `replay.RekeyAfterMessages` messages.

func (*Handler) VirtToPhy

func (h *Handler) VirtToPhy(virtFrame, phyFrame []byte) (int, bool)

VirtToPhy converts a virtual frame to a physical frame typically by performing encapsulation. Returns the length of the resulting physical frame.

type VirtualNetworkStats added in v0.6.0

type VirtualNetworkStats struct {
	// VNI is the virtual network identifier.
	VNI uint
	// KeyEpoch is the current key epoch.
	KeyEpoch uint32
	// KeyRotations is the number of key rotations that have occurred.
	KeyRotations uint32

	// RXPackets is the number of received packets.
	RXPackets uint64
	// RXBytes is the number of bytes received.
	RXBytes uint64
	// RXDropsNoKey is the number of received packets dropped due to a missing key.
	RXDropsNoKey uint64
	// RXDropsExpiredKey is the number of received packets dropped due to an expired key.
	RXDropsExpiredKey uint64
	// RXReplayDrops is the number of received packets dropped due to a potential replay attack.
	RXReplayDrops uint64
	// RXDecryptErrors is the number of received packets that failed decryption.
	RXDecryptErrors uint64
	// RXInvalidSrc is the number of received packets with an invalid source address.
	RXInvalidSrc uint64

	// TXPackets is the number of transmitted packets.
	TXPackets uint64
	// TXBytes is the number of bytes transmitted.
	TXBytes uint64
	// TXErrors is the number of transmission errors.
	TXErrors uint64

	// LastRX is the timestamp of the last received packet.
	LastRX time.Time
	// LastTX is the timestamp of the last transmitted packet.
	LastTX time.Time
}

VirtualNetwork is a statistics snapshot for a virtual network.

Directories

Path Synopsis
Package replay implements an efficient anti-replay algorithm as specified in RFC 6479.
Package replay implements an efficient anti-replay algorithm as specified in RFC 6479.

Jump to

Keyboard shortcuts

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