virtdhcp

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DNSmasqExec = "/usr/sbin/dnsmasq"
	DHCPPidFile = "/tmp/dhcp.pid"
)

Variables

View Source
var DHCPHostsFile = "/var/run/kubevirt/dhcp.hosts"
View Source
var DHCPLeaseFile = "/var/run/kubevirt/dhcp.leases"
View Source
var DhcpSocket string

Functions

func Run

func Run(socket string) error

Types

type AddArgs

type AddArgs struct {
	IP    string
	Mac   string
	Lease int
}

type DHCP

type DHCP struct {
	// contains filtered or unexported fields
}

func (*DHCP) AddIP

func (s *DHCP) AddIP(args *AddArgs, reply *DhcpReply) error

func (*DHCP) RemoveIP

func (s *DHCP) RemoveIP(args *RemoveArgs, reply *DhcpReply) error

func (*DHCP) SetIPs

func (s *DHCP) SetIPs(args *[]AddArgs, reply *DhcpReply) error

type DNSmasqInstance

type DNSmasqInstance struct {
	// contains filtered or unexported fields
}

func NewDNSmasq

func NewDNSmasq() *DNSmasqInstance

func (*DNSmasqInstance) AddHost

func (dnsmasq *DNSmasqInstance) AddHost(mac string, ipaddr string, lease int) error

func (*DNSmasqInstance) RemoveHost

func (dnsmasq *DNSmasqInstance) RemoveHost(ipaddr string) error

func (*DNSmasqInstance) Restart

func (dnsmasq *DNSmasqInstance) Restart() error

func (*DNSmasqInstance) SetKnownHosts

func (dnsmasq *DNSmasqInstance) SetKnownHosts(hostsList *[]AddArgs) error

type DhcpReply

type DhcpReply struct {
	Message string
	Success bool
}

type Monitor

type Monitor interface {
	Start(cmd string, args []string)
	Stop()
}

func NewMonitor

func NewMonitor() Monitor

type MonitorRuntime

type MonitorRuntime struct {
	// contains filtered or unexported fields
}

func (*MonitorRuntime) Start

func (runtime *MonitorRuntime) Start(cmd string, args []string)

func (*MonitorRuntime) Stop

func (runtime *MonitorRuntime) Stop()

type OSHandler

type OSHandler struct{}

type OSOps

type OSOps interface {
	// contains filtered or unexported methods
}
var OS OSOps

type RemoveArgs

type RemoveArgs struct {
	IP  string
	Mac string
}

type VirtDHCPClient

type VirtDHCPClient struct {
	// contains filtered or unexported fields
}

func GetClient

func GetClient() (*VirtDHCPClient, error)

func (*VirtDHCPClient) AddIP

func (dhcp *VirtDHCPClient) AddIP(mac string, ip string, lease int) error

func (*VirtDHCPClient) RemoveIP

func (dhcp *VirtDHCPClient) RemoveIP(mac string, ip string) error

func (*VirtDHCPClient) SetIPs

func (dhcp *VirtDHCPClient) SetIPs(hosts *[]AddArgs, reply *DhcpReply) error

Jump to

Keyboard shortcuts

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