MakeStaticBootConfiguration creates a new StaticBootConfiguration with provided values
(httpBootURL, ipxeBootURL string, preference uint8, usePreference bool, dnsServerAddresses []net.IP)
| 23 | |
| 24 | // MakeStaticBootConfiguration creates a new StaticBootConfiguration with provided values |
| 25 | func MakeStaticBootConfiguration(httpBootURL, ipxeBootURL string, preference uint8, usePreference bool, |
| 26 | dnsServerAddresses []net.IP) *StaticBootConfiguration { |
| 27 | ret := &StaticBootConfiguration{HTTPBootURL: []byte(httpBootURL), IPxeBootURL: []byte(ipxeBootURL), UsePreference: usePreference} |
| 28 | if usePreference { |
| 29 | ret.Preference = make([]byte, 1) |
| 30 | ret.Preference[0] = preference |
| 31 | } |
| 32 | ret.RecursiveDNS = dnsServerAddresses |
| 33 | return ret |
| 34 | } |
| 35 | |
| 36 | // GetBootURL returns Boot File URL, see RFC 5970 |
| 37 | func (bc *StaticBootConfiguration) GetBootURL(id []byte, clientArchType uint16) ([]byte, error) { |