221 :
TLVRecordBuilder(static_cast<uint16_t>(optionType), optionValueAsHexStream, true)
231 :
TLVRecordBuilder(static_cast<uint16_t>(optionType), optionValue, optionValueLen)
252 static_assert(
sizeof(
dhcpv6_header) == 4,
"dhcpv6_header size is not 4 bytes");
347 static inline bool isDataValid(
const uint8_t* data,
size_t dataLen);
373 uint8_t* getOptionsBasePtr()
const
377 dhcpv6_header* getDhcpHeader()
const
379 return reinterpret_cast<dhcpv6_header*
>(m_Data);
381 DhcpV6Option addOptionAt(
const DhcpV6OptionBuilder& optionBuilder,
int offset);
383 TLVRecordReader<DhcpV6Option> m_OptionReader;
390 return (port == 546) || (port == 547);
Definition: DhcpV6Layer.h:257
std::string getMessageTypeAsString() const
DhcpV6Option getNextOptionData(DhcpV6Option dhcpv6Option) const
std::string toString() const override
DhcpV6Option addOptionAfter(const DhcpV6OptionBuilder &optionBuilder, DhcpV6OptionType optionType)
bool removeOption(DhcpV6OptionType optionType)
void setMessageType(DhcpV6MessageType messageType)
DhcpV6Option addOptionBefore(const DhcpV6OptionBuilder &optionBuilder, DhcpV6OptionType optionType)
size_t getHeaderLen() const override
Definition: DhcpV6Layer.h:356
DhcpV6Layer(DhcpV6MessageType messageType, uint32_t transactionId)
void setTransactionID(uint32_t transactionId) const
void parseNextLayer() override
Does nothing for this layer (DhcpV6Layer is always last)
Definition: DhcpV6Layer.h:352
DhcpV6Option getOptionData(DhcpV6OptionType option) const
uint32_t getTransactionID() const
size_t getOptionCount() const
static bool isDataValid(const uint8_t *data, size_t dataLen)
Definition: DhcpV6Layer.h:393
OsiModelLayer getOsiModelLayer() const override
Definition: DhcpV6Layer.h:367
DhcpV6Option getFirstOptionData() const
void computeCalculateFields() override
Does nothing for this layer.
Definition: DhcpV6Layer.h:362
DhcpV6Layer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
DhcpV6MessageType getMessageType() const
DhcpV6Option addOption(const DhcpV6OptionBuilder &optionBuilder)
static bool isDhcpV6Port(uint16_t port)
Definition: DhcpV6Layer.h:388
Definition: DhcpV6Layer.h:214
DhcpV6Option build() const
DhcpV6OptionBuilder(DhcpV6OptionType optionType, const std::string &optionValueAsHexStream)
Definition: DhcpV6Layer.h:220
DhcpV6OptionBuilder(DhcpV6OptionType optionType, const uint8_t *optionValue, uint8_t optionValueLen)
Definition: DhcpV6Layer.h:230
Definition: DhcpV6Layer.h:188
size_t getDataSize() const override
~DhcpV6Option() override=default
A d'tor for this class, currently does nothing.
size_t getTotalSize() const override
std::string getValueAsHexString() const
DhcpV6Option(uint8_t *optionRawData)
Definition: DhcpV6Layer.h:192
DhcpV6OptionType getType() const
Definition: TLVData.h:357
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
An enum representing OSI model layers.
Definition: ProtocolType.h:225
@ OsiModelApplicationLayer
Application layer (layer 7)
Definition: ProtocolType.h:239
DhcpV6MessageType
DHCPv6 message types.
Definition: DhcpV6Layer.h:14
@ DHCPV6_REQUEST
Request message type (Client to Server)
Definition: DhcpV6Layer.h:22
@ DHCPV6_SOLICIT
Solicit message type (Client to Server)
Definition: DhcpV6Layer.h:18
@ DHCPV6_RELAY_REPLY
Relay-Reply message type (Server to Relay agent)
Definition: DhcpV6Layer.h:42
@ DHCPV6_INFORMATION_REQUEST
Information-Request message type (Client to Server)
Definition: DhcpV6Layer.h:38
@ DHCPV6_ADVERTISE
Advertise message type (Server to Client)
Definition: DhcpV6Layer.h:20
@ DHCPV6_REBIND
Rebind message type (Client to Server)
Definition: DhcpV6Layer.h:28
@ DHCPV6_UNKNOWN_MSG_TYPE
Unknown message type.
Definition: DhcpV6Layer.h:16
@ DHCPV6_CONFIRM
Confirm message type (Client to Server)
Definition: DhcpV6Layer.h:24
@ DHCPV6_RENEW
Renew message type (Client to Server)
Definition: DhcpV6Layer.h:26
@ DHCPV6_REPLY
Reply message type (Server to Client)
Definition: DhcpV6Layer.h:30
@ DHCPV6_RECONFIGURE
Reconfigure message type (Server to Client)
Definition: DhcpV6Layer.h:36
@ DHCPV6_DECLINE
Decline message type (Client to Server)
Definition: DhcpV6Layer.h:34
@ DHCPV6_RELEASE
Release message type (Client to Server)
Definition: DhcpV6Layer.h:32
@ DHCPV6_RELAY_FORWARD
Relay-Forward message type (Relay agent to Server)
Definition: DhcpV6Layer.h:40
DhcpV6OptionType
Definition: DhcpV6Layer.h:52
@ DHCPV6_OPT_ERP_LOCAL_DOMAIN_NAME
ERP Local Domain Name.
Definition: DhcpV6Layer.h:173
@ DHCPV6_OPT_NISP_DOMAIN_NAME
Network Information Service v2 (NIS+) domain name.
Definition: DhcpV6Layer.h:112
@ DHCPV6_OPT_CLT_TIME
Client Last Transaction Time.
Definition: DhcpV6Layer.h:143
@ DHCPV6_OPT_CLIENT_DATA
Client Data.
Definition: DhcpV6Layer.h:141
@ DHCPV6_OPT_MUD_URL
Manufacturer Usage Description.
Definition: DhcpV6Layer.h:181
@ DHCPV6_OPT_DOMAIN_LIST
Domain Search List.
Definition: DhcpV6Layer.h:100
@ DHCPV6_OPT_SIP_SERVERS_A
SIP Servers IPv6 Address List.
Definition: DhcpV6Layer.h:96
@ DHCPV6_OPT_PANA_AGENT
Definition: DhcpV6Layer.h:131
@ DHCPV6_OPT_MIP6_HNINF
Mobile IPv6 Home Network Information.
Definition: DhcpV6Layer.h:149
@ DHCPV6_OPT_MIP6_RELAY
Mobile IPv6 Relay Agent.
Definition: DhcpV6Layer.h:151
@ DHCPV6_OPT_IPV6_FQDN_MOS
List of FQDNs for servers providing particular types of IEEE 802.21 Mobility Service (MoS)
Definition: DhcpV6Layer.h:161
@ DHCPV6_OPT_IA_NA
Identity Association for Non-temporary addresses.
Definition: DhcpV6Layer.h:60
@ DHCPV6_OPT_USER_CLASS
User class.
Definition: DhcpV6Layer.h:82
@ DHCPV6_OPT_NIS_SERVERS
Network Information Service (NIS) Servers.
Definition: DhcpV6Layer.h:106
@ DHCPV6_OPT_LQ_QUERY
Query option.
Definition: DhcpV6Layer.h:139
@ DHCPV6_OPT_RELAY_MSG
The DHCP message being relayed by a relay agent.
Definition: DhcpV6Layer.h:72
@ DHCPV6_OPT_SUBSCRIBER_ID
Relay Agent Subscriber ID.
Definition: DhcpV6Layer.h:126
@ DHCPV6_OPT_IA_TA
Identity Association for Temporary addresses.
Definition: DhcpV6Layer.h:62
@ DHCPV6_OPT_LQ_RELAY_DATA
Relay data.
Definition: DhcpV6Layer.h:145
@ DHCPV6_OPT_NTP_SERVER
Network Time Protocol (NTP) or Simple NTP (SNTP) Server Location.
Definition: DhcpV6Layer.h:163
@ DHCPV6_OPT_NEW_POSIX_TIMEZONE
Time zone to be used by the client in IEEE 1003.1 format.
Definition: DhcpV6Layer.h:133
@ DHCPV6_OPT_IPH6_ADDRESS_MOS
List of IPv6 addresses for servers providing particular types of IEEE 802.21 Mobility Service (MoS)
Definition: DhcpV6Layer.h:159
@ DHCPV6_OPT_CLIENT_FQDN
FQDN.
Definition: DhcpV6Layer.h:128
@ DHCPV6_OPT_INTERFACE_ID
Interface ID.
Definition: DhcpV6Layer.h:88
@ DHCPV6_OPT_BOOTFILE_URL
Boot File Uniform Resource Locator (URL)
Definition: DhcpV6Layer.h:165
@ DHCPV6_OPT_NEW_TZDB_TIMEZONE
Time zone (TZ) database entry referred to by entry name.
Definition: DhcpV6Layer.h:135
@ DHCPV6_OPT_BOOTFILE_PARAM
Boot File Parameters.
Definition: DhcpV6Layer.h:167
@ DHCPV6_OPT_DNS_SERVERS
DNS Recursive Name Server.
Definition: DhcpV6Layer.h:98
@ DHCPV6_OPT_CLIENT_ARCH_TYPE
Client System Architecture Type.
Definition: DhcpV6Layer.h:169
@ DHCPV6_OPT_AUTH
Authentication information.
Definition: DhcpV6Layer.h:74
@ DHCPV6_OPT_STATUS_CODE
Status code.
Definition: DhcpV6Layer.h:78
@ DHCPV6_OPT_SIP_SERVERS_D
SIP Servers Domain Name.
Definition: DhcpV6Layer.h:94
@ DHCPV6_OPT_UNKNOWN
Unknown option type.
Definition: DhcpV6Layer.h:54
@ DHCPV6_OPT_IAADDR
IA Address option.
Definition: DhcpV6Layer.h:64
@ DHCPV6_OPT_NIS_DOMAIN_NAME
Network Information Service (NIS) domain name.
Definition: DhcpV6Layer.h:110
@ DHCPV6_OPT_REMOTE_ID
Relay Agent Remote ID.
Definition: DhcpV6Layer.h:124
@ DHCPV6_OPT_RECONF_ACCEPT
Reconfigure Accept.
Definition: DhcpV6Layer.h:92
@ DHCPV6_OPT_RAPID_COMMIT
Rapid commit.
Definition: DhcpV6Layer.h:80
@ DHCPV6_OPT_V6_LOST
Location to Service Translation (LoST) server domain name.
Definition: DhcpV6Layer.h:153
@ DHCPV6_OPT_CAPWAP_AC_V6
Access Points (CAPWAP) Access Controller IPv6 addresses.
Definition: DhcpV6Layer.h:155
@ DHCPV6_OPT_VENDOR_CLASS
Vendor class.
Definition: DhcpV6Layer.h:84
@ DHCPV6_OPT_LQ_CLIENT_LINK
Client link.
Definition: DhcpV6Layer.h:147
@ DHCPV6_OPT_BCMCS_SERVER_A
Broadcast and Multicast Service (BCMCS) IPv6 Address List.
Definition: DhcpV6Layer.h:120
@ DHCPV6_OPT_NII
Client Network Interface Identifier.
Definition: DhcpV6Layer.h:171
@ DHCPV6_OPT_INFORMATION_REFRESH_TIME
Information Refresh.
Definition: DhcpV6Layer.h:116
@ DHCPV6_OPT_IA_PD
Identity Association for Prefix Delegation.
Definition: DhcpV6Layer.h:102
@ DHCPV6_OPT_ELAPSED_TIME
The amount of time since the client began the current DHCP transaction.
Definition: DhcpV6Layer.h:70
@ DHCPV6_OPT_RECONF_MSG
Reconfigure Message.
Definition: DhcpV6Layer.h:90
@ DHCPV6_OPT_BCMCS_SERVER_D
Broadcast and Multicast Service (BCMCS) Domain Name List.
Definition: DhcpV6Layer.h:118
@ DHCPV6_OPT_UNICAST
Server unicast.
Definition: DhcpV6Layer.h:76
@ DHCPV6_OPT_ORO
Option Request Option.
Definition: DhcpV6Layer.h:66
@ DHCPV6_OPT_VENDOR_OPTS
Vendor specific information.
Definition: DhcpV6Layer.h:86
@ DHCPV6_OPT_VSS
Virtual Subnet Selection.
Definition: DhcpV6Layer.h:177
@ DHCPV6_OPT_RELAY_SUPPLIED_OPTIONS
Relay supplied options.
Definition: DhcpV6Layer.h:175
@ DHCPV6_OPT_IAPREFIX
IA_PD Prefix.
Definition: DhcpV6Layer.h:104
@ DHCPV6_OPT_SERVERID
Server Identifier (DUID of server)
Definition: DhcpV6Layer.h:58
@ DHCPV6_OPT_CLIENTID
Client Identifier (DUID of client)
Definition: DhcpV6Layer.h:56
@ DHCPV6_OPT_ERO
Relay Agent Echo Request.
Definition: DhcpV6Layer.h:137
@ DHCPV6_OPT_CLIENT_LINKLAYER_ADDR
Client link layer.
Definition: DhcpV6Layer.h:179
@ DHCPV6_OPT_GEOCONF_CIVIC
Geographical location in civic (e.g., postal) format.
Definition: DhcpV6Layer.h:122
@ DHCPV6_OPT_PREFERENCE
Preference setting.
Definition: DhcpV6Layer.h:68
@ DHCPV6_OPT_SNTP_SERVERS
Simple Network Time Protocol (SNTP) servers.
Definition: DhcpV6Layer.h:114
@ DHCPV6_OPT_RELAY_ID
DHCPv6 Bulk LeaseQuery.
Definition: DhcpV6Layer.h:157
@ DHCPV6_OPT_NISP_SERVERS
Network Information Service v2 (NIS+) Servers.
Definition: DhcpV6Layer.h:108