]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3074] adding example of option 121
authorPiotrek Zadroga <piotrek@isc.org>
Tue, 10 Oct 2023 13:21:07 +0000 (15:21 +0200)
committerPiotrek Zadroga <piotrek@isc.org>
Tue, 9 Jan 2024 10:38:08 +0000 (11:38 +0100)
doc/examples/kea4/all-options.json
src/lib/dhcp/option_classless_static_route.cc

index 5e7d7ccbc7f501632bfae867cd418e7ab9792cdd..78aade714d7a2ddf133f3e43ec7d216d2e4e1d14 100644 (file)
         "name": "domain-search"
       },
 
+      /*
+        Code Len Destination 1    Router 1
+      +-----+---+----+-----+----+----+----+----+----+
+      | 121 | n | d1 | ... | dN | r1 | r2 | r3 | r4 |
+      +-----+---+----+-----+----+----+----+----+----+
+
+       Destination 2       Router 2
+      +----+-----+----+----+----+----+----+
+      | d1 | ... | dN | r1 | r2 | r3 | r4 |
+      +----+-----+----+----+----+----+----+
+
+      Destination 1...N     Destination descriptors - describe the IP
+                            subnet number and subnet mask of a particular
+                            destination using a compact encoding. This
+                            encoding consists of one octet describing
+                            the width of the subnet mask, followed by all
+                            the significant octets of the subnet number.
+
+      Router 1...N          The IP address of the router that should
+                            be used to reach that destination.
+      */
+      // Type: array of {IPv4 address}
+      {
+        "code": 121,
+      //         subnet1, mask1  , router1  , subnet2     , mask2          , router2   , subnet3    , mask3       ,  router3
+        "data": "0.0.0.0, 0.0.0.0, 10.17.0.1, 10.229.0.128, 255.255.255.128, 10.229.0.1, 10.27.129.0, 255.255.255.0, 10.27.129.1",
+        "name": "classless-static-route"
+      },
+
       // Option codes 120-123 are not defined in Kea.
 
       /*
index 579b09b09e847c26595bda0769ddaaa09c4206d1..b149b5d7c0c62e3c271c7981468522187cb60e32 100644 (file)
@@ -45,7 +45,7 @@ OptionClasslessStaticRoute::unpack(OptionBufferConstIter begin, OptionBufferCons
     if (!distance(begin, end) || distance(begin, end) % (V4ADDRESS_LEN * 3)) {
         isc_throw(OutOfRange, "DHCPv4 OptionClasslessStaticRoute "
                                   << type_ << " has invalid length=" << distance(begin, end)
-                                  << ", must be not 0 and divisible by 12.");
+                                  << ", must be divisible by 12 and must not be 0.");
     }
 
     while (begin != end) {