]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#898] Added DHCP class and config example
authorTomek Mrugalski <tomasz@isc.org>
Thu, 21 Nov 2019 05:42:10 +0000 (13:42 +0800)
committerFrancis Dupont <fdupont@isc.org>
Tue, 10 Dec 2019 21:10:13 +0000 (22:10 +0100)
doc/sphinx/arm/hooks-bootp.rst
src/hooks/dhcp/bootp/bootp_callouts.cc

index 20b5312bbf9162467faee0bbecba25269da1dafd..575815a0c295cfbda154c3ed01c5e062abff15a2 100644 (file)
@@ -34,7 +34,38 @@ It takes no parameter.
    This library is only meant to be loaded by the ``kea-dhcp4`` process
    as there is no BOOTP protocol for IPv6.
 
-.. _books-bootp-limitations:
+
+.. _hooks-bootp-config:
+
+Incoming BOOTP packets are added to the BOOTP class. Incoming packets that
+are DHCP packets are added to the DHCP class. This can be used to segregate
+BOOTP clients to separate pool. For example you can do the following:
+
+::
+
+   "Dhcp4": {
+       "subnet4": [
+           {
+               "subnet": "192.0.2.0/24",
+               "pools": [
+               {
+                   // BOOTP clients will be handled here
+                   "pool": "192.0.2.200 - 192.0.2.254",
+                   "class": "BOOTP"
+               },
+               {
+                   // Regular DHCP clients will be handled here
+                   "pool": "192.0.2.1 - 192.0.2.199"
+               }],
+               ...
+           },
+           ...
+       ],
+       ...
+   }
+
+
+.. _hooks-bootp-limitations:
 
 BOOTP Hooks Limitations
 ~~~~~~~~~~~~~~~~~~~~~~~
index 5afbec6658f68d2e5e108c0b8fcd4ce9ac3dbee7..50ea089358e503a3d8013b7ace4edb9ab7ad5cea 100644 (file)
@@ -37,6 +37,7 @@ int pkt4_receive(CalloutHandle& handle) {
     try {
         if (query->getType() != DHCP_NOTYPE) {
             // DHCP query.
+            query->addClass("DHCP");
             return (0);
         }
         if (query->getOp() == BOOTREPLY) {