Documentation ¶
Index ¶
- Variables
- func AssertPrivatIP(ip net.IP) bool
- func CheckNatTypeWithPublic(port int) (nattype enode.NATType)
- func CheckNatTypeWithYou(port int) enode.NATType
- func GenerateKey() (*ecdsa.PrivateKey, error)
- func IPv4ToInt(ip net.IP) int
- func IntToIPv4(num int) net.IP
- type NATClient
- type NATConn
- type NATService
- type StatusStep
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NatPublicService string NatMasterAddr string NatSlaveAddr string )
View Source
var (
Version uint = 1
)
Functions ¶
func AssertPrivatIP ¶
func CheckNatTypeWithPublic ¶
func CheckNatTypeWithYou ¶
func GenerateKey ¶
func GenerateKey() (*ecdsa.PrivateKey, error)
Types ¶
type NATClient ¶
type NATClient struct {
// contains filtered or unexported fields
}
func NewNATClient ¶
func NewNATClient(priv *ecdsa.PrivateKey, master, slave *net.UDPAddr) *NATClient
func NewNATClientAssignPort ¶
type NATService ¶
type NATService struct {
// contains filtered or unexported fields
}
func NewNATService ¶
func NewNATService(privateKey *ecdsa.PrivateKey, masterAddr, slaveAddr *net.UDPAddr) *NATService
func (*NATService) Close ¶
func (nat *NATService) Close()
func (*NATService) Start ¶
func (nat *NATService) Start()
type StatusStep ¶
type StatusStep uint8
var ( // Step 1, Check whether the client is capable of UDP communication and is behind a NAT Step1 StatusStep = 0x01 // Step 2, Check whether the client NAT is Full Cone NAT Step2 StatusStep = 0x02 // Step 3, Check whether the client NAT is symmetric NAT Step3 StatusStep = 0x03 // Step 4, Check whether the client NAT is Restricted Cone NAT Step4 StatusStep = 0x04 // Step 5, Check whether the client NAT Port Restricted Cone NAT Step5 StatusStep = 0x05 // Step 6, finished Step6 StatusStep = 0x06 )
Click to show internal directories.
Click to hide internal directories.