Kea  1.9.9-git
option_vendor.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2018 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_VENDOR_H
8 #define OPTION_VENDOR_H
9 
10 #include <dhcp/libdhcp++.h>
11 #include <dhcp/option.h>
12 #include <dhcp/option_data_types.h>
13 #include <util/io_utilities.h>
14 
15 #include <stdint.h>
16 
17 namespace isc {
18 namespace dhcp {
19 
24 
30 class OptionVendor: public Option {
31 public:
36  OptionVendor(Option::Universe u, const uint32_t vendor_id);
37 
52 
54  OptionPtr clone() const;
55 
60  virtual void pack(isc::util::OutputBuffer& buf) const;
61 
74  virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
75 
79  void setVendorId(const uint32_t vendor_id) { vendor_id_ = vendor_id; }
80 
84  uint32_t getVendorId() const { return (vendor_id_); }
85 
91  virtual uint16_t len() const;
92 
98  virtual std::string toText(int indent = 0) const;
99 
100 private:
101 
110  uint8_t dataLen() const;
111 
112  uint32_t vendor_id_;
113 };
114 
116 typedef boost::shared_ptr<OptionVendor> OptionVendorPtr;
117 
118 } // isc::dhcp namespace
119 } // isc namespace
120 
121 #endif // OPTION_VENDOR_H
const int VENDOR_CLASS_STRING_INDEX
Definition: option_vendor.h:23
OptionVendor(Option::Universe u, const uint32_t vendor_id)
Constructor.
boost::shared_ptr< Option > OptionPtr
Definition: option.h:36
Universe
defines option universe DHCPv4 or DHCPv6
Definition: option.h:82
virtual std::string toText(int indent=0) const
Returns the option in the textual format.
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received buffer.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition: buffer.h:294
const int VENDOR_CLASS_DATA_LEN_INDEX
Definition: option_vendor.h:22
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition: option.h:30
Defines the logger used by the top-level component of kea-dhcp-ddns.
const int VENDOR_CLASS_ENTERPRISE_ID_INDEX
Indexes for fields in vendor-class (17) DHCPv6 option.
Definition: option_vendor.h:21
OptionPtr clone() const
Copies this option and returns a pointer to the copy.
virtual void pack(isc::util::OutputBuffer &buf) const
Writes option in wire-format to buf, returns pointer to first unused byte after stored option...
boost::shared_ptr< OptionVendor > OptionVendorPtr
Pointer to a vendor option.
void setVendorId(const uint32_t vendor_id)
Sets enterprise identifier.
Definition: option_vendor.h:79
virtual uint16_t len() const
returns complete length of option
This class represents vendor-specific information option.
Definition: option_vendor.h:30
uint32_t getVendorId() const
Returns enterprise identifier.
Definition: option_vendor.h:84