mirror of
https://github.com/ccding/go-stun.git
synced 2025-09-26 21:15:52 +08:00
NATSymmetricUDPFirewall -> SymmetricUDPFirewall (#34)
This commit is contained in:
@@ -38,26 +38,27 @@ const (
|
||||
NATSymmetric
|
||||
NATRestricted
|
||||
NATPortRestricted
|
||||
NATSymmetricUDPFirewall
|
||||
SymmetricUDPFirewall
|
||||
|
||||
// Deprecated spellings of these constants
|
||||
NATSymetric = NATSymmetric
|
||||
NATSymetricUDPFirewall = NATSymmetricUDPFirewall
|
||||
NATSymetric = NATSymmetric
|
||||
NATSymetricUDPFirewall = SymmetricUDPFirewall
|
||||
NATSymmetricUDPFirewall = SymmetricUDPFirewall
|
||||
)
|
||||
|
||||
var natStr map[NATType]string
|
||||
|
||||
func init() {
|
||||
natStr = map[NATType]string{
|
||||
NATError: "Test failed",
|
||||
NATUnknown: "Unexpected response from the STUN server",
|
||||
NATBlocked: "UDP is blocked",
|
||||
NATFull: "Full cone NAT",
|
||||
NATSymmetric: "Symmetric NAT",
|
||||
NATRestricted: "Restricted NAT",
|
||||
NATPortRestricted: "Port restricted NAT",
|
||||
NATNone: "Not behind a NAT",
|
||||
NATSymmetricUDPFirewall: "Symmetric UDP firewall",
|
||||
NATError: "Test failed",
|
||||
NATUnknown: "Unexpected response from the STUN server",
|
||||
NATBlocked: "UDP is blocked",
|
||||
NATFull: "Full cone NAT",
|
||||
NATSymmetric: "Symmetric NAT",
|
||||
NATRestricted: "Restricted NAT",
|
||||
NATPortRestricted: "Port restricted NAT",
|
||||
NATNone: "Not behind a NAT",
|
||||
SymmetricUDPFirewall: "Symmetric UDP firewall",
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -112,7 +112,7 @@ func (c *Client) discover(conn net.PacketConn, addr *net.UDPAddr) (NATType, *Hos
|
||||
}
|
||||
if identical {
|
||||
if resp == nil {
|
||||
return NATSymmetricUDPFirewall, mappedAddr, nil
|
||||
return SymmetricUDPFirewall, mappedAddr, nil
|
||||
}
|
||||
return NATNone, mappedAddr, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user