Kea 1.5.0
option_string.h
Go to the documentation of this file.
1// Copyright (C) 2013-2017 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
27class OptionString : public Option {
28public:
29
42 OptionString(const Option::Universe u, const uint16_t type,
43 const std::string& value);
44
56 OptionString(const Option::Universe u, const uint16_t type,
58
60 OptionPtr clone() const;
61
65 virtual uint16_t len() const;
66
70 std::string getValue() const;
71
77 void setValue(const std::string& value);
78
86 virtual void pack(isc::util::OutputBuffer& buf) const;
87
99 virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
100
107 virtual std::string toText(int indent = 0) const;
108
113 virtual std::string toString() const;
114};
115
117typedef boost::shared_ptr<OptionString> OptionStringPtr;
118
119} // namespace isc::dhcp
120} // namespace isc
121
122#endif // OPTION_STRING_H
Class which represents an option carrying a single string value.
Definition: option_string.h:27
virtual void pack(isc::util::OutputBuffer &buf) const
Creates on-wire format of the option.
void setValue(const std::string &value)
Sets the string value to be held by the option.
OptionPtr clone() const
Copies this option and returns a pointer to the copy.
virtual uint16_t len() const
Returns length of the whole option, including header.
virtual std::string toString() const
Returns actual value of the option in string format.
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Decodes option data from the provided buffer.
std::string getValue() const
Returns the string value held by the option.
virtual std::string toText(int indent=0) const
Returns option information in the textual format.
Universe
defines option universe DHCPv4 or DHCPv6
Definition: option.h:67
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition: buffer.h:294
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition: option.h:31
boost::shared_ptr< OptionString > OptionStringPtr
Pointer to the OptionString object.
boost::shared_ptr< Option > OptionPtr
Definition: option.h:38
Defines the logger used by the top-level component of kea-dhcp-ddns.