core

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const FLOW = 12
View Source
const FLOW_STATE = FLOW + STATE
View Source
const INTERVAL = 5
View Source
const IPPROTO_TCP = 0x06
View Source
const IPPROTO_UDP = 0x11
View Source
const MAX_CPU = 256
View Source
const STATE = 32

Variables

View Source
var BPF_O []byte

Functions

This section is empty.

Types

type Control

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

func New

func New(bpf []byte, veth string, vip IP4, hwaddr [6]byte, native, bridge bool, peth ...string) *Control

func (*Control) Defcon

func (c *Control) Defcon(d uint8) uint8

func (*Control) DelBackendIdx

func (c *Control) DelBackendIdx(vip IP4, port uint16, udp bool)

func (*Control) DelMac

func (c *Control) DelMac(mac MAC)

func (*Control) DelNatVipRip

func (c *Control) DelNatVipRip(nat, vip, rip IP4)

func (*Control) DelRip

func (c *Control) DelRip(rip IP4)

func (*Control) Era

func (c *Control) Era() (uint64, uint8)

func (*Control) FlowQueue

func (c *Control) FlowQueue() (*[FLOW_STATE]byte, bool)

func (*Control) GlobalStats

func (c *Control) GlobalStats(clear bool) counters

func (*Control) ReadMAC

func (c *Control) ReadMAC(ip IP4) *MAC

func (*Control) SetBackendIdx

func (c *Control) SetBackendIdx(vip IP4, port uint16, udp bool, idx [8192]uint8, sticky bool, leastconns, weight uint8)

func (*Control) SetBackendRec

func (c *Control) SetBackendRec(rip IP4, hwaddr MAC, vlan uint16, idx uint32, ifindex int32)

func (*Control) SetNatVipRip

func (c *Control) SetNatVipRip(nat, vip, rip, src IP4, iface string, vlan uint16, ifindex int, hwaddr MAC)

func (*Control) SetRipMac

func (c *Control) SetRipMac(rip IP4, mac MAC)

func (*Control) SetVipSettings

func (c *Control) SetVipSettings(vip IP4, up bool)

func (*Control) UpdateFlow

func (c *Control) UpdateFlow(f []byte)

func (*Control) VipRipPortConcurrents

func (c *Control) VipRipPortConcurrents(vip, rip IP4, port uint16, done chan bool) chan uint64

func (*Control) VipRipPortCounters

func (c *Control) VipRipPortCounters(vip, rip IP4, port uint16, clear bool, curr uint64) counters

type IP4

type IP4 = types.IP4

type IP6

type IP6 = types.IP6

type MAC

type MAC = types.MAC

Jump to

Keyboard shortcuts

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