vc5tmp

package module
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: GPL-2.0 Imports: 20 Imported by: 0

README

vc5tmp

Temporary repo to test new api

BPF object file will be in repo to avoid need to do custom build process.

This should mean that the module can be used like any regular go module.

As the BPF is for a virtual architecture then is doesn't matter what platform the module is used on.

Includes bgp and monitoring cod for now for convenience.

NAT probably won't work on a tagged interface just yet?

Documentation

Index

Constants

View Source
const (
	A = false
	B = true
)
View Source
const (
	TCP protocol = 0x06
	UDP protocol = 0x11
)
View Source
const NAMESPACE = "vc5"
View Source
const PREFIXES = 1048576

Variables

This section is empty.

Functions

func BPF added in v0.0.9

func BPF() []byte

func Load

func Load(file string) (map[uint16]net.IPNet, error)

func VlanInterface

func VlanInterface(prefix net.IPNet) (ret iface, _ bool)

func VlanInterfaces

func VlanInterfaces(in map[uint16]net.IPNet) map[uint16]iface

Types

type Client

type Client struct {
	Interfaces []string
	// contains filtered or unexported fields
}

func (*Client) CreateDestination

func (b *Client) CreateDestination(s Service, d Destination) error

func (*Client) CreateService

func (b *Client) CreateService(s Service) error

func (*Client) Destinations

func (b *Client) Destinations(s Service) ([]DestinationExtended, error)

func (*Client) NATAddr

func (b *Client) NATAddr(vip, rip IP4) (r IP4, _ bool)

func (*Client) NATAddress added in v0.0.9

func (b *Client) NATAddress(vip, rip netip.Addr) (r netip.Addr, _ bool)

func (*Client) RemoveDestination

func (b *Client) RemoveDestination(s Service, d Destination) error

func (*Client) RemoveService

func (b *Client) RemoveService(s Service) error

func (*Client) Service added in v0.0.15

func (b *Client) Service(s Service) (se ServiceExtended, e error)

func (*Client) Services

func (b *Client) Services() ([]ServiceExtended, error)

func (*Client) Start

func (b *Client) Start(address string, nic string) error

func (b *Client) Start(address string, nic string, phy ...string) error {

func (*Client) UpdateDestination

func (b *Client) UpdateDestination(s Service, d Destination) error

func (*Client) VLANs

func (b *Client) VLANs(vlans map[uint16]net.IPNet)

type Destination

type Destination struct {
	Address netip.Addr
	Weight  uint8
}

type DestinationExtended

type DestinationExtended struct {
	Destination Destination
	MAC         MAC
	Stats       Stats
}

type ICMPs

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

func ICMP

func ICMP() *ICMPs

func (*ICMPs) Close

func (s *ICMPs) Close()

func (*ICMPs) Ping

func (s *ICMPs) Ping(target string)

type IP4

type IP4 [4]byte
var IP IP4 = IP4{10, 255, 255, 254}

func (*IP4) IsNil

func (i *IP4) IsNil() bool

func (IP4) String

func (i IP4) String() string

type MAC

type MAC [6]byte

func (*MAC) IsNil

func (m *MAC) IsNil() bool

func (MAC) String

func (m MAC) String() string

type Maps

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

type Prefix added in v0.0.16

type Prefix net.IPNet

type Protocol added in v0.0.14

type Protocol uint8

type Service

type Service struct {
	Address  netip.Addr
	Port     uint16
	Protocol protocol

	//Scheduler uint8
	Sticky bool
	// contains filtered or unexported fields
}

func (*Service) Service

func (s *Service) Service(x svc) Service

type ServiceExtended

type ServiceExtended struct {
	Service Service
	Stats   Stats
}

type Stats

type Stats struct {
	Packets uint64
	Octets  uint64
	Flows   uint64
}

func (Stats) String

func (s Stats) String() string

type Target

type Target struct {
	VIP      IP4
	RIP      IP4
	Port     uint16
	Protocol uint8
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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