Documentation ¶
Index ¶
Constants ¶
View Source
const ( ENTRY_TIMEOUT = 100 * time.Millisecond // 哈希表大小限制 HASH_TABLE_SIZE_BIT_OFFSET = 17 // 必须大于等于15 HASH_TABLE_SIZE = 1 << HASH_TABLE_SIZE_BIT_OFFSET // 128K ELEMENTS_LIMIT = HASH_TABLE_SIZE * 4 PACKET_ID_SIZE_V6 = 96 PACKET_ID_SIZE_V4 = 64 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PacketDedupMap ¶
注意:不是线程安全的,且要求Packet的时间戳是非降序列
func NewPacketDedupMap ¶
func NewPacketDedupMap(name string) *PacketDedupMap
func (*PacketDedupMap) GetCounter ¶
func (m *PacketDedupMap) GetCounter() interface{}
func (*PacketDedupMap) IsDuplicate ¶
func (m *PacketDedupMap) IsDuplicate(packet []byte, timestamp time.Duration) bool
func (*PacketDedupMap) SetIgnoreTTL ¶
func (t *PacketDedupMap) SetIgnoreTTL(b bool)
func (*PacketDedupMap) Size ¶
func (m *PacketDedupMap) Size() int
func (*PacketDedupMap) Width ¶
func (m *PacketDedupMap) Width() int
Click to show internal directories.
Click to hide internal directories.