Kea 3.3.1
isc::dhcp::TokenRelay4Option Class Reference

Represents a sub-option inserted by the DHCPv4 relay. More...

#include <token.h>

Inheritance diagram for isc::dhcp::TokenRelay4Option:

Public Member Functions

 TokenRelay4Option (const std::vector< uint16_t > &option_codes, const RepresentationType &rep_type)
 Constructor for extracting sub-option from RAI (option 82).
Public Member Functions inherited from isc::dhcp::TokenOption
 TokenOption (const std::vector< uint16_t > &option_codes, const RepresentationType &rep_type)
 Constructor that takes an option code as a parameter.
virtual unsigned evaluate (Pkt &pkt, ValueStack &values)
 Evaluates the values of the option.
std::vector< uint16_t > getOptions () const
 Returns option-code.
RepresentationType getRepresentation () const
 Returns representation-type.
Public Member Functions inherited from isc::dhcp::Token
virtual ~Token ()
 Virtual destructor.
virtual unsigned getLabel () const
 Return the label of this token.

Protected Member Functions

virtual OptionPtr getOption (Pkt &pkt)
 Attempts to obtain specified sub-option of option 82 from the packet.
Protected Member Functions inherited from isc::dhcp::TokenOption
virtual std::string pushFailure (ValueStack &values)
 Auxiliary method that puts string representing a failure.

Additional Inherited Members

Public Types inherited from isc::dhcp::TokenOption
enum  RepresentationType { TEXTUAL , HEXADECIMAL , EXISTS }
 Token representation type. More...
Static Public Member Functions inherited from isc::dhcp::Token
static bool toBool (std::string value)
 Coverts a (string) value to a boolean.
Protected Attributes inherited from isc::dhcp::TokenOption
std::vector< uint16_t > option_path_
 The options hierarchy.
RepresentationType representation_type_
 The representation type.

Detailed Description

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 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: relay4[13].text - Textual representation of sub-option 13 in RAI (option 82) relay4[13].hex - Binary representation of sub-option 13 in RAI (option 82) relay4[vendor-class].text - Text representation of sub-option X in RAI (option 82) relay4[vendor-class].hex - Binary representation of sub-option X in RAI (option 82)

Definition at line 501 of file token.h.

Constructor & Destructor Documentation

◆ TokenRelay4Option()

isc::dhcp::TokenRelay4Option::TokenRelay4Option ( const std::vector< uint16_t > & option_codes,
const RepresentationType & rep_type )
inline

Constructor for extracting sub-option from RAI (option 82).

Parameters
option_codesoption hierarchy of the option to be represented.
rep_typecode representation (currently .hex and .text are supported)

Definition at line 508 of file token.h.

References isc::dhcp::TokenOption::TokenOption().

Here is the call graph for this function:

Member Function Documentation

◆ getOption()

OptionPtr TokenRelay4Option::getOption ( Pkt & pkt)
protectedvirtual

Attempts to obtain specified sub-option of option 82 from the packet.

Parameters
pktDHCPv4 packet (that hopefully contains option 82)
Returns
found sub-option from option 82

Reimplemented from isc::dhcp::TokenOption.

Definition at line 482 of file token.cc.

References isc::dhcp::DHO_DHCP_AGENT_OPTIONS, isc::dhcp::Pkt::getOption(), and isc::dhcp::TokenOption::option_path_.

Here is the call graph for this function:

The documentation for this class was generated from the following files: