2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-05-01 01:15:55 +00:00

36 Commits

Author SHA1 Message Date
Jarrod Johnson
ea537b1a1f Add branch to support legacy
Legacy boot gets into ipxe
through a kkpxe executable.
2020-04-02 09:41:17 -04:00
Jarrod Johnson
bc7dc50388 Switch filename for iPXE
This offers the real iPXE script to
ipxe.
2020-04-01 17:19:23 -04:00
Jarrod Johnson
2da5bebf46 Fix iPXE recognition of our offer
iPXE requires that next-server
be set, unlike UEFI firmware
which did not care.
2020-04-01 16:59:43 -04:00
Jarrod Johnson
0fe136d4ee Extend a proxydhcpack
This is one stage of actually
providing download over
PXE.
2020-04-01 16:40:47 -04:00
Jarrod Johnson
96b5d3aa91 Actually populate the file field
Thankfully, it turns out that HTTPBoot carries the same flexibility
as PXE with respect to no-ip answer being merged with an IP answer.

As a bonus, it actually is simpler than PXE, allowing skipping of udp
port 4011.  Of course, we still want to support PXE boot, so that will
need to be implemented.
2020-03-27 16:17:51 -04:00
Jarrod Johnson
44836cabbe Prepare for http boot
HTTP boot does not seem to support proxy dhcp.
2020-03-27 10:56:38 -04:00
Jarrod Johnson
92e657b987 Fix UDP checksum of odd-length packets
Odd length packets were incorrectly handled, fix
the packet construction.
2020-03-26 16:59:58 -04:00
Jarrod Johnson
0c96882fda Restore Python 3 compatibility for pxe
The changes accidentally broke python 3, make a
bytes explicit to fix.
2020-03-24 17:54:07 -04:00
Jarrod Johnson
00681489c7 Add python2 compatibility to pxe
Various facets of pxe.py were python3-only,
make it compatible with python2 for now.
2020-03-24 17:26:39 -04:00
Jarrod Johnson
8c2336b8fa Implemennt static when no DHCP
This permits an offer for a nominally static
node, unless it either doesn't map to an IP or
has dhcp method explicitly declared.
2020-03-24 15:09:28 -04:00
Jarrod Johnson
f0e5572b05 Remove filename from DHCP reply
filename is ignored if pxeclient anyway.  This will provide a
consistent approach for boot file for dhcp-elsewhere and
fixed ip clients alike.

Also add some TODO about how to enable DHCPREQUEST
processing when the time comes, as today the code skipping
option parsing for DISCOVER packets trips up the ability
to continue.  We must make sure we don't call discovery
handler again for REQUEST after doing so for DISCOVER.
2020-03-20 17:57:04 -04:00
Jarrod Johnson
895216d94f Setting PXEClient in option 60
This trigges the proxyDHCP sequence to follow up.
2020-03-20 17:40:29 -04:00
Jarrod Johnson
1c7c897267 Add option 97 (UUID) to OFFER
Per PXE specification, this is among the required fields.
2020-03-20 17:23:33 -04:00
Jarrod Johnson
20a26e6fdb Implement the UDP checksum
As long as we are doing UDP and IP in house, might as well do the
optional UDP checksum.
2020-03-20 16:55:20 -04:00
Jarrod Johnson
fcd73399fa Add IP and UDP header to OFFER attempt
It d oesn't quite work, but it looks convincing.  UDP checksum may
need to be added, and beyond that explore changes to the payload since
it is likely not enough DHCP was provided.
2020-03-19 18:39:32 -04:00
Jarrod Johnson
b7d85b2166 Switch to ctypes for sendto
First, IP level sendto doesn't give the freedom to send 25.255.255.255
out of the interface desired.  So have to go link layer.

Second, while python can do sendto, we have the interface index number
from recvmsg (which was ctypes).  python expects the name instead
(wwhich it promptly turns... back into the index we start with).  I
could have added code to get the name using some syscalls which would
have been work and produced more system calls, or added the code to
directly use sendto, which would also be efficient at runtime.

So I chose to use ctypes for both recvmsg and sendto here.
2020-03-19 16:20:47 -04:00
Jarrod Johnson
22de1153c2 Continue draft of PXE support
It is able to vaguely construct a DHCPOFFER now, though it doesn't go
the right way for starters.
2020-03-18 17:12:26 -04:00
Jarrod Johnson
517101f596 Reduce spurious logging
When ignoring DHCPREQUEST,
do not log, since DISCOVER
was enough logging.
2020-03-12 18:08:48 -04:00
Jarrod Johnson
1bfc949466 Add message when insecure is needed
Practically speaking, this will be only choice for most people, but we
must make sure that the user acknowledges the risk.
2020-03-12 17:42:56 -04:00
Jarrod Johnson
57ff9808c4 Fix infinite loop in DHCP parsing
Accidentally failed to actually traverse
the data.
2020-03-11 15:43:34 -04:00
Jarrod Johnson
0f67f5c382 Draft attempt at refactoring PXE
The plan is to have 'discovery'
data only on DISCOVER, but
still parse and be able to react to
REQUEST packets.

Additionally add the attributes
to control deployment state and
permissible protocols.
2020-03-11 15:22:45 -04:00
Jarrod Johnson
9ea9188fdf Get closer to replying to PXE
Monitor and maintain a uuid and
mac map to node in preparation for
efficient handling of
DISCOVERs/REQUESTS from
ONIE and/or PXE.
2020-03-10 11:16:59 -04:00
Jarrod Johnson
597393842a Add transaction ID to the carried information
The ability to extend an OFFER requires that we also keep track
of the transaction id.
2020-03-09 15:30:26 -04:00
Jarrod Johnson
b9fc9b3c19 Put the recvmsg info into the handler payload
This allows the rest of the discovery infrastructure to operate
with this data.
2020-03-09 15:14:05 -04:00
Jarrod Johnson
49b8e12a01 Update TODO
We have now done IP_PKTINFO, but there is a potential TODO
if wanting to properly honor unicast request.

For now, will just do always-broadcast as the options to do unicast
are more complex to do (either construct the packets or inject neigh
entry manually)
2020-03-09 15:05:19 -04:00
Jarrod Johnson
f20fb70336 Have the peer and target info on DHCP receive
This has the data that will be handy in formulating a reply.
2020-03-09 14:39:53 -04:00
Jarrod Johnson
934f8f0f20 Use recvmsg for PXE
Switch to recvmsg in preparation for getting more
data for forming replies.
2020-03-09 11:25:38 -04:00
Jarrod Johnson
e2d0e49fc7 Add HTTP boot architecture to pxe
This paves the way for future response to HTTP boot
2020-02-20 20:36:36 -05:00
Jarrod Johnson
eae7b3bd80 Add discovery snoop for Cumulus ZTP
When a cumulus switch does ZTP, detect
in the discovery facility.
2020-02-19 16:26:33 -05:00
Jarrod Johnson
868367e052 Add sensing of ONIE switches
Have nodediscover show detected
ONIE install devices.
2020-02-19 15:20:45 -05:00
Jarrod Johnson
bfbde0f7f3 Fix PXE protocol processing under python3 2019-10-11 13:36:16 -04:00
Jarrod Johnson
90e546bcac Implement a number of py3 compatible adjustments 2019-10-02 08:58:39 -04:00
Jarrod Johnson
39839a9f2a Add auto-healing of incomplete SLP data
If a device handler indicates an SLP data as incomplete, schedule a
attempt to fixup that specific one.
2018-11-13 15:37:41 -05:00
Jarrod Johnson
48b9d735f2 Avoid empty hwaddr
It has been observed, at least once, for an empty hwaddr to appear.
Take measures to prevent this from occurring and making into the
discovery info.
2018-01-19 10:22:22 -05:00
Jarrod Johnson
68c7ab4c90 Add ability to group discovery by uuid
API adds 'by-uuid', which helps group BMC and PXE together to make
relationship clear.
2017-08-23 15:41:16 -04:00
Jarrod Johnson
f4267e6013 Add missing files from the ThinkSystem merge 2017-06-21 14:02:59 -04:00