Add Stack.ResetNetwork

This commit is contained in:
世界 2026-07-19 17:41:50 +08:00
parent 79084fa798
commit b59636919c
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
7 changed files with 64 additions and 5 deletions

View file

@ -113,6 +113,16 @@ func NewSystem(options StackOptions) (Stack, error) {
return stack, nil
}
func (s *System) ResetNetwork() {
if s.tcpNat != nil {
s.tcpNat.Purge()
}
if s.udpNat != nil {
s.udpNat.Purge()
}
s.dispatcher.ResetNetwork()
}
func (s *System) Close() error {
s.dispatcher.Close()
if s.udpNat != nil {