vtap

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GPID0_MASK = 0xFFFF_FFFF_0000_0000
	GPID1_MASK = 0x0000_0000_FFFF_FFFF
	CACHE_SIZE = 65535

	TCP_PROTO_STR = "TCP"
	UDP_PROTO_STR = "UDP"
	LOOP_BACK_IP  = 0x7F000001
)
View Source
const (
	NORMAL_IP = iota // normal_ip
	LOOP_IP          // 127.0.0.1/8
	MAX_IP_TYPE
)
View Source
const (
	TCPService = iota
	UDPService
	MAX_SERVICE_TYPE
)

Variables

View Source
var ALL_DOMAIMS = []string{"0"}
View Source
var NetWorkL7ProtocolEnabled = []string{"HTTP", "DNS"}

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 AgentIDToReq

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

func NewAgentIDToReq

func NewAgentIDToReq() *AgentIDToReq

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 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 PidPair

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

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) DeleteAgentExpiredData

func (p *ProcessInfo) DeleteAgentExpiredData(dbAgentIDs mapset.Set)

func (*ProcessInfo) GetAgentGPIDReq

func (p *ProcessInfo) GetAgentGPIDReq(agentId uint32) (*trident.GPIDSyncRequest, uint32)

func (*ProcessInfo) GetGPIDResponseByReq

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

func (*ProcessInfo) GetGPIDResponseByVtapID

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

func (*ProcessInfo) GetGPIDShareReqs

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

func (*ProcessInfo) GetGlobalEntries

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

func (*ProcessInfo) GetRVData

func (p *ProcessInfo) GetRVData() []*trident.RipToVip

func (*ProcessInfo) GetRealGlobalData

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

func (*ProcessInfo) TimedGenerateGPIDInfo

func (p *ProcessInfo) TimedGenerateGPIDInfo()

func (*ProcessInfo) UpdateAgentGPIDReq

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

func (*ProcessInfo) UpdateGPIDReqFromShare

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

type RVData

func NewRVData

func NewRVData() RVData

type RealServerData

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

type RipToVipMap

type RipToVipMap 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) EnabledCallMonitoring

func (c *VTapCache) EnabledCallMonitoring() bool

func (*VTapCache) EnabledFunctionMonitoring

func (c *VTapCache) EnabledFunctionMonitoring() bool

func (*VTapCache) EnabledIndicatorMonitoring

func (c *VTapCache) EnabledIndicatorMonitoring() 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) GetExternalAgentHTTPProxyEnabledConfig

func (c *VTapCache) GetExternalAgentHTTPProxyEnabledConfig(v *VTapInfo) int

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) GetLocalConfig

func (c *VTapCache) GetLocalConfig() 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
	ConvertedL4LogIgnoreTapSides []uint32
	ConvertedL7LogIgnoreTapSides []uint32
	ConvertedL7LogStoreTapTypes  []uint32
	ConvertedDecapType           []uint32
	ConvertedDomains             []string
	ConvertedWasmPlugins         []string
	ConvertedSoPlugins           []string
	PluginNewUpdateTime          uint32
}

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 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) GetContainers

func (v *VTapInfo) GetContainers(vtapID int) []*trident.Container

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, agentUniqueIdentifier int)

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) LookUpVTapByPod

func (l *VTapLKData) LookUpVTapByPod(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