models

package
v0.0.0-...-723dd0c Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	P2P_Port     int             `json:"p2p_port"`
	P2P_Hostname string          `json:"p2p_hostname"`
	PrivateKey   *rsa.PrivateKey `json:"private_key"`
	PublicKey    *rsa.PublicKey  `json:"public_key"`
}

Model used to parse all necessary information out of an config.ini file TODO: Adapt later to actual config file, now just testing

type ConfirmTunnelConstruction

type ConfirmTunnelConstruction struct {
	Port               uint16
	TunnelID           uint32
	DestinationHostkey []byte
	PublicKey          []byte
}

type ConfirmTunnelInstruction

type ConfirmTunnelInstruction struct {
	TunnelID uint32
	Data     []byte
}

type ConstructTunnel

type ConstructTunnel struct {
	NetworkVersion     string
	OnionPort          uint16
	TCPPort            uint16
	TunnelID           uint32
	DestinationAddress string
	DestinationHostkey []byte
	OriginHostkey      []byte
	PublicKey          []byte
}

type CryptoObject

type CryptoObject struct {
	TunnelId   uint32        `json:"tunnel_id"`
	PrivateKey *dhkx.DHKey   `json:"tunnel_id"`
	PublicKey  []byte        `json:"tunnel_id"`
	SessionKey []byte        `json:"tunnel_id"`
	Group      *dhkx.DHGroup `json:"tunnel_id"`
}

type DataConfirmTunnelConstruction

type DataConfirmTunnelConstruction struct {
	DestinationHostkey []byte
	PublicKey          []byte
}

type DataConstructTunnel

type DataConstructTunnel struct {
	NetworkVersion     string
	DestinationAddress string
	Port               uint16
	DestinationHostkey []byte
	PublicKey          []byte
}

type ExchangeKey

type ExchangeKey struct {
	TunnelID           uint32
	DestinationHostkey []byte
	PublicKey          []byte
}

type OnionCover

type OnionCover struct {
	CoverSize uint16
	Reserved  uint16
}

type OnionError

type OnionError struct {
	RequestType uint16
	Reserved    uint16
	TunnelID    uint32
}

type OnionTunnelBuild

type OnionTunnelBuild struct {
	NetworkVersion     string
	Port               uint16
	DestinationAddress string
	DestinationHostkey []byte
}

type OnionTunnelData

type OnionTunnelData struct {
	TunnelID uint32
	Data     []byte
}

type OnionTunnelDestroy

type OnionTunnelDestroy struct {
	TunnelID uint32
}

type OnionTunnelIncoming

type OnionTunnelIncoming struct {
	TunnelID uint32
}

type OnionTunnelReady

type OnionTunnelReady struct {
	TunnelID           uint32
	DestinationHostkey []byte
}

type OnionTunnelTrafficJam

type OnionTunnelTrafficJam struct {
	TunnelID uint32
	Data     []byte
}

type Peer

type Peer struct {
	TCPListener      *net.TCPListener          `json:"tcp_listener"`
	UDPListener      *net.UDPConn              `json:"udp_listener"`
	UDPPort          int                       `json:"udp_port"`
	P2P_Port         int                       `json:"p2p_port"`     // This is the Port for the TCP port
	P2P_Hostname     string                    `json:"p2p_hostname"` // This is the ip address of the peer
	PrivateKey       *rsa.PrivateKey           `json:"private_key"`
	PublicKey        *rsa.PublicKey            `json:"public_key"`
	UDPConnections   map[uint32]*UDPConnection `json:"udp_connections"`
	TCPConnections   map[uint32]*TCPConnection `json:"tcp_writers"`
	CryptoSessionMap map[string]*CryptoObject  `json:"crypto_session_map"`
	TunnelHostOrder  map[uint32]*list.List     `json:"tunnel_host_order"` // Save all hashed hostkey of a tunnel connection ordered in a list
}

TODO: Discuss wether to define it here or to define in it in the service packe >> Downside here is that calling with Peer as caller isn't possible Peer is the standard object for a running peer that is accepting connections

type RPSPeer

type RPSPeer struct {
	NetworkVersion     string
	OnionPort          uint16
	DestinationAddress string
	PeerHostkey        []byte
}

type TCPConnection

type TCPConnection struct {
	TunnelId         uint32            `json:"tunnel_id"`
	LeftWriter       *TCPWriter        `json:"left_writer"`
	RightWriter      *TCPWriter        `json:"right_writer"`
	FinalDestination *OnionTunnelBuild `json:"final_destination"`
	OriginHostkey    []byte            `json:"origin_hostkey"`
}

Identify by id in hashmap

type TCPWriter

type TCPWriter struct {
	DestinationIP   string   `json:"destination_ip"`
	DestinationPort int      `json:"destination_port"`
	TCPWriter       net.Conn `json:"tcp_writer"`
}

type TunnelInstruction

type TunnelInstruction struct {
	TunnelID uint32
	Data     []byte
}

type UDPConnection

type UDPConnection struct {
	TunnelId    uint32   `json:"tunnelId"`
	LeftHost    string   `json:"left_host"`
	LeftPort    int      `json:"left_port"`
	RightHost   string   `json:"right_host"`
	RightPort   int      `json:"right_port"`
	LeftWriter  net.Conn `json:"left_writer"`
	RightWriter net.Conn `json:"right_writer"`
}

Jump to

Keyboard shortcuts

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