Documentation ¶
Index ¶
- Constants
- Variables
- func CleanupContainer(pid int, intcpPairs []*InterceptPair) error
- func Close()
- func CreateNfqRules(pid int, create bool, appMap map[share.CLUSProtoPort]*share.CLUSApp) error
- func DeleteNfqRules(pid int) error
- func DisableOffload(port string)
- func FwdPortPair(pid int, pair *InterceptPair)
- func GetPortPairDebug(pair *InterceptPair) *share.CLUSWorkloadInterceptPort
- func Open(driver string, cnet_type *string, pid int, jumboframe bool) (string, string, error)
- func ResetPortPair(pid int, pair *InterceptPair)
- func RestoreContainer(pid int, pairs []*InterceptPair) error
- func TapPortPair(pid int, pair *InterceptPair)
- type InterceptPair
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 CreateNfqRules ¶
setup iptable rules with NFQUEUE target
func FwdPortPair ¶
func FwdPortPair(pid int, pair *InterceptPair)
func GetPortPairDebug ¶
func GetPortPairDebug(pair *InterceptPair) *share.CLUSWorkloadInterceptPort
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
Click to show internal directories.
Click to hide internal directories.