C# Class Brunet.Simulator.Transport.ConeNat

Supports a very simple Cone NAT. Once the node has learned its own address and it has a stable connection to another peer, it allows inbound connections. Incoming messages are allow so long as there is an existing NAT mapping.
Inheritance: INat
Datei anzeigen Open project: pstjuste/brunet Class Usage Examples

Protected Properties

Property Type Description
_allow_inbound bool
_allowed bool>.TimeBasedCache
_external_ta Brunet.Transport.TransportAddress[]
_internal_ta Brunet.Transport.TransportAddress[]
_known_tas Brunet.Transport.TransportAddress[]

Public Methods

Method Description
ConeNat ( TransportAddress ta, int timeout ) : System.Collections
Incoming ( TransportAddress ta ) : bool
Outgoing ( TransportAddress ta ) : bool
UpdateTAs ( TransportAddress remote_ta, TransportAddress local_ta ) : void

Private Methods

Method Description
HandleEviction ( object sender, bool>.TimeBasedCache ea ) : void

If there are no more entries in the cache, our mapping has, we will no longer allow inbound connections.

Method Details

ConeNat() public method

public ConeNat ( TransportAddress ta, int timeout ) : System.Collections
ta Brunet.Transport.TransportAddress
timeout int
return System.Collections

Incoming() public method

public Incoming ( TransportAddress ta ) : bool
ta Brunet.Transport.TransportAddress
return bool

Outgoing() public method

public Outgoing ( TransportAddress ta ) : bool
ta Brunet.Transport.TransportAddress
return bool

UpdateTAs() public method

public UpdateTAs ( TransportAddress remote_ta, TransportAddress local_ta ) : void
remote_ta Brunet.Transport.TransportAddress
local_ta Brunet.Transport.TransportAddress
return void

Property Details

_allow_inbound protected_oe property

protected bool _allow_inbound
return bool

_allowed protected_oe property

protected TimeBasedCache _allowed
return bool>.TimeBasedCache

_external_ta protected_oe property

protected TransportAddress[],Brunet.Transport _external_ta
return Brunet.Transport.TransportAddress[]

_internal_ta protected_oe property

protected TransportAddress[],Brunet.Transport _internal_ta
return Brunet.Transport.TransportAddress[]

_known_tas protected_oe property

protected TransportAddress[],Brunet.Transport _known_tas
return Brunet.Transport.TransportAddress[]