stun

package
v0.0.0-...-0951d74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

This file implements RFC5780's tests: - 4.3. Determining NAT Mapping Behavior - 4.4. Determining NAT Filtering Behavior

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTCP4MappedAddress

func GetTCP4MappedAddress(stunServer string) (localAddr string, mappedAddr string, err error)

use STUN server to create a new binding and return the local and mapped address

Types

type NATFilteringBehavior

type NATFilteringBehavior int
const (
	EndpointIndependentFiltering NATFilteringBehavior = iota + 10
	AddressDependentFiltering
	AddressAndPortDependentFiltering
	UnknownFiltering
)

func FilteringTests

func FilteringTests(addrStr string, network string) (NATFilteringBehavior, error)

RFC5780: 4.4. Determining NAT Filtering Behavior

func (NATFilteringBehavior) String

func (filtering NATFilteringBehavior) String() string

type NATMappingBehavior

type NATMappingBehavior int
const (
	NoNAT NATMappingBehavior = iota
	EndpointIndependentMapping
	AddressDependentMapping
	AddressAndPortDependentMapping
	UnknownMapping
)

func MappingTests

func MappingTests(addrStr string, network string) (NATMappingBehavior, error)

RFC5780: 4.3. Determining NAT Mapping Behavior

func (NATMappingBehavior) String

func (mapping NATMappingBehavior) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL