Skip to content

Commit

Permalink
Merge pull request meshbird#76 from ullutau/master
Browse files Browse the repository at this point in the history
Updated to reflect recent changes in 'github.com/ccding/go-stun'
  • Loading branch information
miolini authored Aug 23, 2016
2 parents 58be16d + c61a915 commit 41a032c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions common/stun.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package common

import (
"fmt"
"time"

"github.com/ccding/go-stun/stun"
"github.com/meshbird/meshbird/log"
"time"
)

const (
Expand Down Expand Up @@ -51,23 +52,23 @@ func (s *STUNService) process() (err error) {
return err
}
switch nat {
case stun.NAT_ERROR:
case stun.NATError:
return fmt.Errorf("test failed")
case stun.NAT_UNKNOWN:
case stun.NATUnknown:
return fmt.Errorf("unexpected response from the STUN server")
case stun.NAT_BLOCKED:
case stun.NATBlocked:
return fmt.Errorf("UDP is blocked")
case stun.NAT_FULL:
case stun.NATFull:
return fmt.Errorf("full cone NAT")
case stun.NAT_SYMETRIC:
case stun.NATSymetric:
return fmt.Errorf("symetric NAT")
case stun.NAT_RESTRICTED:
case stun.NATRestricted:
return fmt.Errorf("restricted NAT")
case stun.NAT_PORT_RESTRICTED:
case stun.NATPortRestricted:
return fmt.Errorf("port restricted NAT")
case stun.NAT_NONE:
case stun.NATNone:
return fmt.Errorf("not behind a NAT")
case stun.NAT_SYMETRIC_UDP_FIREWALL:
case stun.NATSymetricUDPFirewall:
return fmt.Errorf("symetric UDP firewall")
}

Expand Down

0 comments on commit 41a032c

Please sign in to comment.