Documentation
¶
Index ¶
- Constants
- Variables
- func DebugSSHPortForIP(ip net.IP) (int, error)
- func DockerHandler(d *DockerPlugin, fn func(*DockerPlugin, http.ResponseWriter, *http.Request)) http.HandlerFunc
- func DumpIPTables() string
- func EqualNetSlice(slice1, slice2 []string) bool
- func Routing(action FwAction) error
- func WipeDockerPluginDB() error
- type APIError
- type Attrs
- type Bridge
- type CNContainerEvent
- type CNSsntpEvent
- type CnAPICtx
- type Cnci
- func (cnci *Cnci) AddRemoteSubnet(subnet net.IPNet, subnetKey int, cnIP net.IP) (string, error)
- func (cnci *Cnci) DelRemoteSubnet(subnet net.IPNet, subnetKey int, cnIP net.IP) error
- func (cnci *Cnci) Init() error
- func (cnci *Cnci) RebuildTopology() error
- func (cnci *Cnci) Shutdown() error
- func (cnci *Cnci) UpdateNeighbors(neighbors []Neighbor) error
- type CnciVnic
- type ComputeNode
- func (cn *ComputeNode) CreateCnciVnic(cfg *VnicConfig) (*CnciVnic, error)
- func (cn *ComputeNode) CreateVnic(cfg *VnicConfig) (*Vnic, *SsntpEventInfo, *ContainerInfo, error)
- func (cn *ComputeNode) DbRebuild(links []netlink.Link) error
- func (cn *ComputeNode) DestroyCnciVnic(cfg *VnicConfig) error
- func (cn *ComputeNode) DestroyVnic(cfg *VnicConfig) (*SsntpEventInfo, *ContainerInfo, error)
- func (cn *ComputeNode) Init() error
- func (cn *ComputeNode) ResetNetwork() error
- type ContainerInfo
- type DhcpEntry
- type Dnsmasq
- type DockerEpMap
- type DockerEpVal
- type DockerNwMap
- type DockerNwVal
- type DockerPlugin
- type FatalError
- type Firewall
- func (f *Firewall) ExtFwding(action FwAction, extDevice string, intDevice string) error
- func (f *Firewall) ExtPortAccess(action FwAction, protocol string, extDevice string, externalPort int, ...) error
- func (f *Firewall) PublicIPAccess(action FwAction, internalIP net.IP, publicIP net.IP, extInterface string) error
- func (f *Firewall) ShutdownFirewall() error
- type FwAction
- type GreTapEP
- type GreTunEP
- type Neighbor
- type Network
- type NetworkConfig
- type NetworkMode
- type SsntpEventInfo
- type Vnic
- func (v *Vnic) Attach(dev interface{}) error
- func (v *Vnic) Create() error
- func (v *Vnic) Destroy() error
- func (v *Vnic) Detach(dev interface{}) error
- func (v *Vnic) Disable() error
- func (v *Vnic) Enable() error
- func (v *Vnic) GetDevice() error
- func (v *Vnic) GetDeviceByName(linkName string) error
- func (v *Vnic) InterfaceName() string
- func (v *Vnic) PeerName() string
- func (v *Vnic) SetHardwareAddr(addr net.HardwareAddr) error
- func (v *Vnic) SetMTU(mtu int) error
- type VnicAttrs
- type VnicConfig
- type VnicRole
Constants ¶
const (
CnAPITimeout = 6
)
CnAPITimeout default controls the API timeout
const (
MACPrefix = "02:00" //Prefix for all private MAC addresses
)
Various configuration options
Variables ¶
var CnMaxAPIConcurrency = 8
CnMaxAPIConcurrency default controls internal API concurrency. It determines how many API's are being actively processed. Can be over-ridden prior to init.
var DockerPluginCfg = struct { Name string Dir string Addr string DataDir string DbFile string Timeout time.Duration }{ Name: "ciao", Dir: "/etc/docker/plugins", Addr: "127.0.0.1:9999", DataDir: "/var/lib/ciao/networking", DbFile: "docker_plugin.db", Timeout: 1 * time.Second, }
DockerPluginCfg controls plugin attributes these may be overridden by the caller if needed
var Logger = clogger.CiaoLog(clogger.CiaoNullLogger{})
Logger is a global variable exported to be set by the package importing libsnnet package, in order to let it decide which logger it wants to use.
Functions ¶
func DebugSSHPortForIP ¶
DebugSSHPortForIP provides a utility routine that returns the ssh port on the tenant CNCI that can be used to reach a tenant instance with a given IP address
func DockerHandler ¶
func DockerHandler(d *DockerPlugin, fn func(*DockerPlugin, http.ResponseWriter, *http.Request)) http.HandlerFunc
DockerHandler is the default handler for unhandled events It returns error to the caller
func DumpIPTables ¶
func DumpIPTables() string
DumpIPTables provides a utility routine that returns the current state of the iptables
func EqualNetSlice ¶
EqualNetSlice compare 2 network slices
func Routing ¶
Routing enable or disables routing echo 0 > /proc/sys/net/ipv4/ip_forward echo 1 > /proc/sys/net/ipv4/ip_forward
Types ¶
type APIError ¶
type APIError struct {
// contains filtered or unexported fields
}
APIError indicates that the networking call failed. However the system is still consistent and the networking layer has performed appropriate cleanup
type Attrs ¶
type Attrs struct {
LinkName string // Locally unique device name
TenantID string // UUID of the tenant the device belongs to
// Auto generated. Combination of UUIDs and other params.
// Typically assigned to the alias
// It is both locally and globally unique
// Fully qualifies the device and its role
GlobalID string
MACAddr *net.HardwareAddr
}
Attrs contains fields common to all device types
type Bridge ¶
Bridge represents a ciao Bridge
func NewBridge ¶
NewBridge is used to initialize the bridge properties This has to be called prior to Create() or GetDevice()
func (*Bridge) AddIP ¶
AddIP Adds an IP Address to the bridge
func (*Bridge) DelIP ¶
DelIP Deletes an IP Address assigned to the bridge