Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Number of replay packets sent from a new session. NewSession = metrics.RegisterMetric("replay", "NewSession") // Number of replay packets sent from a known session. KnownSession = metrics.RegisterMetric("replay", "KnownSession") )
Functions ¶
This section is empty.
Types ¶
type ReplayCache ¶
type ReplayCache struct {
// contains filtered or unexported fields
}
ReplayCache stores the signature of recent decrypted packets to avoid a replay attack.
func NewCache ¶
func NewCache(capacity int, expireInterval time.Duration) *ReplayCache
NewCache creates a new replay cache.
func (*ReplayCache) Clear ¶ added in v1.6.0
func (c *ReplayCache) Clear()
Clear removes all the data in the replay cache.
func (*ReplayCache) IsDuplicate ¶
func (c *ReplayCache) IsDuplicate(data []byte) bool
IsDuplicate checks if the given data is present in the replay cache.
func (*ReplayCache) Sizes ¶
func (c *ReplayCache) Sizes() (int, int)
Sizes returns the number of entries in `current` map and `previous` map.
Click to show internal directories.
Click to hide internal directories.