]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
Update doc/sphinx/arm/hooks.rst
authorMarcin Godzina <mgodzina@isc.org>
Tue, 31 May 2022 15:19:34 +0000 (15:19 +0000)
committerMarcin Godzina <mgodzina@isc.org>
Tue, 31 May 2022 15:19:34 +0000 (15:19 +0000)
doc/sphinx/arm/hooks.rst

index 8062257e2ce899c1ec34c8a9d71ec58952e9c542..55d256b626123fa19e7d03adf42886eece0e2e1f 100644 (file)
@@ -3630,3 +3630,67 @@ subnets, client classes, option data and definitions, host
 reservations, control socket, DHCP-DDNS, loggers, and server ID. These
 are supported in both DHCPv4 and DHCPv6, with the exception of server ID,
 which is DHCPv6 only.
+
+Some hooks use user-context for configuration to enable easy changes by commands.
+
+DDNS-Tuning Hook uses user-context to configure per subner behavior. Example:
+
+::
+
+    "subnet4": [{
+        "subnet": "192.0.2.0/24",
+        "pools": [{
+            "pool": "192.0.2.10 - 192.0.2.20",
+        } ],
+        "user-context": {
+            "ddns-tuning:" {
+                "hostname-expr": "'guest-'+Int8ToText(substring(pkt4.yiaddr, 0,1))+'-' \
+                                        +Int8ToText(substring(pkt4.yiaddr, 1,2))+'-' \
+                                        +Int8ToText(substring(pkt4.yiaddr, 2,3))+'-' \
+                                        +Int8ToText(substring(pkt4.yiaddr, 3,4))",
+            },
+            "last-modified": "2017-09-04 13:32",
+            "phones": [ "x1234", "x2345" ],
+            "devices-registered": 42,
+            "billing": false
+        }
+    }]
+
+
+Rate limiting hook uses user-context in clases and subnets to set parameters. Example:
+
+::
+    
+    "Dhcp6": {
+        "client-classes": [
+        {
+            "name": "gold",
+            "user-context": {
+            "limits": {
+                "rate-limit": "1000 packets per second"
+            }
+            }
+        }
+        ],
+        "hooks-libraries": [
+        {
+            "library": "/usr/local/lib/libdhcp_limits.so"
+        }
+        ],
+        "subnet6": [
+        {
+            "id": 1,
+            "pools": [
+            {
+                "pool": "2001:db8::/64"
+            }
+            ],
+            "subnet": "2001:db8::/64",
+            "user-context": {
+            "limits": {
+                "rate-limit": "10 packets per minute"
+            }
+            }
+        }
+        ]
+    }