From: Alan T. DeKok Date: Sat, 30 Jul 2022 12:51:36 +0000 (-0400) Subject: clean up markup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7423a446fb9f87c12794cada708ec137685a4106;p=thirdparty%2Ffreeradius-server.git clean up markup --- diff --git a/doc/antora/modules/reference/pages/type/cast.adoc b/doc/antora/modules/reference/pages/type/cast.adoc index 795826d685f..e03e29998da 100644 --- a/doc/antora/modules/reference/pages/type/cast.adoc +++ b/doc/antora/modules/reference/pages/type/cast.adoc @@ -61,7 +61,7 @@ to use. The cast syntax is used when either the data type is ambiguous, or when data should be normalized prior to comparison, or when a specific data type is required. -=== Casting Behavior +== Casting Behavior In general, casting data types of different sizes will fail. For example, casting an `octet` string of length `3` to `uint32` is @@ -71,7 +71,7 @@ However, in many cases casting from one data type will "just work". When the cast fails, the result is a `NULL` or empty value. -==== IP Addresses +=== IP Addresses Casting `ipv4addr` to `ipv6addr` will return an IPv6 address which contains the IPv4 address, with the upper bits as `::ffff`. This @@ -86,7 +86,7 @@ Casting an IPv4 address to an IPv4 prefix is allowed, and will return a prefix of using a `/32`. Casting the other way is also allowed, but only if the prefix is `/32`. -==== Numbers +=== Numbers Numbers can generally be cast from one data type to another, if the input value can be represented in the new data type. @@ -95,7 +95,7 @@ For example, casting `uint8` to `uint16` will always succeed. However, casting a signed `int8` to `uint16` may fail, as negative values cannot be represented in the `uint16` data type. -==== Octets +=== Octets Casting any data type to `octets` means returning the "raw" value of the underlying data type. For example, casting an IPv4 address of @@ -107,7 +107,7 @@ the raw value as that data type, generally as if the data had been received from the network. For example, casting the `octets` string `0x7f000001` to `ipvaddr` will return the IPv4 address `127.0.0.1`. -==== Strings +=== Strings Casting any data type to `string` means _printing_ the data type to a string, and assigning the resulting value to the `string`. For a @@ -122,13 +122,13 @@ string as that data type. See xref:types/string/double.adoc[double-quoted strings] for examples of how double-quoted strings are used. -==== Other Data Types +=== Other Data Types Other data types such as `ethernet`, etc. can generally be cast to/from `octet`, and printed to/from `string`. Most other casts do not make sense, and will not work. -=== Expressions +== Expressions Unlang xref:unlang/expression.adoc[expressions] can use casts, too, as in the following example: @@ -163,10 +163,11 @@ hoc" data structures for sending in a packet: will result in the `octet` string value `0x010300047f000001`. -=== Compatibility +== Compatibility For compatibility with version 3, the `` syntax is also supported. We recommend, however, that people use the new syntax. +The old syntax will eventually be removed, and will create an error. // Copyright (C) 2021 Network RADIUS SAS. Licenced under CC-by-NC 4.0. // Development of this documentation was sponsored by Network RADIUS SAS.