</para>
<para>
- "relay[code].hex" attempts to extract value of the sub-option
- "code" from the option inserted by the Relay Agent Information
- (82) option. If the packet doesn't contain RAI option, or RAI
- doesn't contain searched sub-option, the expression returns
- empty string. The string is presented as a byte string of the
+ "relay[code].hex" attempts to extract the value of the sub-option
+ "code" from the option inserted as the Relay Agent Information
+ (82) option. If the packet doesn't contain a RAI option, or the RAI
+ option doesn't contain the requested sub-option, the expression returns
+ an empty string. The string is presented as a byte string of the
option payload without the type code or length fields. This
expression is allowed in DHCPv4 only.
</para>
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@section dhcpEcalToken Supported tokens
- There is a number of tokens implemented. Each token is derived from
+ There are a number of tokens implemented. Each token is derived from
isc::eval::Token class and represents a certain expression primitive.
Currently supported tokens are:
hex string, e.g. 0x666f6f which is actually "foo";
- isc::dhcp::TokenOption - represents an option in a packet, e.g.
option[123].text;
- - isc::dhcp::TokenEqual - represents equal (==) operator;
- - isc::dhcp::TokenSubstring - represents substring(text, start, length) operator;
+ - isc::dhcp::TokenEqual - represents the equal (==) operator;
+ - isc::dhcp::TokenSubstring - represents the substring(text, start, length) operator;
- isc::dhcp::TokenRelay4Option - represents a sub-option inserted by the
- DHCPv4 relay, e.g. relay[123].text or relay[123].bin
+ DHCPv4 relay, e.g. relay[123].text or relay[123].hex
More operators are expected to be implemented in upcoming releases.
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
uint16_t convertOptionCode(const std::string& option_code,
const isc::eval::location& loc);
- /// @brief Option name convertion
+ /// @brief Option name conversion
///
/// @param option_name the option name
/// @param loc the location of the token
-/* Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+/* Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
-/* Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+/* Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
}
// This test checks that the code properly handles cases when
-// there is RAI option, but there's no requested sub-option.
+// there is a RAI option, but there's no requested sub-option.
TEST_F(TokenTest, relayOptionNoSuboption) {
// Insert relay option with sub-options 1 and 13
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
-// Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/// @brief Represents a sub-option inserted by the DHCPv4 relay.
///
/// DHCPv4 relays insert sub-options in option 82. This token attempts to extract
-/// such sub-options. Note it is radically different than in DHCPv6 (possible
-/// many encapsulation levels), thus separate classes for v4 and v6.
+/// such sub-options. Note in DHCPv6 it is radically different (possibly
+/// many encapsulation levels), thus there are separate classes for v4 and v6.
///
/// This token can represent the following expressions:
/// relay[13].text - Textual representation of sub-option 13 in RAI (option 82)
class TokenRelay4Option : public TokenOption {
public:
- /// @brief Construtor for extracting sub-option from RAI (option 82)
+ /// @brief Constructor for extracting sub-option from RAI (option 82)
///
- /// @param option_code code of the searched sub-option
+ /// @param option_code code of the requested sub-option
/// @param rep_type code representation (currently .hex and .text are supported)
TokenRelay4Option(const uint16_t option_code,
const RepresentationType& rep_type);