Difference between revisions of "Unit DHCP"

From Ultibo.org
Jump to: navigation, search
 
(14 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
''To be documented''
+
'''Ultibo DHCP/BOOTP Protocol Client unit'''
  
 
=== Constants ===
 
=== Constants ===
Line 93: Line 93:
 
<br />  
 
<br />  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''BOOTP/DHCP request constants''' <code> BOOTP_REQUEST* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''BOOTP/DHCP request''' <code> BOOTP_REQUEST* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 107: Line 107:
 
<br />  
 
<br />  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''DHCP message constants''' <code> DHCP_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''DHCP message''' <code> DHCP_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 147: Line 147:
 
<br />  
 
<br />  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''BOOTP/DHCP constants'''</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''BOOTP/DHCP options'''</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 385: Line 385:
 
<br />  
 
<br />  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''DHCP flag constants''' <code> DHCP_FLAG_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''DHCP flag''' <code> DHCP_FLAG_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 396: Line 396:
 
<br />  
 
<br />  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''ARP config constants''' <code> ARP_CONFIG_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''ARP configuration''' <code> ARP_CONFIG_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 413: Line 413:
 
----
 
----
  
''To be documented''
+
 
 +
'''DHCP specific types'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PBOOTPHeader = ^TBOOTPHeader;</code>
 +
 
 +
<code>TBOOTPHeader = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Opcode:Byte;</code>
 +
| packet op code/message type
 +
|-
 +
| <code>HardwareType:Byte;</code>
 +
| hardware address type, 1 = 10 mb ethernet
 +
|-
 +
| <code>HardwareLength:Byte;</code>
 +
| hardware address len, eg '6' for 10mb eth
 +
|-
 +
| <code>Hops:Byte;</code>
 +
| client sets to zero, optionally used by gateways in cross-gateway booting
 +
|-
 +
| <code>Identifier:LongWord;</code>
 +
| transaction Id, a random number
 +
|-
 +
| <code>Seconds:Word;</code>
 +
| filled in by client, seconds elapsed since client started trying to boot
 +
|-
 +
| <code>Reserved:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ClientIP:TInAddr;</code>
 +
| client IP address filled in by client if known
 +
|-
 +
| <code>YourIP:TInAddr;</code>
 +
| 'your' (client) IP address filled by server if client doesn't know
 +
|-
 +
| <code>ServerIP:TInAddr;</code>
 +
| server IP address returned in bootreply
 +
|-
 +
| <code>GatewayIP:TInAddr;</code>
 +
| gateway IP address, used in optional cross-gateway booting
 +
|-
 +
| <code>ClientHardware:array[0..15] of Byte;</code>
 +
| client hardware address, filled by client
 +
|-
 +
| <code>ClientHardware:THardwareAddress;</code>
 +
| client hardware address, filled by client
 +
|-
 +
| <code>DummyData:array[0..9] of Byte;</code>
 +
| dummy to fill out remaining bytes of above
 +
|-
 +
| <code>ServerName:array[0..63] of Byte;</code>
 +
| optional server host name, null terminated
 +
|-
 +
| <code>FileName:array[0..127] of Byte;</code>
 +
| boot file name, null terminated string 'generic' name or null in bootrequest, fully qualified directory-path name in bootreply
 +
|-
 +
| <code>VendorData:array[0..63] of Byte;</code>
 +
| optional vendor-specific area
 +
|-
 +
| <code>VendorData:array[0..BOOTP_VENDOR_SIZE - 1] of Byte;</code>
 +
| optional vendor-specific area
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''DHCP header'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PDHCPHeader = ^TDHCPHeader;</code>
 +
 
 +
<code>TDHCPHeader = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Opcode:Byte;</code>
 +
| packet op code/message type
 +
|-
 +
| <code>HardwareType:Byte;</code>
 +
| hardware address type, 1 = 10 mb ethernet
 +
|-
 +
| <code>HardwareLength:Byte;</code>
 +
| hardware address len, eg '6' for 10mb eth
 +
|-
 +
| <code>Hops:Byte;</code>
 +
| client sets to zero, optionally used by gateways in cross-gateway booting
 +
|-
 +
| <code>Identifier:LongWord;</code>
 +
| transaction Id, a random number
 +
|-
 +
| <code>Seconds:Word;</code>
 +
| filled in by client, seconds elapsed since client started trying to boot
 +
|-
 +
| <code>Flags:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ClientIP:TInAddr;</code>
 +
| client IP address filled in by client if known
 +
|-
 +
| <code>YourIP:TInAddr;</code>
 +
| 'your' (client) IP address filled by server if client doesn't know
 +
|-
 +
| <code>ServerIP:TInAddr;</code>
 +
| server IP address returned in bootreply
 +
|-
 +
| <code>GatewayIP:TInAddr;</code>
 +
| gateway IP address, used in optional cross-gateway booting
 +
|-
 +
| <code>ClientHardware:array[0..15] of Byte;</code>
 +
| client hardware address, filled by client
 +
|-
 +
| <code>ClientHardware:THardwareAddress;</code>
 +
| client hardware address, filled by client
 +
|-
 +
| <code>DummyData:array[0..9] of Byte;</code>
 +
| dummy to fill out remaining bytes of above
 +
|-
 +
| <code>ServerName:array[0..63] of Byte;</code>
 +
| optional server host name, null terminated
 +
|-
 +
| <code>FileName:array[0..127] of Byte;</code>
 +
| boot file name, null terminated string 'generic' name or null in bootrequest, fully qualified directory-path name in bootreply
 +
|-
 +
| <code>Options:array[0..311] of Byte;</code>
 +
| DHCP options area (minimum 312 bytes)
 +
|-
 +
| <code>Options:array[0..DHCP_OPTIONS_SIZE - 1] of Byte;</code>
 +
| DHCP options area (minimum 312 bytes)
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''DHCP client Id'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PDHCPClientId = ^TDHCPClientId;</code>
 +
 
 +
<code>TDHCPClientId = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Tag:Byte;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Hardware:THardwareAddress;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 
 +
=== Class definitions ===
 +
----
 +
 
 +
 
 +
'''DHCP specific classes'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TDHCPConfigTransport|<code>TDHCPConfigTransport = class(TConfigTransport)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TDHCPConfig|<code>TDHCPConfig = class(TNetworkConfig)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TBOOTPConfigTransport|<code>TBOOTPConfigTransport = class(TConfigTransport)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TBOOTPConfig|<code>TBOOTPConfig = class(TNetworkConfig)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TARPConfigTransport|<code>TARPConfigTransport = class(TConfigTransport)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TARPConfig|<code>TARPConfig = class(TNetworkConfig)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TRARPConfigTransport|<code>TRARPConfigTransport = class(TConfigTransport)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TRARPConfig|<code>TRARPConfig = class(TNetworkConfig)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TStaticConfigTransport|<code>TStaticConfigTransport = class(TConfigTransport)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TStaticConfig|<code>TStaticConfig = class(TNetworkConfig)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TLoopbackConfigTransport|<code>TLoopbackConfigTransport = class(TConfigTransport)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TLoopbackConfig|<code>TLoopbackConfig = class(TNetworkConfig)</code>]]
 +
|-
 +
|}
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
''None defined''
  
 
=== Function declarations ===
 
=== Function declarations ===
Line 428: Line 646:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">procedure DHCPInit;</pre>
 
<pre style="border: 0; padding-bottom:0px;">procedure DHCPInit;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the DHCP unit and create the Loopback, Static, DHCP, BOOTP, RARP and ARP configuration handlers</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| None documented
+
| Called only during system startup
 
|-
 
|-
 
|}
 
|}

Latest revision as of 05:20, 31 August 2021

Return to Unit Reference


Description


Ultibo DHCP/BOOTP Protocol Client unit

Constants



[Expand]
DHCP specific constants BOOTP_*


[Expand]
BOOTP/DHCP request BOOTP_REQUEST*


[Expand]
DHCP message DHCP_*


[Expand]
BOOTP/DHCP options


[Expand]
DHCP flag DHCP_FLAG_*


[Expand]
ARP configuration ARP_CONFIG_*


Type definitions



DHCP specific types

[Expand]

PBOOTPHeader = ^TBOOTPHeader;

TBOOTPHeader = packed record

DHCP header

[Expand]

PDHCPHeader = ^TDHCPHeader;

TDHCPHeader = packed record

DHCP client Id

[Expand]

PDHCPClientId = ^TDHCPClientId;

TDHCPClientId = packed record


Class definitions



DHCP specific classes

TDHCPConfigTransport = class(TConfigTransport)
TDHCPConfig = class(TNetworkConfig)
TBOOTPConfigTransport = class(TConfigTransport)
TBOOTPConfig = class(TNetworkConfig)
TARPConfigTransport = class(TConfigTransport)
TARPConfig = class(TNetworkConfig)
TRARPConfigTransport = class(TConfigTransport)
TRARPConfig = class(TNetworkConfig)
TStaticConfigTransport = class(TConfigTransport)
TStaticConfig = class(TNetworkConfig)
TLoopbackConfigTransport = class(TConfigTransport)
TLoopbackConfig = class(TNetworkConfig)


Public variables


None defined

Function declarations



Initialization functions

[Expand]
procedure DHCPInit;
Description: Initialize the DHCP unit and create the Loopback, Static, DHCP, BOOTP, RARP and ARP configuration handlers


Return to Unit Reference