Documentation
¶
Index ¶
- Constants
- func NewRolodex(conn *net.UDPConn, sendInterval time.Duration, timeOutDuration time.Duration) (*rolodex, error)
- type HeartbeatMessage
- type MeshConn
- type MeshboiClient
- type MultiplexedDTLSConn
- type NetworkMap
- type PeerConn
- type PeerConnStore
- type PeerConnector
- type RolodexCallback
- type RolodexClient
- type Tun
- type TunConn
- type TunRouter
- type VpnMeshListenerDialer
Constants ¶
View Source
const ( IFF_TUN = 0x1 /* Flag to open a TUN device (rather than TAP) */ IFF_NO_PI = 0x1000 /* Do not provide packet information */ )
View Source
const TimeOutSecs = 30
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HeartbeatMessage ¶
type HeartbeatMessage struct {
NetworkName string
}
type MeshboiClient ¶
type MeshboiClient struct {
// contains filtered or unexported fields
}
func NewMeshBoiClient ¶
func (*MeshboiClient) Run ¶
func (mc *MeshboiClient) Run()
func (*MeshboiClient) Stop ¶
func (mc *MeshboiClient) Stop()
type MultiplexedDTLSConn ¶
type MultiplexedDTLSConn struct {
// contains filtered or unexported fields
}
MultiplexedDTLSConn represents a conn that can be used to listen for new incoming DTLS connections and also dial new UDP connections (both DTLS and non-DTLS) from the same udp address
func NewMultiplexedDTLSConn ¶
func NewMultiplexedDTLSConn(laddr *net.UDPAddr, config *dtls.Config) (*MultiplexedDTLSConn, error)
func (*MultiplexedDTLSConn) AcceptMesh ¶
func (mc *MultiplexedDTLSConn) AcceptMesh() (MeshConn, error)
type NetworkMap ¶
type PeerConn ¶
type PeerConn struct {
// contains filtered or unexported fields
}
Represents a connection to a peer
func NewPeerConn ¶
type PeerConnStore ¶
type PeerConnStore struct {
// contains filtered or unexported fields
}
func NewPeerConnStore ¶
func NewPeerConnStore() *PeerConnStore
func (*PeerConnStore) Add ¶
func (p *PeerConnStore) Add(peer *PeerConn)
func (*PeerConnStore) GetByInsideIp ¶
func (p *PeerConnStore) GetByInsideIp(insideIP netaddr.IP) (*PeerConn, bool)
func (*PeerConnStore) GetByOutsideIpPort ¶
func (p *PeerConnStore) GetByOutsideIpPort(outsideIPPort netaddr.IPPort) (*PeerConn, bool)
func (*PeerConnStore) RemoveByOutsideIPPort ¶
func (p *PeerConnStore) RemoveByOutsideIPPort(outsideIPPort netaddr.IPPort) bool
type PeerConnector ¶
type PeerConnector struct {
// contains filtered or unexported fields
}
func NewPeerConnector ¶
func NewPeerConnector(listenerDialer VpnMeshListenerDialer, store *PeerConnStore, tun TunConn) PeerConnector
func (*PeerConnector) AmServer ¶
func (pc *PeerConnector) AmServer(other netaddr.IPPort) bool
Simple comparison to see if this member should be the server or if the remote member should be
func (*PeerConnector) ListenForPeers ¶
func (pc *PeerConnector) ListenForPeers()
func (*PeerConnector) OnNetworkMapUpdate ¶
func (pc *PeerConnector) OnNetworkMapUpdate(network NetworkMap)
func (*PeerConnector) OnNewPeerConnection ¶
func (pc *PeerConnector) OnNewPeerConnection(conn MeshConn) error
func (*PeerConnector) Stop ¶
func (pc *PeerConnector) Stop()
type RolodexCallback ¶
type RolodexCallback func(member NetworkMap)
type RolodexClient ¶
type RolodexClient struct {
// contains filtered or unexported fields
}
func NewRolodexClient ¶
func NewRolodexClient(networkName string, conn net.Conn, sendRate time.Duration, callback RolodexCallback) RolodexClient
func (*RolodexClient) Run ¶
func (c *RolodexClient) Run()
func (*RolodexClient) Stop ¶
func (c *RolodexClient) Stop()
type Tun ¶
type Tun struct { io.ReadWriteCloser Name string }
func NewTunWithConfig ¶
Makes a Tun with the desired config and immediately sets it up
func (Tun) SetNetwork ¶
type TunConn ¶
type TunConn interface { io.ReadWriteCloser }
type TunRouter ¶
type TunRouter struct {
// contains filtered or unexported fields
}
func NewTunRouter ¶
func NewTunRouter(tun TunConn, store *PeerConnStore) TunRouter
type VpnMeshListenerDialer ¶
type VpnMeshListenerDialer interface { // Returns the connection and the VPN IP address on the other side AcceptMesh() (MeshConn, error) // Returns the connection and the VPN IP address on the other side DialMesh(raddr net.Addr) (MeshConn, error) Dial(raddr net.Addr) (net.Conn, error) }
VpnListenerDialer allows for:
- Dialing connections to other members in the VPN Mesh
- Accepting connections to other members in the VPN Mesh
- Dialing connections to non VPN Mesh members
Source Files
¶
Click to show internal directories.
Click to hide internal directories.