Kea 2.7.6
option_vendor.h
Go to the documentation of this file.
1// Copyright (C) 2013-2024 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>
13
14#include <stdint.h>
15
16namespace isc {
17namespace dhcp {
18
23
29class OptionVendor: public Option {
30public:
35 OptionVendor(Option::Universe u, const uint32_t vendor_id);
36
51
53 OptionPtr clone() const;
54
60 virtual void pack(isc::util::OutputBuffer& buf, bool check = true) const;
61
74 virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end);
75
79 void setVendorId(const uint32_t vendor_id) {
80 vendor_id_ = vendor_id;
81 }
82
86 uint32_t getVendorId() const {
87 return (vendor_id_);
88 }
89
95 virtual uint16_t len() const;
96
102 virtual std::string toText(int indent = 0) const;
103
104private:
105
107 uint32_t vendor_id_;
108};
109
111typedef boost::shared_ptr<OptionVendor> OptionVendorPtr;
112
113} // isc::dhcp namespace
114} // isc namespace
115
116#endif // OPTION_VENDOR_H
This class represents vendor-specific information option.
uint32_t getVendorId() const
Returns enterprise identifier.
OptionVendor(Option::Universe u, const uint32_t vendor_id)
Constructor.
virtual uint16_t len() const
returns complete length of option
OptionPtr clone() const
Copies this option and returns a pointer to the copy.
void setVendorId(const uint32_t vendor_id)
Sets enterprise identifier.
virtual void unpack(OptionBufferConstIter begin, OptionBufferConstIter end)
Parses received buffer.
virtual std::string toText(int indent=0) const
Returns the option in the textual format.
virtual void pack(isc::util::OutputBuffer &buf, bool check=true) const
Writes option in wire-format to buf, returns pointer to first unused byte after stored option.
Universe
defines option universe DHCPv4 or DHCPv6
Definition option.h:90
void check() const
A protected method used for option correctness.
Definition option.cc:90
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Definition buffer.h:343
boost::shared_ptr< OptionVendor > OptionVendorPtr
Pointer to a vendor option.
const int VENDOR_CLASS_DATA_LEN_INDEX
OptionBuffer::const_iterator OptionBufferConstIter
const_iterator for walking over OptionBuffer
Definition option.h:30
const int VENDOR_CLASS_STRING_INDEX
const int VENDOR_CLASS_ENTERPRISE_ID_INDEX
Indexes for fields in vendor-class (17) DHCPv6 option.
boost::shared_ptr< Option > OptionPtr
Definition option.h:37
Defines the logger used by the top-level component of kea-lfc.