Michael Brown
af303db75d
Use RFC4390 whenever hardware address exceeds 16 bytes; this allows us
to construct DHCP packets suitable for Infiniband.
před 17 roky
Holger Lubitz
9386263433
use malloc attribute
před 17 roky
Michael Brown
0acb016840
Add FEATURE() macro, plus code to display features at startup time,
and generate DHCP options to indicate features to DHCP server (and to
PXE NBPs).
před 17 roky
Michael Brown
79691961ba
Add identifier for the network device into the DHCP request.
před 17 roky
Michael Brown
5e26df0325
Centralise construction of the DHCP request and response packets.
před 17 roky
Michael Brown
3e1dd0772a
Fix typo that was preventing any DHCP option applicators from being
applied.
před 17 roky
Michael Brown
934b70d62c
Apply global DHCP options when register_dhcp_options() is called. Do
not apply DHCP options in dhcp_configure_netdev().
před 17 roky
Michael Brown
1567b69895
Add concept of DHCP option applicators.
před 17 roky
Michael Brown
acd598b4f9
Don't build option-overloaded packets; they just confuse people (ISC
DHCPD and Windows RIS in particular).
před 17 roky
Michael Brown
1ec7bb789d
Add dhcp_configure_netdev()
před 17 roky
Michael Brown
07dc294de8
Update DHCP to use data-xfer interface (not yet tested).
před 17 roky
Michael Brown
f77815f2b1
Kill off hotplug.h and just make net devices normal reference-counted
structures.
DHCP still broken and #if 0'd out.
před 17 roky
Anselm Martin Hoffmeister
ed7dc02a95
hoffmeis: Preparations for syslog support (LOGSERVER in DHCP, linewise
output buffering defintions and the like)
před 18 roky
Michael Brown
4e20d73bb5
Gave asynchronous operations approximate POSIX signal semantics. This
will enable us to cascade async operations, which is necessary in order to
properly support DNS. (For example, an HTTP request may have to redirect
to a new location and will have to perform a new DNS lookup, so we can't
just rely on doing the name lookup at the time of parsing the initial
URL).
Anything other than HTTP is probably broken right now; I'll fix the others
up asap.
před 18 roky
Michael Brown
7fafa89258
A DHCP session holds a persistent reference to a network device
před 18 roky
Michael Brown
6a91a03409
Added options listed in
http://www.microsoft.com/whdc/winlogo/hwrequirements.mspx as required
for iSCSI boot. Note that options 204-206 are listed in the document
but don't seem to be defined anywhere on the web.
před 18 roky
Michael Brown
74c41fac06
Create "username" and "password" DHCP options, ready for placing this
information in NVS.
před 18 roky
Michael Brown
cab3f4502b
Correct option number for DHCP_DNS_SERVERS, and add it to the request
list.
před 18 roky
Michael Brown
e9561aafc0
Derive xid dynamically from the netdev, so that we can call
create_dhcp_packet() from pxe_preboot.c, after the dhcp_session is long
gone.
Expose the functions required by pxe_preboot.c
před 18 roky
Michael Brown
b26806cf18
Add dhcp_snprintf() for extracting DHCP string options.
před 18 roky
Michael Brown
7ca8bcd98c
Print out the lease time, just to show how easy it is.
před 18 roky
Michael Brown
00a1f000b1
Added dhcp_ipv4_option() and friends.
Added test code to configure the interface for IPv4 after DHCP.
před 18 roky
Michael Brown
7ca1bb0fbe
Now successfully negotiates the whole DHCPDISCOVER/OFFER/REQUEST/ACK
cycle. :)
před 18 roky
Michael Brown
224529d8dd
Now capable of sending what, to me, looks like a valid DHCPDISCOVER
(apart from the bad UDP checksum).
před 18 roky
Michael Brown
6d9d48537e
Added some debug messages and DHCP test code
před 18 roky
Michael Brown
317b962b65
Proof of concept: transmit a single DHCPDISCOVER and dump out any
parsed DHCP responses.
před 18 roky
Michael Brown
bf0cdd42cf
Add some DHCP options that we are likely to use
před 18 roky
Michael Brown
b8d619e822
Added macros for generating static DHCP options
před 18 roky
Michael Brown
254fe6e00e
Split DHCP packet creation into two parts: creating the basic packet
structure, and populating it with options. This should allow us to
use the same basic options list for both DHCPDISCOVER and DHCPREQUEST,
plus making it much easier to set the non-constant parameters
(e.g. requested IP address) in request packets.
před 18 roky
Michael Brown
e40ebb67de
Allow for calling find_dhcp_option() with "options" set to NULL, in order
to search through all registered option blocks.
Move some static inlines that are likely to be used frequently into
dhcpopts.c as normal functions, to save space.
před 18 roky
Michael Brown
6c01d3bb95
Fix creation of the htype field; the ll_proto field from which it is
derived is a 16-bit big-endian field, but htype is only 8 bits wide.
před 18 roky
Michael Brown
b24947f0c0
Add sketch code to reassemble a DHCP packet from our internal "everything
is a DHCP option" data structures.
We need this code in order to be able to return a DHCP packet to a PXE NBP
which reflects options from our multiple sources (e.g. NVS and DHCP
server). This is expensive, but necessary. Having paid this cost, we may
as well try to use the same code to generate our DHCP request packets,
since the process is similar.
před 18 roky
Michael Brown
12da7ea475
Add (untested) code for parsing a received DHCP packet and constructing a
DHCP options block from the contents.
před 18 roky
Michael Brown
19e8b41562
Add code to modify DHCP option values within a block.
před 18 roky
Michael Brown
51d62d1a3c
Provide a mechanism for returning the encapsulator as well as the
encapsulated option; this will be needed for modifications to the options
block.
před 18 roky
Michael Brown
291f072b82
Add priority mechanism
před 18 roky
Michael Brown
0bcaa8a21f
First stab at DHCP option handling in a way that will allow us to have
multiple option sources (e.g. multiple DHCP replies, non-volatile
storage etc.)
před 18 roky