summaryrefslogtreecommitdiff
path: root/interface-definitions/include
diff options
context:
space:
mode:
authorRuben Herold <ruben@puettmann.net>2026-08-31 12:49:24 +0200
committerViacheslav Hletenko <seversss265@gmail.com>2026-10-15 16:05:57 +0300
commit2e5ea7a8304ed6ce504b3928e3b2f52574a61397 (patch)
tree1eff85f00c83e0ba087850a13bbbf952ba7eabaa /interface-definitions/include
parenta06aab8262d6ef3fba6d4f73b699a46500546a1a (diff)
downloadvyos-1x-2e5ea7a8304ed6ce504b3928e3b2f52574a61397.tar.gz
vyos-1x-2e5ea7a8304ed6ce504b3928e3b2f52574a61397.zip
dhcp-server: T9267: add client-class matching on hostname/vendor-class-id
Client classes could previously only match on relay agent information (Option 82). Add matching on the client-sent hostname (Option 12) and vendor class identifier (Option 60), each with an exact-value or substring form, so clients sharing a subnet can be told apart by e.g. device model without splitting the subnet into per-model pools. Also let a client-class deliver its own options (reusing the existing subnet/range option syntax), so a match can directly hand out a model-specific value such as a provisioning URL, independent of which pool the client's lease is drawn from.
Diffstat (limited to 'interface-definitions/include')
-rw-r--r--interface-definitions/include/dhcp/dhcp-server-common-config.xml.i129
1 files changed, 129 insertions, 0 deletions
diff --git a/interface-definitions/include/dhcp/dhcp-server-common-config.xml.i b/interface-definitions/include/dhcp/dhcp-server-common-config.xml.i
index 4fc5a4b5b..60ba1f952 100644
--- a/interface-definitions/include/dhcp/dhcp-server-common-config.xml.i
+++ b/interface-definitions/include/dhcp/dhcp-server-common-config.xml.i
@@ -42,6 +42,135 @@
</leafNode>
</children>
</node>
+ <node name="hostname">
+ <properties>
+ <help>Match DHCP Option 12 (hostname)</help>
+ </properties>
+ <children>
+ <leafNode name="value">
+ <properties>
+ <help>Filters on the exact contents of the option</help>
+ <valueHelp>
+ <format>hex</format>
+ <description>Values that start with 0x are interpreted as raw hex. This must only be hexadecimal characters e.g. 0x1234567890ABCDEF</description>
+ </valueHelp>
+ <valueHelp>
+ <format>txt</format>
+ <description>Any other text string is interpreted as ASCII text</description>
+ </valueHelp>
+ </properties>
+ </leafNode>
+ <node name="substring">
+ <properties>
+ <help>Filters on part of the option contents</help>
+ </properties>
+ <children>
+ <leafNode name="offset">
+ <properties>
+ <help>Byte offset from the start of the option value (default: 0)</help>
+ <valueHelp>
+ <format>u32:0-255</format>
+ <description>Byte offset</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 0-255"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="length">
+ <properties>
+ <help>Number of bytes to compare (default: length of value)</help>
+ <valueHelp>
+ <format>u32:1-255</format>
+ <description>Byte length</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-255"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="value">
+ <properties>
+ <help>Filters on part of the option contents</help>
+ <valueHelp>
+ <format>hex</format>
+ <description>Values that start with 0x are interpreted as raw hex. This must only be hexadecimal characters e.g. 0x1234567890ABCDEF</description>
+ </valueHelp>
+ <valueHelp>
+ <format>txt</format>
+ <description>Any other text string is interpreted as ASCII text</description>
+ </valueHelp>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </node>
+ <node name="vendor-class-id">
+ <properties>
+ <help>Match DHCP Option 60 (vendor class identifier)</help>
+ </properties>
+ <children>
+ <leafNode name="value">
+ <properties>
+ <help>Filters on the exact contents of the option</help>
+ <valueHelp>
+ <format>hex</format>
+ <description>Values that start with 0x are interpreted as raw hex. This must only be hexadecimal characters e.g. 0x1234567890ABCDEF</description>
+ </valueHelp>
+ <valueHelp>
+ <format>txt</format>
+ <description>Any other text string is interpreted as ASCII text</description>
+ </valueHelp>
+ </properties>
+ </leafNode>
+ <node name="substring">
+ <properties>
+ <help>Filters on part of the option contents</help>
+ </properties>
+ <children>
+ <leafNode name="offset">
+ <properties>
+ <help>Byte offset from the start of the option value (default: 0)</help>
+ <valueHelp>
+ <format>u32:0-255</format>
+ <description>Byte offset</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 0-255"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="length">
+ <properties>
+ <help>Number of bytes to compare (default: length of value)</help>
+ <valueHelp>
+ <format>u32:1-255</format>
+ <description>Byte length</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 1-255"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="value">
+ <properties>
+ <help>Filters on part of the option contents</help>
+ <valueHelp>
+ <format>hex</format>
+ <description>Values that start with 0x are interpreted as raw hex. This must only be hexadecimal characters e.g. 0x1234567890ABCDEF</description>
+ </valueHelp>
+ <valueHelp>
+ <format>txt</format>
+ <description>Any other text string is interpreted as ASCII text</description>
+ </valueHelp>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </node>
+ #include <include/dhcp/option-v4.xml.i>
</children>
</tagNode>
#include <include/generic-disable-node.xml.i>