<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DHCP Role on Gravity</title><link>https://deploy-preview-2170--beryju-gravity.netlify.app/docs/dhcp/</link><description>Recent content in DHCP Role on Gravity</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://deploy-preview-2170--beryju-gravity.netlify.app/docs/dhcp/index.xml" rel="self" type="application/rss+xml"/><item><title>Scopes</title><link>https://deploy-preview-2170--beryju-gravity.netlify.app/docs/dhcp/scopes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2170--beryju-gravity.netlify.app/docs/dhcp/scopes/</guid><description>&lt;p&gt;The scope for any particular request is found in the following way:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Checking if the DHCP Peer address is within any of the scopes CIDR, or&lt;/li&gt;
&lt;li&gt;Checking if the Address of the interface the request was received on is within any of the scopes CIDR, or&lt;/li&gt;
&lt;li&gt;Checking if the Scope has the &lt;code&gt;default&lt;/code&gt; flag set to &lt;code&gt;true&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Afterwards, all matching scopes are sorted by the length of the Scope&amp;rsquo;s CIDR Prefix, and the longest prefix match is chosen.&lt;/p&gt;</description></item><item><title>Options</title><link>https://deploy-preview-2170--beryju-gravity.netlify.app/docs/dhcp/options/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2170--beryju-gravity.netlify.app/docs/dhcp/options/</guid><description>&lt;h2 id="tag"&gt;Tag&lt;/h2&gt;
&lt;h3 id="tagname"&gt;&lt;code&gt;tagName&lt;/code&gt;:&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;tagName&lt;/code&gt; corresponds to a human-readable name for a DHCP option tag; any of these tag names can be used:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;subnet_mask&lt;/code&gt; &lt;em&gt;(DHCP option 1)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;router&lt;/code&gt; &lt;em&gt;(DHCP option 3)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;time_server&lt;/code&gt; &lt;em&gt;(DHCP option 4)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;name_server&lt;/code&gt; &lt;em&gt;(DHCP option 6)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;domain_name&lt;/code&gt; &lt;em&gt;(DHCP option 15)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tftp_server&lt;/code&gt; &lt;em&gt;(DHCP option 66)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bootfile&lt;/code&gt; &lt;em&gt;(DHCP option 67)&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Conflicts with &lt;code&gt;tag&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h3 id="tag-1"&gt;&lt;code&gt;tag&lt;/code&gt;:&lt;/h3&gt;
&lt;p&gt;This field allows for setting the raw DHCP option tag to any value.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Conflicts with &lt;code&gt;tagName&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;</description></item><item><title>Hooks</title><link>https://deploy-preview-2170--beryju-gravity.netlify.app/docs/dhcp/hooks/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2170--beryju-gravity.netlify.app/docs/dhcp/hooks/</guid><description>&lt;h2 id="hook-methods"&gt;Hook Methods&lt;/h2&gt;
&lt;h3 id="ondhcprequestbeforerequest"&gt;&lt;code&gt;onDHCPRequestBefore(request)&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Called before the DHCP response is generated.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;request&lt;/code&gt;: See &lt;a href="https://pkg.go.dev/beryju.io/gravity/pkg/roles/dhcp#Request4"&gt;https://pkg.go.dev/beryju.io/gravity/pkg/roles/dhcp#Request4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="ondhcprequestafterrequest-response"&gt;&lt;code&gt;onDHCPRequestAfter(request, response)&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Called after the DHCP response is generated.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;request&lt;/code&gt;: See &lt;a href="https://pkg.go.dev/beryju.io/gravity/pkg/roles/dhcp#Request4"&gt;https://pkg.go.dev/beryju.io/gravity/pkg/roles/dhcp#Request4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;response&lt;/code&gt;: See &lt;a href="https://pkg.go.dev/github.com/insomniacslk/dhcp/dhcpv4#DHCPv4"&gt;https://pkg.go.dev/github.com/insomniacslk/dhcp/dhcpv4#DHCPv4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="environment"&gt;Environment&lt;/h2&gt;


 




	






 






 &lt;h3 id="gravity-object"&gt;&lt;code&gt;gravity&lt;/code&gt; Object&lt;/h3&gt;
&lt;h4 id="logmsg-any"&gt;&lt;code&gt;log(msg: any)&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;Logs a message to the stdout of the Gravity node this hook is run on.&lt;/p&gt;
&lt;h4 id="node-string"&gt;&lt;code&gt;node: string&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;The identifier of the node this hook is run on.&lt;/p&gt;
&lt;h4 id="version-string"&gt;&lt;code&gt;version: string&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;The version of Gravity on the node this hook is run on.&lt;/p&gt;</description></item><item><title>Role configuration</title><link>https://deploy-preview-2170--beryju-gravity.netlify.app/docs/dhcp/role_config/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2170--beryju-gravity.netlify.app/docs/dhcp/role_config/</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;code&gt;port&lt;/code&gt;: The port the DHCP server listens on (defaults to 67).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;leaseNegotiateTimeout&lt;/code&gt;: The timeout a lease is reserved after a DHCP Discover request (defaults to 30 seconds).&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>