Documentation
¶
Index ¶
Constants ¶
View Source
const (
EmptyTag = ""
)
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, tag string) bool
IsDuplicate checks if the given data is present in the replay cache. If a non-empty tag is provided, it is not considered as a duplicate when the same tag is used. This can allow retransmit exact content from the same network address. Use an empty tag disables this feature.
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.