Documentation ¶
Index ¶
- Constants
- func Lookup(host net.IP) (net.IP, error)
- func RegisterPlatformDataCommand(ips []net.IP, port int) *cobra.Command
- type BaseInfo
- type CidrInfo
- type Counter
- type EpcIDIPv6Key
- type GroupLabeler
- func (l *GroupLabeler) Query(l3EpcID int16, ip uint32, podGroupID uint16) []uint16
- func (l *GroupLabeler) QueryIPv6(l3EpcID int16, ip net.IP, podGroupID uint16) []uint16
- func (l *GroupLabeler) QueryService(l3EpcID int16, ip uint32, podGroupID uint16, protocol layers.IPProtocol, ...) []uint16
- func (l *GroupLabeler) QueryServiceIPv6(l3EpcID int16, ip net.IP, podGroupID uint16, protocol layers.IPProtocol, ...) []uint16
- type GrpcSession
- func (s *GrpcSession) Close()
- func (s *GrpcSession) CloseConnection()
- func (s *GrpcSession) GetClient() *grpc.ClientConn
- func (s *GrpcSession) Init(ips []net.IP, port uint16, syncInterval time.Duration, maxMsgSize int, ...)
- func (s *GrpcSession) Request(syncFunction SyncFunction) error
- func (s *GrpcSession) SetSyncInterval(syncInterval time.Duration)
- func (s *GrpcSession) SetTimeout(timeout time.Duration)
- func (s *GrpcSession) Start()
- type Info
- type PlatformDataManager
- type PlatformInfoTable
- func (t *PlatformInfoTable) AddOtherRegion()
- func (t *PlatformInfoTable) ClosePlatformInfoTable()
- func (t *PlatformInfoTable) GetCounter() interface{}
- func (t *PlatformInfoTable) HandleSimpleCommand(op uint16, arg string) string
- func (t *PlatformInfoTable) IPV4InfoAddLru(info *Info, key uint64)
- func (t *PlatformInfoTable) IPV4InfoStat(lruItem interface{})
- func (t *PlatformInfoTable) IPV6InfoAddLru(info *Info, key []byte)
- func (t *PlatformInfoTable) IPV6InfoStat(lruItem interface{})
- func (t *PlatformInfoTable) InfoMissStat(mac uint64)
- func (t *PlatformInfoTable) QueryEpcIDBaseInfo(epcID int32) *BaseInfo
- func (t *PlatformInfoTable) QueryEpcIDBaseInfosPair(epcID0, epcID1 int32) (*BaseInfo, *BaseInfo)
- func (t *PlatformInfoTable) QueryIPV4Infos(epcID int32, ipv4 uint32) *Info
- func (t *PlatformInfoTable) QueryIPV4InfosPair(epcID0 int32, ipv40 uint32, epcID1 int32, ipv41 uint32) (info0 *Info, info1 *Info)
- func (t *PlatformInfoTable) QueryIPV6Infos(epcID int32, ipv6 net.IP) *Info
- func (t *PlatformInfoTable) QueryIPV6InfosPair(epcID0 int32, ipv60 net.IP, epcID1 int32, ipv61 net.IP) (info0 *Info, info1 *Info)
- func (t *PlatformInfoTable) QueryMacInfo(mac uint64) *Info
- func (t *PlatformInfoTable) QueryMacInfosPair(mac0, mac1 uint64) (*Info, *Info)
- func (t *PlatformInfoTable) QueryPodInfo(vtapId uint32, podName string) *PodInfo
- func (t *PlatformInfoTable) QueryRegionID() uint32
- func (t *PlatformInfoTable) QueryVtapEpc0(vtapId uint32) int32
- func (t *PlatformInfoTable) QueryVtapEpc1(vtapId uint32, isIPv4 bool, ip41 uint32, ip61 net.IP) int32
- func (t *PlatformInfoTable) QueryVtapInfo(vtapId uint32) *VtapInfo
- func (t *PlatformInfoTable) ReloadMaster() error
- func (t *PlatformInfoTable) ReloadSlave() error
- func (t *PlatformInfoTable) String() string
- type PodInfo
- type ServiceTable
- type SyncFunction
- type VtapInfo
Constants ¶
View Source
const ( DEFAULT_SYNC_INTERVAL = time.Minute EpcIDIPV6_LEN = 20 LruSlotSize = 1 << 14 LruCap = 1 << 17 GROUPID_MAX = 1 << 16 )
View Source
const ( GROUP_CACHE_IPV6_KEYLEN = 160 / 8 SERVER_GROUP_CACHE_IPV6_KEYLEN = 192 / 8 GROUP_CACHE_SIZE = 65536 )
View Source
const (
DEFAULT_SYNC_TIMEOUT = 8 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Counter ¶
type Counter struct { GrpcRequestTime int64 `statsd:"grpc-request-time"` UpdateServiceTime int64 `statsd:"update-service-time"` UpdatePlatformTime int64 `statsd:"update-platform-time"` UpdateCount int64 `statsd:"update-count"` UpdateServicesCount int64 `statsd:"update-services-count"` IP4TotalCount int64 `statsd:"ip4-total-count"` IP4HitCount int64 `statsd:"ip4-hit-count"` IP6TotalCount int64 `statsd:"ip6-total-count"` IP6HitCount int64 `statsd:"ip6-hit-count"` IP4MissCount int64 `statsd:"ip4-miss-count"` IP6MissCount int64 `statsd:"ip6-miss-count"` MacMissCount int64 `statsd:"mac-miss-count"` EpcMissCount int64 `statsd:"epc-miss-count"` }
type EpcIDIPv6Key ¶
type GroupLabeler ¶
type GroupLabeler struct {
// contains filtered or unexported fields
}
func NewGroupLabeler ¶
func NewGroupLabeler(log *logger.PrefixLogger, idMaps []api.GroupIDMap, portFilterLruCap int, moduleName string) *GroupLabeler
func (*GroupLabeler) Query ¶
func (l *GroupLabeler) Query(l3EpcID int16, ip uint32, podGroupID uint16) []uint16
func (*GroupLabeler) QueryService ¶
func (l *GroupLabeler) QueryService(l3EpcID int16, ip uint32, podGroupID uint16, protocol layers.IPProtocol, serverPort uint16) []uint16
func (*GroupLabeler) QueryServiceIPv6 ¶
func (l *GroupLabeler) QueryServiceIPv6(l3EpcID int16, ip net.IP, podGroupID uint16, protocol layers.IPProtocol, serverPort uint16) []uint16
type GrpcSession ¶
type GrpcSession struct {
// contains filtered or unexported fields
}
func (*GrpcSession) Close ¶
func (s *GrpcSession) Close()
func (*GrpcSession) CloseConnection ¶
func (s *GrpcSession) CloseConnection()
func (*GrpcSession) GetClient ¶
func (s *GrpcSession) GetClient() *grpc.ClientConn
func (*GrpcSession) Request ¶
func (s *GrpcSession) Request(syncFunction SyncFunction) error
func (*GrpcSession) SetSyncInterval ¶
func (s *GrpcSession) SetSyncInterval(syncInterval time.Duration)
func (*GrpcSession) SetTimeout ¶
func (s *GrpcSession) SetTimeout(timeout time.Duration)
func (*GrpcSession) Start ¶
func (s *GrpcSession) Start()
type PlatformDataManager ¶
type PlatformDataManager struct {
// contains filtered or unexported fields
}
func NewPlatformDataManager ¶
func (*PlatformDataManager) NewPlatformInfoTable ¶
func (m *PlatformDataManager) NewPlatformInfoTable(isMaster bool, moudleName string) (*PlatformInfoTable, error)
type PlatformInfoTable ¶
type PlatformInfoTable struct { *ServiceTable *GrpcSession utils.Closable // contains filtered or unexported fields }
func NewPlatformInfoTable ¶
func NewPlatformInfoTable(ips []net.IP, port, index, rpcMaxMsgSize int, moduleName, nodeIP string, receiver *receiver.Receiver, isMaster bool, manager *PlatformDataManager) *PlatformInfoTable
func (*PlatformInfoTable) AddOtherRegion ¶
func (t *PlatformInfoTable) AddOtherRegion()
统计收到其他region的数据
func (*PlatformInfoTable) ClosePlatformInfoTable ¶
func (t *PlatformInfoTable) ClosePlatformInfoTable()
func (*PlatformInfoTable) GetCounter ¶
func (t *PlatformInfoTable) GetCounter() interface{}
func (*PlatformInfoTable) HandleSimpleCommand ¶
func (t *PlatformInfoTable) HandleSimpleCommand(op uint16, arg string) string
func (*PlatformInfoTable) IPV4InfoAddLru ¶
func (t *PlatformInfoTable) IPV4InfoAddLru(info *Info, key uint64)
func (*PlatformInfoTable) IPV4InfoStat ¶
func (t *PlatformInfoTable) IPV4InfoStat(lruItem interface{})
func (*PlatformInfoTable) IPV6InfoAddLru ¶
func (t *PlatformInfoTable) IPV6InfoAddLru(info *Info, key []byte)
func (*PlatformInfoTable) IPV6InfoStat ¶
func (t *PlatformInfoTable) IPV6InfoStat(lruItem interface{})
func (*PlatformInfoTable) InfoMissStat ¶
func (t *PlatformInfoTable) InfoMissStat(mac uint64)
func (*PlatformInfoTable) QueryEpcIDBaseInfo ¶
func (t *PlatformInfoTable) QueryEpcIDBaseInfo(epcID int32) *BaseInfo
func (*PlatformInfoTable) QueryEpcIDBaseInfosPair ¶
func (t *PlatformInfoTable) QueryEpcIDBaseInfosPair(epcID0, epcID1 int32) (*BaseInfo, *BaseInfo)
func (*PlatformInfoTable) QueryIPV4Infos ¶
func (t *PlatformInfoTable) QueryIPV4Infos(epcID int32, ipv4 uint32) *Info
func (*PlatformInfoTable) QueryIPV4InfosPair ¶
func (*PlatformInfoTable) QueryIPV6Infos ¶
func (t *PlatformInfoTable) QueryIPV6Infos(epcID int32, ipv6 net.IP) *Info
func (*PlatformInfoTable) QueryIPV6InfosPair ¶
func (*PlatformInfoTable) QueryMacInfo ¶
func (t *PlatformInfoTable) QueryMacInfo(mac uint64) *Info
func (*PlatformInfoTable) QueryMacInfosPair ¶
func (t *PlatformInfoTable) QueryMacInfosPair(mac0, mac1 uint64) (*Info, *Info)
func (*PlatformInfoTable) QueryPodInfo ¶
func (t *PlatformInfoTable) QueryPodInfo(vtapId uint32, podName string) *PodInfo
func (*PlatformInfoTable) QueryRegionID ¶
func (t *PlatformInfoTable) QueryRegionID() uint32
func (*PlatformInfoTable) QueryVtapEpc0 ¶
func (t *PlatformInfoTable) QueryVtapEpc0(vtapId uint32) int32
func (*PlatformInfoTable) QueryVtapEpc1 ¶
func (t *PlatformInfoTable) QueryVtapEpc1(vtapId uint32, isIPv4 bool, ip41 uint32, ip61 net.IP) int32
epc1的计算 1. 本地路由优先, 先假设等于epc0: 验证epc0+ip1是否在cidr list中 2. 对等连接路由其次, 假设等于epc0的peer-connection的epc: 2.1 查询PeerConnection list, 确认epc0的对等连接的epc为: epc0_0, epc0_1... 2.2 假设等于epc_0_0: 验证epc0_0+ip1是否在cidr list中 2.3 假设等于epc_0_1: 验证epc0_0+ip1是否在cidr list中 2.4 ... 3. 如果还找不到, 直接使用ip1去查wan ip
func (*PlatformInfoTable) QueryVtapInfo ¶
func (t *PlatformInfoTable) QueryVtapInfo(vtapId uint32) *VtapInfo
func (*PlatformInfoTable) ReloadMaster ¶
func (t *PlatformInfoTable) ReloadMaster() error
func (*PlatformInfoTable) ReloadSlave ¶
func (t *PlatformInfoTable) ReloadSlave() error
func (*PlatformInfoTable) String ¶
func (t *PlatformInfoTable) String() string
type ServiceTable ¶
type ServiceTable struct {
// contains filtered or unexported fields
}
func NewServiceTable ¶
func NewServiceTable(grpcServices []*trident.ServiceInfo) *ServiceTable
func (*ServiceTable) QueryService ¶
func (*ServiceTable) String ¶
func (s *ServiceTable) String() string
Click to show internal directories.
Click to hide internal directories.