Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( PxeLinuxCfgPattern = `^pxelinux.cfg/01-(?P<mac>([0-9a-f]{2}-){5}[0-9a-f]{2})$` GrubCfgPattern = `grub/grub.cfg-01-(?P<mac>([0-9a-f]{2}-){5}[0-9a-f]{2})$` )
Functions ¶
This section is empty.
Types ¶
type Architecture ¶
type Architecture int
Architecture describes a kind of CPU architecture
const ( // ArchIA32 is a 32-bit x86 machine. It may also support X64 // execution, but pxe has no way of kowning. ArchIA32 Architecture = iota // ArchX64 is a 64-bit x86 machine (aka amd64 aka x64) ArchX64 ArchUnknown )
Architecture types that pxe knows how to boot These architectures are self-reported by the booting machine. The machine may support additional execution mode. For example, legacy PC BIOS reports itself as an ArchIA32, but may also support ArchX64 execution
func (Architecture) String ¶
func (a Architecture) String() string
type DHCPHandler ¶
type DHCPHandler struct {
// contains filtered or unexported fields
}
type Firmware ¶
type Firmware int
Firmware describes a kind of firmware attempting to boot. This should only be used for selecting the right bootloader within pxe, kernel selection should key off the more generic Architecture
const ( FirmwareX86PC Firmware = iota // "Classic" x86 BIOS with PXE/UNDI support FirmwareEFI32 // 32-bit x86 processor running EFI FirmwareEFI64 // 64-bit x86 processor running EFI FirmwareEFIBC // 64-bit x86 processor running EFI FirmwareX86Ipxe // "Classic" x86 BIOS running iPXE (no UNDI support) FirmwareUnknown )
The bootloaders that pxe knows how to handle
type IBaremetalInstance ¶
type IBaremetalInstance interface { NeedPXEBoot() bool GetIPMINic(cliMac net.HardwareAddr) *types.SNic GetPXEDHCPConfig(arch uint16) (*dhcp.ResponseConfig, error) GetDHCPConfig(cliMac net.HardwareAddr) (*dhcp.ResponseConfig, error) InitAdminNetif(ctx context.Context, cliMac net.HardwareAddr, wireId string, nicType compute.TNicType, netType computeapi.TNetworkType, isDoImport bool, ipAddr string) error RegisterNetif(ctx context.Context, cliMac net.HardwareAddr, wireId string) error GetTFTPResponse() string }
type IBaremetalManager ¶
type IBaremetalManager interface { GetZoneId() string GetBaremetalByMac(mac net.HardwareAddr) IBaremetalInstance AddBaremetal(ctx context.Context, desc jsonutils.JSONObject) (IBaremetalInstance, error) GetClientSession() *mcclient.ClientSession }
type Machine ¶
type Machine struct { MAC net.HardwareAddr Arch Architecture }
A Machine describes a machine that is attempting to boot
type NetworkInterfaceIdent ¶
type Server ¶
type TFTPHandler ¶
type TFTPHandler struct { RootDir string BaremetalManager IBaremetalManager }
func NewTFTPHandler ¶
func NewTFTPHandler(rootDir string, baremetalManager IBaremetalManager) (*TFTPHandler, error)
func (*TFTPHandler) Handle ¶
func (h *TFTPHandler) Handle(filename string, clientAddr net.Addr) (io.ReadCloser, int64, error)
Handle is called when client starts file download from server