vtap

package
v0.0.0-...-9634a1a Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCPServer = iota
	TCPClient
	UDPServer
	UDPClient
	MAX_SERVICE_TYPE
)
View Source
const (
	NORMAL_IP = iota // normal_ip (protocol + role)->(epc_id + port + ip)->(vtap_id + pid)
	LOOP_IP          // 127.0.0.1/8 loopback (protocol + role)->(vtap_id + port + netnsIndex)->(vtap_id + pid)
	MAX_IP_TYPE
)

Variables

View Source
var ALL_DOMAIMS = []string{"0"}

Functions

func ConvertStrToIntList

func ConvertStrToIntList(convertStr string) ([]int, error)

func DefaultFieldNone

func DefaultFieldNone(filed string) bool

func FilterSlice

func FilterSlice(s []string, filter func(x string) bool) []string

func GetKey

func GetKey(vtap *models.VTap) string

func JudgeField

func JudgeField(field string) bool

Types

type AggregateMap

type AggregateMap map[uint64]*GlobalEntry

type CacheKC

type CacheKC struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type CacheReq

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

func NewCacheReq

func NewCacheReq(req *trident.GPIDSyncRequest) *CacheReq

func (*CacheReq) After

func (c *CacheReq) After(r *CacheReq) bool

type EntryData

func NewEntryData

func NewEntryData() EntryData

type GlobalEntry

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

func NewGlobalEntry

func NewGlobalEntry(vtapID uint32, pid uint32) *GlobalEntry

type GroupData

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

type IDToGPID

type IDToGPID map[uint64]uint32

(vtap_id + pid): gpid

type KubernetesCluster

type KubernetesCluster struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*KubernetesCluster) DeleteCache

func (k *KubernetesCluster) DeleteCache(clusterID string)

type KvmVTapCacheMap

type KvmVTapCacheMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewKvmVTapCacheMap

func NewKvmVTapCacheMap() *KvmVTapCacheMap

func (*KvmVTapCacheMap) Add

func (m *KvmVTapCacheMap) Add(vTapCache *VTapCache)

func (*KvmVTapCacheMap) Delete

func (m *KvmVTapCacheMap) Delete(key string)

func (*KvmVTapCacheMap) Get

func (m *KvmVTapCacheMap) Get(key string) *VTapCache

type PlatformDataType

type PlatformDataType struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*PlatformDataType) String

func (t *PlatformDataType) String() string

type ProcessInfo

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

func NewProcessInfo

func NewProcessInfo(db *gorm.DB, cfg *config.Config) *ProcessInfo

func (*ProcessInfo) DeleteVTapExpiredData

func (p *ProcessInfo) DeleteVTapExpiredData(dbVTapIDs mapset.Set)

func (*ProcessInfo) GetGPIDResponseByReq

func (p *ProcessInfo) GetGPIDResponseByReq(req *trident.GPIDSyncRequest) *trident.GPIDSyncResponse

func (*ProcessInfo) GetGPIDResponseByVtapID

func (p *ProcessInfo) GetGPIDResponseByVtapID(vtapID uint32) *trident.GPIDSyncResponse

func (*ProcessInfo) GetGPIDShareReqs

func (p *ProcessInfo) GetGPIDShareReqs() *trident.ShareGPIDSyncRequests

func (*ProcessInfo) GetGlobalEntries

func (p *ProcessInfo) GetGlobalEntries() ([]*trident.GlobalGPIDEntry, []*trident.GlobalLoopbackGPIDEntry)

func (*ProcessInfo) GetRealGlobalData

func (p *ProcessInfo) GetRealGlobalData() []*trident.RealClientToRealServer

func (*ProcessInfo) GetVTapGPIDReq

func (p *ProcessInfo) GetVTapGPIDReq(vtapID uint32) (*trident.GPIDSyncRequest, uint32)

func (*ProcessInfo) TimedGenerateGPIDInfo

func (p *ProcessInfo) TimedGenerateGPIDInfo()

func (*ProcessInfo) UpdateGPIDReqFromShare

func (p *ProcessInfo) UpdateGPIDReqFromShare(shareReq *trident.ShareGPIDSyncRequests)

func (*ProcessInfo) UpdateVTapGPIDReq

func (p *ProcessInfo) UpdateVTapGPIDReq(req *trident.GPIDSyncRequest)

type RealClientToRealServer

type RealClientToRealServer map[uint64]uint64

type VTapCache

type VTapCache struct {

	// vtap vtap id
	VPCID int
	// vtap platform data
	PlatformData *atomic.Value //*PlatformData
	// contains filtered or unexported fields
}

func NewVTapCache

func NewVTapCache(vtap *models.VTap) *VTapCache

func (*VTapCache) EnabledApplicationMonitoring

func (c *VTapCache) EnabledApplicationMonitoring() bool

func (*VTapCache) EnabledNetworkMonitoring

func (c *VTapCache) EnabledNetworkMonitoring() bool

func (*VTapCache) EnabledTrafficDistribution

func (c *VTapCache) EnabledTrafficDistribution() bool

func (*VTapCache) GetAZ

func (c *VTapCache) GetAZ() string

func (*VTapCache) GetArch

func (c *VTapCache) GetArch() string

func (*VTapCache) GetBootTime

func (c *VTapCache) GetBootTime() int

func (*VTapCache) GetCPUNum

func (c *VTapCache) GetCPUNum() int

func (*VTapCache) GetCachedAt

func (c *VTapCache) GetCachedAt() time.Time

func (*VTapCache) GetConfigSyncInterval

func (c *VTapCache) GetConfigSyncInterval() int

func (*VTapCache) GetConfigTapMode

func (c *VTapCache) GetConfigTapMode() int

func (*VTapCache) GetControllerIP

func (c *VTapCache) GetControllerIP() string

func (*VTapCache) GetCtrlIP

func (c *VTapCache) GetCtrlIP() string

func (*VTapCache) GetCtrlMac

func (c *VTapCache) GetCtrlMac() string

func (*VTapCache) GetCurControllerIP

func (c *VTapCache) GetCurControllerIP() string

func (*VTapCache) GetCurTSDBIP

func (c *VTapCache) GetCurTSDBIP() string

func (*VTapCache) GetExceptions

func (c *VTapCache) GetExceptions() int64

func (*VTapCache) GetExpectedRevision

func (c *VTapCache) GetExpectedRevision() string

func (*VTapCache) GetFunctions

func (c *VTapCache) GetFunctions() mapset.Set

func (*VTapCache) GetKernelVersion

func (c *VTapCache) GetKernelVersion() string

func (*VTapCache) GetKey

func (c *VTapCache) GetKey() string

func (*VTapCache) GetLaunchServer

func (c *VTapCache) GetLaunchServer() string

func (*VTapCache) GetLaunchServerID

func (c *VTapCache) GetLaunchServerID() int

func (*VTapCache) GetLcuuid

func (c *VTapCache) GetLcuuid() string

func (*VTapCache) GetMemorySize

func (c *VTapCache) GetMemorySize() int64

func (*VTapCache) GetOs

func (c *VTapCache) GetOs() string

func (*VTapCache) GetPodClusterID

func (c *VTapCache) GetPodClusterID() int

func (*VTapCache) GetProcessName

func (c *VTapCache) GetProcessName() string

func (*VTapCache) GetPushVersionGroups

func (c *VTapCache) GetPushVersionGroups() uint64

func (*VTapCache) GetPushVersionPlatformData

func (c *VTapCache) GetPushVersionPlatformData() uint64

func (*VTapCache) GetPushVersionPolicy

func (c *VTapCache) GetPushVersionPolicy() uint64

func (*VTapCache) GetRegion

func (c *VTapCache) GetRegion() string

func (*VTapCache) GetRegionID

func (c *VTapCache) GetRegionID() int

func (*VTapCache) GetRevision

func (c *VTapCache) GetRevision() string

func (*VTapCache) GetSimplePlatformDataStr

func (c *VTapCache) GetSimplePlatformDataStr() []byte

func (*VTapCache) GetSimplePlatformDataVersion

func (c *VTapCache) GetSimplePlatformDataVersion() uint64

func (*VTapCache) GetSyncedControllerAt

func (c *VTapCache) GetSyncedControllerAt() *time.Time

func (*VTapCache) GetSyncedTSDBAt

func (c *VTapCache) GetSyncedTSDBAt() *time.Time

func (*VTapCache) GetTSDBIP

func (c *VTapCache) GetTSDBIP() string

func (*VTapCache) GetTapMode

func (c *VTapCache) GetTapMode() int

func (*VTapCache) GetUpgradePackage

func (c *VTapCache) GetUpgradePackage() string

func (*VTapCache) GetVPCID

func (c *VTapCache) GetVPCID() int

func (*VTapCache) GetVTapConfig

func (c *VTapCache) GetVTapConfig() *VTapConfig

func (*VTapCache) GetVTapEnabled

func (c *VTapCache) GetVTapEnabled() int

func (*VTapCache) GetVTapGroupLcuuid

func (c *VTapCache) GetVTapGroupLcuuid() string

func (*VTapCache) GetVTapHost

func (c *VTapCache) GetVTapHost() string

func (*VTapCache) GetVTapID

func (c *VTapCache) GetVTapID() uint32

func (*VTapCache) GetVTapLocalSegments

func (c *VTapCache) GetVTapLocalSegments() []*trident.Segment

func (*VTapCache) GetVTapPlatformData

func (c *VTapCache) GetVTapPlatformData() *metadata.PlatformData

func (*VTapCache) GetVTapRemoteSegments

func (c *VTapCache) GetVTapRemoteSegments() []*trident.Segment

func (*VTapCache) GetVTapType

func (c *VTapCache) GetVTapType() int

func (*VTapCache) ResetControllerSyncFlag

func (c *VTapCache) ResetControllerSyncFlag()

func (*VTapCache) ResetTSDBSyncFlag

func (c *VTapCache) ResetTSDBSyncFlag()

func (*VTapCache) SetControllerSyncFlag

func (c *VTapCache) SetControllerSyncFlag()

func (*VTapCache) SetTSDBSyncFlag

func (c *VTapCache) SetTSDBSyncFlag()

func (*VTapCache) UpdateBootTime

func (c *VTapCache) UpdateBootTime(bootTime uint32)

func (*VTapCache) UpdateCtrlMacFromGrpc

func (c *VTapCache) UpdateCtrlMacFromGrpc(ctrlMac string)

func (*VTapCache) UpdateCurControllerIP

func (c *VTapCache) UpdateCurControllerIP(IP string)

func (*VTapCache) UpdateCurTSDBIP

func (c *VTapCache) UpdateCurTSDBIP(IP string)

func (*VTapCache) UpdateExceptions

func (c *VTapCache) UpdateExceptions(exceptions int64)

只更新采集器返回的异常,控制器异常不用更新,由控制器处理其异常

func (*VTapCache) UpdateLaunchServer

func (c *VTapCache) UpdateLaunchServer(launcherServer string)

func (*VTapCache) UpdateLaunchServerID

func (c *VTapCache) UpdateLaunchServerID(id int)

func (*VTapCache) UpdatePushVersionGroups

func (c *VTapCache) UpdatePushVersionGroups(version uint64)

func (*VTapCache) UpdatePushVersionPlatformData

func (c *VTapCache) UpdatePushVersionPlatformData(version uint64)

func (*VTapCache) UpdatePushVersionPolicy

func (c *VTapCache) UpdatePushVersionPolicy(version uint64)

func (*VTapCache) UpdateRevision

func (c *VTapCache) UpdateRevision(revision string)

func (*VTapCache) UpdateSyncedControllerAt

func (c *VTapCache) UpdateSyncedControllerAt(syncTime time.Time)

func (*VTapCache) UpdateSyncedTSDB

func (c *VTapCache) UpdateSyncedTSDB(syncTime time.Time, IP string) bool

func (*VTapCache) UpdateSyncedTSDBAt

func (c *VTapCache) UpdateSyncedTSDBAt(syncTime time.Time)

func (*VTapCache) UpdateSystemInfoFromGrpc

func (c *VTapCache) UpdateSystemInfoFromGrpc(cpuNum int, memorySize int64, arch, os, kernelVersion, processName string)

func (*VTapCache) UpdateUpgradeInfo

func (c *VTapCache) UpdateUpgradeInfo(expectedRevision string, upgradePackage string)

type VTapCacheMap

type VTapCacheMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewVTapCacheMap

func NewVTapCacheMap() *VTapCacheMap

func (*VTapCacheMap) Add

func (m *VTapCacheMap) Add(vTapCache *VTapCache)

func (*VTapCacheMap) Delete

func (m *VTapCacheMap) Delete(key string)

func (*VTapCacheMap) Get

func (m *VTapCacheMap) Get(key string) *VTapCache

func (*VTapCacheMap) GetCount

func (m *VTapCacheMap) GetCount() int

func (*VTapCacheMap) GetKeySet

func (m *VTapCacheMap) GetKeySet() mapset.Set

func (*VTapCacheMap) List

func (m *VTapCacheMap) List() []string

type VTapConfig

type VTapConfig struct {
	models.RVTapGroupConfiguration
	ConvertedL4LogTapTypes      []uint32
	ConvertedL7LogStoreTapTypes []uint32
	ConvertedDecapType          []uint32
	ConvertedDomains            []string
}

func NewVTapConfig

func NewVTapConfig(config *models.RVTapGroupConfiguration) *VTapConfig

type VTapIDCacheMap

type VTapIDCacheMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewVTapIDCacheMap

func NewVTapIDCacheMap() *VTapIDCacheMap

func (*VTapIDCacheMap) Add

func (m *VTapIDCacheMap) Add(vTapCache *VTapCache)

func (*VTapIDCacheMap) Delete

func (m *VTapIDCacheMap) Delete(key int)

func (*VTapIDCacheMap) Get

func (m *VTapIDCacheMap) Get(key int) *VTapCache

type VTapIDToReq

type VTapIDToReq struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewVTapIDToReq

func NewVTapIDToReq() *VTapIDToReq

type VTapInfo

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

func NewVTapInfo

func NewVTapInfo(db *gorm.DB, metaData *metadata.MetaData, cfg *config.Config) *VTapInfo

func (*VTapInfo) AddVTapCache

func (v *VTapInfo) AddVTapCache(vtap *models.VTap)

func (*VTapInfo) DeleteVTapCache

func (v *VTapInfo) DeleteVTapCache(key string)

func (*VTapInfo) GenerateRemoteSegments

func (v *VTapInfo) GenerateRemoteSegments() []*trident.Segment

func (*VTapInfo) GenerateVTapCache

func (v *VTapInfo) GenerateVTapCache()

func (*VTapInfo) GenerateVTapLocalSegments

func (v *VTapInfo) GenerateVTapLocalSegments(c *VTapCache) []*trident.Segment

func (*VTapInfo) GetConfigTSDBIP

func (v *VTapInfo) GetConfigTSDBIP() string

func (*VTapInfo) GetDefaultMaxEscapeSeconds

func (v *VTapInfo) GetDefaultMaxEscapeSeconds() int

func (*VTapInfo) GetDefaultMaxMemory

func (v *VTapInfo) GetDefaultMaxMemory() int

func (*VTapInfo) GetGroupData

func (v *VTapInfo) GetGroupData() []byte

func (*VTapInfo) GetGroupDataVersion

func (v *VTapInfo) GetGroupDataVersion() uint64

func (*VTapInfo) GetKubernetesClusterID

func (v *VTapInfo) GetKubernetesClusterID(clusterID string, value string, force bool) string

func (*VTapInfo) GetKvmVTapCache

func (v *VTapInfo) GetKvmVTapCache(key string) *VTapCache

func (*VTapInfo) GetProcessInfo

func (v *VTapInfo) GetProcessInfo() *ProcessInfo

func (*VTapInfo) GetRegionIDByLcuuid

func (v *VTapInfo) GetRegionIDByLcuuid(lcuuid string) int

func (*VTapInfo) GetRemoteSegment

func (v *VTapInfo) GetRemoteSegment(c *VTapCache) []*trident.Segment

func (*VTapInfo) GetSelfUpdateUrl

func (v *VTapInfo) GetSelfUpdateUrl() string

func (*VTapInfo) GetSkipInterface

func (v *VTapInfo) GetSkipInterface(c *VTapCache) []*trident.SkipInterface

func (*VTapInfo) GetTapTypes

func (v *VTapInfo) GetTapTypes() []*trident.TapType

func (*VTapInfo) GetTridentTypeForUnkonwVTap

func (v *VTapInfo) GetTridentTypeForUnkonwVTap() uint16

func (*VTapInfo) GetVTapCache

func (v *VTapInfo) GetVTapCache(key string) *VTapCache

func (*VTapInfo) GetVTapCacheIsReady

func (v *VTapInfo) GetVTapCacheIsReady() bool

func (*VTapInfo) GetVTapConfigFromShortID

func (v *VTapInfo) GetVTapConfigFromShortID(shortID string) *VTapConfig

func (*VTapInfo) GetVTapIPs

func (v *VTapInfo) GetVTapIPs() []*trident.VtapIp

func (*VTapInfo) GetVTapLocalConfig

func (v *VTapInfo) GetVTapLocalConfig(vtapGroupLcuuid string) string

func (*VTapInfo) GetVTapLocalConfigByShortID

func (v *VTapInfo) GetVTapLocalConfigByShortID(shortID string) string

func (*VTapInfo) GetVTapPolicyData

func (v *VTapInfo) GetVTapPolicyData(vtapID int, functions mapset.Set) []byte

func (*VTapInfo) GetVTapPolicyVersion

func (v *VTapInfo) GetVTapPolicyVersion(vtapID int, functions mapset.Set) uint64

func (*VTapInfo) InitData

func (v *VTapInfo) InitData()

func (*VTapInfo) IsCtrlMacInTapPorts

func (v *VTapInfo) IsCtrlMacInTapPorts(ctrlIP string, ctrlMac string) bool

func (*VTapInfo) IsTheSameCluster

func (v *VTapInfo) IsTheSameCluster(clusterID string) bool

func (*VTapInfo) PutVTapCacheRefresh

func (v *VTapInfo) PutVTapCacheRefresh()

func (*VTapInfo) Register

func (v *VTapInfo) Register(tapMode int, ctrlIP string, ctrlMac string, hostIPs []string, host string, vTapGroupID string)

func (*VTapInfo) StartRegister

func (v *VTapInfo) StartRegister()

func (*VTapInfo) TimedRefreshVTapCache

func (v *VTapInfo) TimedRefreshVTapCache()

func (*VTapInfo) UpdateTSDBVTapInfo

func (v *VTapInfo) UpdateTSDBVTapInfo(cVTaps []*trident.CommunicationVtap, tsdbIP string)

func (*VTapInfo) UpdateVTapCache

func (v *VTapInfo) UpdateVTapCache(key string, vtap *models.VTap)

type VTapLKData

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

func NewVTapLkData

func NewVTapLkData(ctrlIP string, ctrlMac string, ips []string, host string, region string) *VTapLKData

func (*VTapLKData) LookUpLocalVTapByIP

func (l *VTapLKData) LookUpLocalVTapByIP(db *gorm.DB) *VTapLKResult

func (*VTapLKData) LookUpMirrorVTapByIP

func (l *VTapLKData) LookUpMirrorVTapByIP(db *gorm.DB) *VTapLKResult

func (*VTapLKData) LookUpVTapByHost

func (l *VTapLKData) LookUpVTapByHost(db *gorm.DB) *VTapLKResult

func (*VTapLKData) LookUpVTapByPodNode

func (l *VTapLKData) LookUpVTapByPodNode(db *gorm.DB) *VTapLKResult

type VTapLKResult

type VTapLKResult struct {
	VTapType       int
	LaunchServer   string
	LaunchServerID int
	VTapName       string
	AZ             string
	Region         string
	Lcuuid         string
}

type VTapPlatformData

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

func (*VTapPlatformData) String

func (v *VTapPlatformData) String() string

type VTapPolicyData

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

type VTapRegister

type VTapRegister struct {
	VTapLKData
	// contains filtered or unexported fields
}

func (*VTapRegister) String

func (r *VTapRegister) String() string

Jump to

Keyboard shortcuts

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