Skip to content

Commit

Permalink
udpnat2: Add cache funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Nov 18, 2024
1 parent fdca9b3 commit 30fbafd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions common/udpnat2/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ func (s *Service) NewPacket(bufferSlices [][]byte, source M.Socksaddr, destinati
}
}

func (s *Service) Purge() {
s.cache.Purge()
}

func (s *Service) PurgeExpired() {
s.cache.PurgeExpired()
}

func (s *Service) Metrics() Metrics {
return s.metrics
}

func (s *Service) ResetMetrics() Metrics {
metrics := s.metrics
s.metrics = Metrics{}
return metrics
}

0 comments on commit 30fbafd

Please sign in to comment.