Documentation
¶
Index ¶
- Constants
- Variables
- func FindEmptyRange() (net.IP, *net.IPNet, error)
- func GetProxyPairInfo() []string
- func NetAttach(stn *SandboxNetwork, htn *HostNetwork, childPid int) error
- func NetInit(stn *SandboxNetwork, htn *HostNetwork, log *logging.Logger) error
- func NetPrint(log *logging.Logger)
- func NetReconfigure(stn *SandboxNetwork, htn *HostNetwork, childPid int, log *logging.Logger) error
- func NetSetup() error
- func ProxySetup(childPid int, ozSockets []ProxyConfig, log *logging.Logger, ...) error
- type Bridges
- type HostNetwork
- type IPRange
- type NetType
- type OzBridge
- type OzVeth
- type PConnInfo
- type ProtoType
- type ProxyConfig
- type ProxyPair
- type ProxyType
- type SandboxNetwork
Constants ¶
View Source
const ReceiverSocketPath = "/tmp/fwoz.sock"
Variables ¶
View Source
var PairLock = &sync.Mutex{}
View Source
var ProxyPairs []*ProxyPair
Functions ¶
func GetProxyPairInfo ¶
func GetProxyPairInfo() []string
func NetAttach ¶
func NetAttach(stn *SandboxNetwork, htn *HostNetwork, childPid int) error
func NetInit ¶
func NetInit(stn *SandboxNetwork, htn *HostNetwork, log *logging.Logger) error
func NetReconfigure ¶
func NetReconfigure(stn *SandboxNetwork, htn *HostNetwork, childPid int, log *logging.Logger) error
func NetSetup ¶
func NetSetup() error
Setup the networking inside the child Namely setup the loopback interface and the veth interface if requested
func ProxySetup ¶
Types ¶
type Bridges ¶
type Bridges struct {
// contains filtered or unexported fields
}
Bridges manages the creation of bridges for sandbox bridged networking
func NewBridges ¶
func (*Bridges) GetBridgeMap ¶
func (*Bridges) Reconfigure ¶
type HostNetwork ¶
type HostNetwork struct {
// Bridge interface
Interface tenus.Bridger
// Gateway ip (bridge ip)
Gateway net.IP
// Gateway ip (bridge ip)
GatewayNet *net.IPNet
// Bridge netmask
Netmask net.IP
// Broadcast ip
Broadcast net.IP
// IP class (ie: /24)
Class string
// Minimum longip available ip
Min uint64
// Maximum longip available ip
Max uint64
// Bridge interface MAC Address
BridgeMAC string
// The type of network configuration
Nettype NetType
//
IpBytes []uint
Name string
// contains filtered or unexported fields
}
func BridgeInit ¶
func NewHostNetwork ¶
func NewHostNetwork(name string, log *logging.Logger) *HostNetwork
func (*HostNetwork) BridgeReconfigure ¶
func (htn *HostNetwork) BridgeReconfigure() (*HostNetwork, error)
func (*HostNetwork) Initialize ¶
func (hn *HostNetwork) Initialize() error
type IPRange ¶
IPRange represents a subnet range from which individual IP addresses can be allocated
type OzBridge ¶
type OzBridge struct {
tenus.Bridger // Bridge instance
Name string // Name of bridge
// contains filtered or unexported fields
}
OzBridge represents a single bridge used for sandbox bridged networking
type OzVeth ¶
type OzVeth struct {
tenus.Vether // The pair of veth interfaces
// contains filtered or unexported fields
}
OzVeth is a pair of Veth interfaces
func (*OzVeth) GetSandboxIP ¶
func (*OzVeth) GetVethBridge ¶
func (*OzVeth) RemoveFWRules ¶
type ProxyConfig ¶
type ProxyConfig struct {
// One of client, server
Nettype ProxyType `json:"type"`
// One of tcp, udp, socket
Proto ProtoType
// TCP or UDP port number
Port int
// Destination port number
DPort int
// Optional: Destination address
// In client mode: the host side address to connect to
// In server mode: the sandbox side address to bind to
// For unix sockets this is an abstract path
// If left empty, localhost is used
Destination string
}
Socket list, used to hold ports that should be forwarded
type SandboxNetwork ¶
type SandboxNetwork struct {
// veth interface is present
Interface tenus.Linker
// Name of the veth in the host
VethHost string
// Temporary name of the guest' veth in the host
VethGuest string
// Guest ip address
Ip string
// Gateway ip (bridge ip)
Gateway net.IP
// IP class (ie: /24)
Class string
// The type of network configuration
Nettype NetType
// Host side virtual interface
Veth tenus.Vether
//
IpByte uint
}
func PrepareSandboxNetwork ¶
func PrepareSandboxNetwork(stn *SandboxNetwork, htn *HostNetwork, staticByte uint, log *logging.Logger) (*SandboxNetwork, error)
func (*SandboxNetwork) Cleanup ¶
func (stn *SandboxNetwork) Cleanup(log *logging.Logger)
Click to show internal directories.
Click to hide internal directories.