1 #ifndef PACKETPP_DHCP_LAYER 2 #define PACKETPP_DHCP_LAYER 419 return getValueAs<uint32_t>();
431 setValue<uint32_t>(addr.
toInt(), valueOffset);
443 if (m_Data->recordLen - valueOffset < 1)
446 return std::string((
const char*)m_Data->recordValue + valueOffset, (
int)m_Data->recordLen - valueOffset);
460 size_t len = (size_t)m_Data->recordLen - (
size_t)valueOffset;
463 if (stringValue.length() < len)
464 len = stringValue.length();
466 memcpy(m_Data->recordValue + valueOffset, stringValue.data(), len);
475 return sizeof(uint8_t);
477 return sizeof(uint8_t) * 2 + (
size_t)m_Data->recordLen;
485 return m_Data->recordLen;
567 TLVRecordBuilder::operator=(other);
681 void setClientHardwareAddress(
const MacAddress& addr);
725 size_t getOptionsCount()
const;
755 bool removeAllOptions();
778 void computeCalculateFields();
780 std::string toString()
const;
786 uint8_t* getOptionsBasePtr()
const {
return m_Data +
sizeof(
dhcp_header); }
790 void initDhcpLayer(
size_t numOfBytesToAllocate);
Definition: DhcpLayer.h:153
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:253
Definition: DhcpLayer.h:273
Definition: DhcpLayer.h:297
Definition: DhcpLayer.h:323
Definition: DhcpLayer.h:169
Definition: DhcpLayer.h:329
Definition: DhcpLayer.h:227
IPv4Address getValueAsIpAddr() const
Definition: DhcpLayer.h:417
Definition: DhcpLayer.h:213
Definition: DhcpLayer.h:143
Definition: DhcpLayer.h:261
Definition: DhcpLayer.h:335
std::string getValueAsString(int valueOffset=0) const
Definition: DhcpLayer.h:441
Definition: DhcpLayer.h:299
Definition: DhcpLayer.h:107
Definition: DhcpLayer.h:357
Definition: DhcpLayer.h:207
Definition: DhcpLayer.h:359
Definition: DhcpLayer.h:263
DhcpOptionBuilder(DhcpOptionTypes optionType, uint8_t optionValue)
Definition: DhcpLayer.h:515
Definition: DhcpLayer.h:141
DhcpOptionBuilder(DhcpOptionTypes optionType, uint16_t optionValue)
Definition: DhcpLayer.h:524
Definition: DhcpLayer.h:367
Definition: DhcpLayer.h:375
Definition: DhcpLayer.h:81
Definition: DhcpLayer.h:383
Definition: DhcpLayer.h:89
Definition: ProtocolType.h:268
Definition: DhcpLayer.h:155
DhcpOptionBuilder(DhcpOptionTypes optionType, const uint8_t *optionValue, uint8_t optionValueLen)
Definition: DhcpLayer.h:506
Definition: DhcpLayer.h:279
Definition: TLVData.h:351
Definition: DhcpLayer.h:67
Definition: DhcpLayer.h:127
Definition: DhcpLayer.h:317
Definition: DhcpLayer.h:363
Definition: DhcpLayer.h:217
void setGatewayIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:668
Definition: DhcpLayer.h:225
Definition: DhcpLayer.h:85
Definition: DhcpLayer.h:315
Definition: DhcpLayer.h:203
IPv4Address getGatewayIpAddress() const
Definition: DhcpLayer.h:662
Definition: DhcpLayer.h:398
Definition: DhcpLayer.h:355
Definition: DhcpLayer.h:385
Definition: DhcpLayer.h:147
void setYourIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:657
Definition: DhcpLayer.h:341
Definition: DhcpLayer.h:117
Definition: DhcpLayer.h:319
Definition: DhcpLayer.h:343
Definition: DhcpLayer.h:381
Definition: DhcpLayer.h:311
Definition: DhcpLayer.h:243
Definition: DhcpLayer.h:247
void setValueIpAddr(const IPv4Address &addr, int valueOffset=0)
Definition: DhcpLayer.h:429
Definition: DhcpLayer.h:123
Definition: DhcpLayer.h:79
Definition: DhcpLayer.h:265
Definition: DhcpLayer.h:379
DhcpOptionTypes
Definition: DhcpLayer.h:97
Definition: DhcpLayer.h:333
Definition: DhcpLayer.h:361
Definition: DhcpLayer.h:351
Definition: DhcpLayer.h:281
Definition: DhcpLayer.h:231
Definition: TLVData.h:197
void parseNextLayer()
Definition: DhcpLayer.h:762
Definition: DhcpLayer.h:179
Definition: DhcpLayer.h:285
Definition: DhcpLayer.h:267
size_t getTotalSize() const
Definition: DhcpLayer.h:472
Definition: DhcpLayer.h:157
Definition: DhcpLayer.h:75
Definition: DhcpLayer.h:584
Definition: DhcpLayer.h:151
Definition: DhcpLayer.h:145
Definition: DhcpLayer.h:149
Definition: DhcpLayer.h:389
Definition: DhcpLayer.h:201
Definition: DhcpLayer.h:173
Definition: DhcpLayer.h:241
IPv4Address getYourIpAddress() const
Definition: DhcpLayer.h:651
Definition: DhcpLayer.h:257
Definition: DhcpLayer.h:353
Definition: DhcpLayer.h:111
Definition: DhcpLayer.h:373
BootpOpCodes getOpCode() const
Definition: DhcpLayer.h:624
Definition: DhcpLayer.h:205
Definition: DhcpLayer.h:291
DhcpOptionBuilder(DhcpOptionTypes optionType, const std::string &optionValue)
Definition: DhcpLayer.h:551
Definition: DhcpLayer.h:199
Definition: DhcpLayer.h:371
BootpOpCodes
Definition: DhcpLayer.h:62
Definition: DhcpLayer.h:235
Definition: DhcpLayer.h:159
void setClientIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:635
dhcp_header * getDhcpHeader() const
Definition: DhcpLayer.h:619
Definition: IpAddress.h:26
Definition: DhcpLayer.h:269
Definition: DhcpLayer.h:103
Definition: DhcpLayer.h:121
virtual ~DhcpOption()
Definition: DhcpLayer.h:411
DhcpOptionBuilder(DhcpOptionTypes optionType, uint32_t optionValue)
Definition: DhcpLayer.h:533
Definition: DhcpLayer.h:295
Definition: DhcpLayer.h:139
Definition: DhcpLayer.h:195
Definition: DhcpLayer.h:101
Definition: DhcpLayer.h:255
size_t getHeaderLen() const
Definition: DhcpLayer.h:767
Definition: DhcpLayer.h:105
void setServerIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:646
Definition: DhcpLayer.h:129
Definition: DhcpLayer.h:309
Definition: DhcpLayer.h:239
Definition: DhcpLayer.h:349
Definition: DhcpLayer.h:197
Definition: DhcpLayer.h:223
Definition: DhcpLayer.h:369
Definition: DhcpLayer.h:185
DhcpMessageType
Definition: DhcpLayer.h:73
Definition: DhcpLayer.h:181
Definition: DhcpLayer.h:325
DhcpOptionBuilder(DhcpOptionTypes optionType, const IPv4Address &optionValue)
Definition: DhcpLayer.h:542
Definition: DhcpLayer.h:135
IPv4Address getClientIpAddress() const
Definition: DhcpLayer.h:629
Definition: DhcpLayer.h:221
Definition: DhcpLayer.h:249
Definition: DhcpLayer.h:387
Definition: DhcpLayer.h:65
DhcpOptionBuilder(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:558
Definition: DhcpLayer.h:229
Definition: DhcpLayer.h:211
Definition: DhcpLayer.h:137
Definition: DhcpLayer.h:119
Definition: DhcpLayer.h:303
Definition: DhcpLayer.h:175
Definition: DhcpLayer.h:189
Definition: DhcpLayer.h:337
Definition: DhcpLayer.h:321
Definition: DhcpLayer.h:209
Definition: DhcpLayer.h:83
Definition: DhcpLayer.h:293
Definition: DhcpLayer.h:495
Definition: DhcpLayer.h:275
Definition: DhcpLayer.h:345
Definition: DhcpLayer.h:287
Definition: DhcpLayer.h:237
Definition: DhcpLayer.h:115
Definition: DhcpLayer.h:365
Definition: DhcpLayer.h:125
Definition: DhcpLayer.h:307
Definition: DhcpLayer.h:245
size_t getDataSize() const
Definition: DhcpLayer.h:480
Definition: DhcpLayer.h:377
Definition: DhcpLayer.h:109
Definition: DhcpLayer.h:253
Definition: DhcpLayer.h:177
Definition: DhcpLayer.h:313
Definition: DhcpLayer.h:133
Definition: DhcpLayer.h:131
Definition: DhcpLayer.h:259
Definition: DhcpLayer.h:215
OsiModelLayer getOsiModelLayer() const
Definition: DhcpLayer.h:782
Definition: DhcpLayer.h:187
virtual ~DhcpLayer()
Definition: DhcpLayer.h:613
Definition: DhcpLayer.h:91
void setValueString(const std::string &stringValue, int valueOffset=0)
Definition: DhcpLayer.h:457
Definition: DhcpLayer.h:167
Definition: DhcpLayer.h:191
DhcpOptionBuilder & operator=(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:565
Definition: DhcpLayer.h:219
Definition: DhcpLayer.h:87
DhcpOption(uint8_t *optionRawData)
Definition: DhcpLayer.h:406
Definition: DhcpLayer.h:251
Definition: DhcpLayer.h:301
Definition: DhcpLayer.h:171
Definition: DhcpLayer.h:77
Definition: DhcpLayer.h:113
Definition: DhcpLayer.h:161
Definition: MacAddress.h:27
Definition: DhcpLayer.h:165
Definition: DhcpLayer.h:331
Definition: DhcpLayer.h:289
Definition: DhcpLayer.h:193
Definition: DhcpLayer.h:233
Definition: DhcpLayer.h:277
Definition: DhcpLayer.h:339
Definition: DhcpLayer.h:183
uint32_t toInt() const
Definition: IpAddress.h:149
IPv4Address getServerIpAddress() const
Definition: DhcpLayer.h:640
Definition: DhcpLayer.h:283
Definition: DhcpLayer.h:99
Definition: DhcpLayer.h:271
Definition: DhcpLayer.h:305
Definition: DhcpLayer.h:163
Definition: DhcpLayer.h:347
Definition: DhcpLayer.h:327