7#ifndef OPTION4_CLIENT_FQDN_H
8#define OPTION4_CLIENT_FQDN_H
36class Option4ClientFqdnImpl;
191 const std::string& domain_name,
246 bool getFlag(
const uint8_t flag)
const;
257 void setFlag(
const uint8_t flag,
const bool set);
266 std::pair<Rcode, Rcode>
getRcode()
const;
340 virtual std::string
toText(
int indent = 0)
const;
346 virtual uint16_t
len()
const;
354 static Rcode rcode(255);
360 static Rcode rcode(0);
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Exception thrown when invalid domain name is specified.
InvalidOption4FqdnDomainName(const char *file, size_t line, const char *what)
Exception thrown when invalid flags have been specified for DHCPv4 Client FQDN Option.
InvalidOption4FqdnFlags(const char *file, size_t line, const char *what)
Implements the logic for the Option6ClientFqdn class.
Represents the value of one of the RCODE1 or RCODE2 fields.
uint8_t getCode() const
Returns the value of the RCODE.
Rcode(const uint8_t rcode)
Represents DHCPv4 Client FQDN Option (code 81).
static const uint16_t FIXED_FIELDS_LEN
The size in bytes of the fixed fields within DHCPv4 Client Fqdn Option.
void setRcode(const Rcode &rcode)
Set Rcode value.
virtual uint16_t len() const
Returns length of the complete option (data length + DHCPv4 option header).
static const Rcode & RCODE_SERVER()
Rcode being set by the server.
static const uint8_t FLAG_N
Bit N.
bool getFlag(const uint8_t flag) const
Checks if the specified flag of the DHCPv4 Client FQDN Option is set.
static const uint8_t FLAG_S
Bit S.
DomainNameType getDomainNameType() const
Returns enumerator value which indicates whether domain-name is partial or full.
virtual void unpack(OptionBufferConstIter first, OptionBufferConstIter last)
Parses option from the received buffer.
void packDomainName(isc::util::OutputBuffer &buf) const
Writes domain-name in the wire format into a buffer.
Option4ClientFqdn & operator=(const Option4ClientFqdn &source)
Assignment operator.
void setDomainName(const std::string &domain_name, const DomainNameType domain_name_type)
Set new domain-name.
static const uint8_t FLAG_MASK
Mask which zeroes MBZ flag bits.
Option4ClientFqdn(const uint8_t flags, const Rcode &rcode, const std::string &domain_name, const DomainNameType domain_name_type=FULL)
Constructor, creates option instance using flags and domain name.
DomainNameType
Type of the domain-name: partial or full.
virtual ~Option4ClientFqdn()
Destructor.
std::pair< Rcode, Rcode > getRcode() const
Returns Rcode objects representing value of RCODE1 and RCODE2.
void resetDomainName()
Set empty domain-name.
void setFlag(const uint8_t flag, const bool set)
Modifies the value of the specified DHCPv4 Client Fqdn Option flag.
static const uint8_t FLAG_O
Bit O.
virtual void pack(isc::util::OutputBuffer &buf, bool check=true) const
Writes option in the wire format into a buffer.
static const Rcode & RCODE_CLIENT()
Rcode being set by the client.
virtual OptionPtr clone() const
Copies this option and returns a pointer to the copy.
void resetFlags()
Sets the flag field value to 0.
static const uint8_t FLAG_E
Bit E.
std::string getDomainName() const
Returns the domain-name in the text format.
virtual std::string toText(int indent=0) const
Returns string representation of the option.
void check() const
A protected method used for option correctness.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
boost::shared_ptr< Option4ClientFqdn > Option4ClientFqdnPtr
A pointer to the Option4ClientFqdn object.
boost::shared_ptr< Option > OptionPtr
Defines the logger used by the top-level component of kea-lfc.