Kea: option_string.h Source File

| Kea 3.2.0-git

option_string.h
Go to the documentation of this file.
1// Copyright (C) 2013-2022 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef OPTION_STRING_H
8#define OPTION_STRING_H
9
10#include <dhcp/option.h>
11#include <util/buffer.h>
12
13#include <boost/shared_ptr.hpp>
14#include <string>
15
16namespace isc {
17namespace dhcp {
18
28 class OptionString : public Option {
29public:
30
43 OptionString(const Option::Universe u, const uint16_t type,
44 const std::string& value);
45
58 OptionString(const Option::Universe u, const uint16_t type,
59 OptionBufferConstIter begin, OptionBufferConstIter end);
60
62 OptionPtr clone() const;
63
67 virtual uint16_t len() const;
68
72 std::string getValue() const;
73
81 void setValue(const std::string& value);
82
91 virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
92
105 virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
106
113 virtual std::string toText(int indent = 0) const;
114
119 virtual std::string toString() const;
120};
121
123 typedef boost::shared_ptr<OptionString> OptionStringPtr;
124
125} // namespace isc::dhcp
126} // namespace isc
127
128#endif // OPTION_STRING_H
buffer.h
isc::dhcp::OptionString::setValue
void setValue(const std::string &value)
Sets the string value to be held by the option.
Definition option_string.cc:45
isc::dhcp::OptionString::clone
OptionPtr clone() const
Copies this option and returns a pointer to the copy.
Definition option_string.cc:34
isc::dhcp::OptionString::pack
virtual void pack(isc::util::OutputBuffer &buf, bool check=true) const
Creates on-wire format of the option.
Definition option_string.cc:74
isc::dhcp::OptionString::len
virtual uint16_t len() const
Returns length of the whole option, including header.
Definition option_string.cc:69
isc::dhcp::OptionString::toString
virtual std::string toString() const
Returns actual value of the option in string format.
Definition option_string.cc:110
isc::dhcp::OptionString::unpack
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Decodes option data from the provided buffer.
Definition option_string.cc:86
isc::dhcp::OptionString::getValue
std::string getValue() const
Returns the string value held by the option.
Definition option_string.cc:39
isc::dhcp::OptionString::toText
virtual std::string toText(int indent=0) const
Returns option information in the textual format.
Definition option_string.cc:101
isc::dhcp::OptionString::OptionString
OptionString(const Option::Universe u, const uint16_t type, const std::string &value)
Constructor, used to create options to be sent.
Definition option_string.cc:16
isc::dhcp::Option::Universe
Universe
defines option universe DHCPv4 or DHCPv6
Definition option.h:90
isc::dhcp::Option::Option
Option(Universe u, uint16_t type)
ctor, used for options constructed, usually during transmission
Definition option.cc:39
isc::dhcp::Option::check
void check() const
A protected method used for option correctness.
Definition option.cc:90
isc::util::OutputBuffer
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition buffer.h:346
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::OptionBufferConstIter
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition option.h:30
isc::dhcp::OptionStringPtr
boost::shared_ptr< OptionString > OptionStringPtr
Pointer to the OptionString object.
Definition option_string.h:123
isc::dhcp::OptionPtr
boost::shared_ptr< Option > OptionPtr
Definition option.h:37
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18
option.h