}
When set to ``true``, information relevant to the DHCPREQUEST asking for the lease is
-added into the lease's user-context as a map element labeled "ISC". Currently,
-the map contains a single value, the ``relay-agent-info`` option (DHCP Option 82),
-when the DHCPREQUEST received contains it. Since DHCPREQUESTs sent as renewals will likely not contain this
+added into the lease's user-context as a map element labeled "ISC". Since
+Kea version 2.3.2, when the DHCPREQUEST received contains the option
+(DHCP Option 82) the map contains the ``relay-agent-info`` map
+with the content option (DHCP Option 82) in the ``sub-options`` entry and
+when present the ``remote-id`` and ``relay-id`` options.
+Since DHCPREQUESTs sent as renewals will likely not contain this
information, the values taken from the last DHCPREQUEST that did contain it are
retained on the lease. The lease's user-context looks something like this:
::
- { "ISC": { "relay-agent-info": "0x52050104AABBCCDD" } }
+ { "ISC": { "relay-agent-info": { "sub-options": "0x0104AABBCCDD" } } }
+
+Or with remote and relay suboptions:
+
+::
+ { "ISC": { "relay-agent-info": {
+ "sub-options": "0x02030102030C03AABBCC",
+ "remote-id": "03010203",
+ "relay-id": "AABBCC"
+ } } }
.. note::
{
"ISC": {
- "relays": [
+ "relay-info": [
{
- "hop": 2,
+ "hop": 3,
"link": "2001:db8::1",
"peer": "2001:db8::2"
},
{
- "hop": 1,
+ "hop": 2,
"link": "2001:db8::3",
"options": "0x00C800080102030405060708",
"peer": "2001:db8::4"
+ },
+ {
+ "hop": 1",
+ "link": "2001:db8::5",
+ "options": "0x00250006010203040506003500086464646464646464",
+ "remote-id": "010203040506",
+ "relay-id": "6464646464646464"
}]
}
}
+.. note::
+
+ Before Kea version 2.3.2 the entry was named ``relays``, remote and relay
+ identifier options were not decoded.
+
.. note::
It is possible that other hook libraries are already using
}
if (!rai_def) {
- // Should never be used...
- rai_def.reset(new OptionDefinition("dhcp-agent-options",
- DHO_DHCP_AGENT_OPTIONS,
- DHCP4_OPTION_SPACE,
- OPT_EMPTY_TYPE,
- DHCP_AGENT_OPTION_SPACE));
+ // The definition is set when libdhcp++ is loaded so it is impossible
+ // to not be able to get it... so should not happen!
+ isc_throw(Unexpected, "can't find RAI option definition?!");
}
changed = true;
/// @brief Upgrade a V4 lease user context to the new extended info entry.
///
+ /// In details:
+ /// - change the "ISC" / "relay-agent-info" to a map.
+ /// - move the "relay-agent-info" string to the "sub-options" entry of
+ /// the map.
+ /// - decode remote-id and relay-id from the RAI option content and
+ /// add the raw value in hexadecimal in "remote-id" and/or "relay-id"
+ /// entries of the map.
+ ///
/// @param lease Pointer to the lease to be updated.
/// @return True if the lease user context was updated, false otherwise.
static bool upgradeLease4ExtendedInfo(const Lease4Ptr& lease);
/// @brief Upgrade a V6 lease user context to the new extended info entry.
///
+ /// In details:
+ /// - change the "ISC" / "relays" list entry to "relay-info".
+ /// - decode remote-id and relay-id from each relay options and
+ /// add the raw value in hexadecimal in "remote-id" and/or "relay-id"
+ /// in the relay item of the list.
+ ///
/// @param lease Pointer to the lease to be updated.
/// @return True if the lease user context was updated, false otherwise.
static bool upgradeLease6ExtendedInfo(const Lease6Ptr& lease);