]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Document %ip.v4.netmask() and %ip.v4.broadcast()
authorNick Porter <nick@portercomputing.co.uk>
Fri, 19 Dec 2025 15:58:28 +0000 (15:58 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 19 Dec 2025 16:00:02 +0000 (16:00 +0000)
doc/antora/modules/reference/nav.adoc
doc/antora/modules/reference/pages/xlat/all.adoc
doc/antora/modules/reference/pages/xlat/ipv4/broadcast.adoc [new file with mode: 0644]
doc/antora/modules/reference/pages/xlat/ipv4/index.adoc [new file with mode: 0644]
doc/antora/modules/reference/pages/xlat/ipv4/netmask.adoc [new file with mode: 0644]

index a934a9a767c66c669cd63276c526a19d62d42082..1c59aa3d5c93bf8c5876f5e00b7944851c97ee53 100644 (file)
 **** xref:xlat/time/offset.adoc[UTC Offset]
 **** xref:xlat/time/request.adoc[Request Time]
 
+*** xref:xlat/ipv4/index.adoc[IPv4 Handling]
+**** xref:xlat/ipv4/broadcast.adoc[Broadcast Address]
+**** xref:xlat/ipv4/netmask.adoc[Subnet Mask]
+
 ** xref:dictionary/index.adoc[Dictionaries]
 *** xref:dictionary/alias.adoc[ALIAS]
 *** xref:dictionary/attribute.adoc[ATTRIBUTE]
index c813235238953d7e24f47605acc7902135e79dcb..af9e67359ce93e258eca74ff5a673415072ffbf8 100644 (file)
 | xref:xlat/time/offset.adoc[offset]                | Return UTC offset.
 | xref:xlat/time/request.adoc[request]              | Return the time when the request was received.
 |=====
+
+== IPv4 Handling
+.IPv4 handling
+[options="header"]
+[cols="30%,70%"]
+|=====
+| *Function*                                        | *Description*
+| xref:xlat/ipv4/broadcast.adoc[broadcast]          | Get the broadcast address from an IPv4 prefix
+| xref:xlat/ipv4/netmask.adoc[netmask]              | Get the netmask from an IPv4 prefix
+|=====
diff --git a/doc/antora/modules/reference/pages/xlat/ipv4/broadcast.adoc b/doc/antora/modules/reference/pages/xlat/ipv4/broadcast.adoc
new file mode 100644 (file)
index 0000000..8982a5e
--- /dev/null
@@ -0,0 +1,26 @@
+= %ip.v4.broadcast( <ipv4 prefix> )
+
+Get the broadcast address from an IPv4 prefix.
+
+.Return: _ipv4_
+
+Particularly useful for use when handling DHCPv4 requests, where
+`Broadcast-Address` is required in the reply, and the subnet the client is
+being placed in is known.
+
+.Example
+
+[source,unlang]
+----
+Network-Subnet := 192.168.1.0/24
+reply.Broadcast-Address := %ip.v4.broadcast(Network-Subnet)
+----
+
+.Output
+
+```
+192.168.1.255
+```
+
+// Copyright (C) 2025 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
+// This documentation was developed by Network RADIUS SAS.
diff --git a/doc/antora/modules/reference/pages/xlat/ipv4/index.adoc b/doc/antora/modules/reference/pages/xlat/ipv4/index.adoc
new file mode 100644 (file)
index 0000000..0a4a2bd
--- /dev/null
@@ -0,0 +1,15 @@
+= IPv4 handling
+
+The following functions perform manipulation of IPv4 addresses / subnets.
+
+.IPv4 handling
+[options="header"]
+[cols="30%,70%"]
+|=====
+| *Function*                                 | *Description*
+| xref:xlat/ipv4/broadcast.adoc[broadcast]   | Get the broadcast address from an IPv4 prefix
+| xref:xlat/ipv4/netmask.adoc[netmask]       | Get the netmask from an IPv4 prefix
+|=====
+
+// Copyright (C) 2025 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
+// This documentation was developed by Network RADIUS SAS.
diff --git a/doc/antora/modules/reference/pages/xlat/ipv4/netmask.adoc b/doc/antora/modules/reference/pages/xlat/ipv4/netmask.adoc
new file mode 100644 (file)
index 0000000..c9d3d72
--- /dev/null
@@ -0,0 +1,26 @@
+= %ip.v4.netmask( <ipv4 prefix> )
+
+Get the netmask from an IPv4 prefix
+
+.Return: _ipv4_
+
+Particularly useful for use when handling DHCPv4 requests, where
+`Subnet-Mask` is required in the reply, and the subnet the client is
+being placed in is known.
+
+.Example
+
+[source,unlang]
+----
+Network-Subnet := 192.168.1.0/24
+reply.Subnet-Mask := %ip.v4.netmask(Network-Subnet)
+----
+
+.Output
+
+```
+255.255.255.0
+```
+
+// Copyright (C) 2025 Network RADIUS SAS.  Licenced under CC-by-NC 4.0.
+// This documentation was developed by Network RADIUS SAS.