pipe

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CNET_DEFAULT = "default"
	CNET_MACVLAN = "macvlan"
)

--

View Source
const (
	PIPE_TC   = "tc"
	PIPE_OVS  = "ovs"
	PIPE_NOTC = "no_tc"
)

Variables

View Source
var ErrNoDefaultRoute = errors.New("No default route")

Functions

func CleanupContainer

func CleanupContainer(pid int, intcpPairs []*InterceptPair) error

Continer stops, we only need to clean-up ports and flows in our namespace

func Close

func Close()

func CreateNfqRules

func CreateNfqRules(pid int, create bool, appMap map[share.CLUSProtoPort]*share.CLUSApp) error

setup iptable rules with NFQUEUE target

func DeleteNfqRules

func DeleteNfqRules(pid int) error

setup iptable rules with NFQUEUE target

func DisableOffload

func DisableOffload(port string)

func disableOffload(port string) {

func FwdPortPair

func FwdPortPair(pid int, pair *InterceptPair)

func GetPortPairDebug

func GetPortPairDebug(pair *InterceptPair) *share.CLUSWorkloadInterceptPort

func Open

func Open(driver string, cnet_type *string, pid int, jumboframe bool) (string, string, error)

func ResetPortPair

func ResetPortPair(pid int, pair *InterceptPair)

func RestoreContainer

func RestoreContainer(pid int, pairs []*InterceptPair) error

Agent exiting, we need put ports back to container, and clean flows in our namespace

func TapPortPair

func TapPortPair(pid int, pair *InterceptPair)

Types

type InterceptPair

type InterceptPair struct {
	Port string
	Peer string

	MAC   net.HardwareAddr
	BCMAC net.HardwareAddr
	UCMAC net.HardwareAddr
	Addrs []share.CLUSIPAddr
	// contains filtered or unexported fields
}

func InspectContainerPorts

func InspectContainerPorts(pid int, existPairs []*InterceptPair) ([]*InterceptPair, error)

1. Enter the container network namespace; 2. 3. ... 4. Return to the original container namespace 5.

func InterceptContainerPorts

func InterceptContainerPorts(pid int, existPairs []*InterceptPair) ([]*InterceptPair, error)

1. Enter the container network namespace; 2. 3. ... 4. Return to the original container namespace 5.

func (*InterceptPair) ExPort

func (m *InterceptPair) ExPort() string

func (*InterceptPair) InPort

func (m *InterceptPair) InPort() string

Jump to

Keyboard shortcuts

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