|
PcapPlusPlus
19.12
|
Go to the documentation of this file. 1 #ifndef PACKETPP_DHCP_LAYER
2 #define PACKETPP_DHCP_LAYER
419 uint32_t addrAsInt = getValueAs<uint32_t>();
432 setValue<uint32_t>(addr.
toInt(), valueOffset);
447 return std::string((
const char*)m_Data->
recordValue + valueOffset, (
int)m_Data->
recordLen - valueOffset);
460 std::string val = stringValue;
461 if (stringValue.length() > (size_t)m_Data->
recordLen - (
size_t)valueOffset)
462 val = stringValue.substr(0, (
size_t)m_Data->
recordLen - valueOffset);
464 memcpy(m_Data->
recordValue + valueOffset, val.c_str(), val.length());
473 return sizeof(uint8_t);
475 return sizeof(uint8_t)*2 + (
size_t)m_Data->
recordLen;
774 uint8_t* getOptionsBasePtr()
const {
return m_Data +
sizeof(
dhcp_header); }
776 TLVRecordReader<DhcpOption> m_OptionReader;
778 void initDhcpLayer(
size_t numOfBytesToAllocate);
780 DhcpOption addOptionAt(
const DhcpOptionBuilder& optionBuilder,
int offset);
Definition: DhcpLayer.h:169
Definition: DhcpLayer.h:277
IPv4Address getServerIpAddress() const
Definition: DhcpLayer.h:339
OsiModelLayer
Definition: ProtocolType.h:224
Definition: DhcpLayer.h:271
DhcpOption getFirstOptionData() const
Definition: DhcpLayer.h:305
Definition: DhcpLayer.h:347
Definition: IpAddress.h:119
Definition: DhcpLayer.h:261
Definition: DhcpLayer.h:327
Definition: DhcpLayer.h:299
Definition: DhcpLayer.h:207
Definition: DhcpLayer.h:263
Definition: DhcpLayer.h:359
IPv4Address getGatewayIpAddress() const
Definition: DhcpLayer.h:367
Definition: DhcpLayer.h:81
DhcpOption getNextOptionData(DhcpOption dhcpOption) const
Definition: ProtocolType.h:239
Definition: DhcpLayer.h:297
Definition: DhcpLayer.h:329
Definition: DhcpLayer.h:279
Definition: DhcpLayer.h:227
Definition: DhcpLayer.h:67
virtual ~DhcpLayer()
Definition: DhcpLayer.h:601
Definition: DhcpLayer.h:213
Definition: DhcpLayer.h:143
uint8_t recordType
Definition: TLVData.h:31
Definition: DhcpLayer.h:335
Definition: DhcpLayer.h:107
Definition: DhcpLayer.h:357
Definition: DhcpLayer.h:315
Definition: DhcpLayer.h:355
Definition: DhcpLayer.h:141
DhcpOption addOption(const DhcpOptionBuilder &optionBuilder)
void computeCalculateFields()
void setClientHardwareAddress(const MacAddress &addr)
Definition: DhcpLayer.h:147
Definition: DhcpLayer.h:375
Definition: DhcpLayer.h:341
Definition: DhcpLayer.h:383
DhcpOptionBuilder(DhcpOptionTypes optionType, uint16_t optionValue)
Definition: DhcpLayer.h:522
IPv4Address getYourIpAddress() const
Definition: DhcpLayer.h:398
Definition: DhcpLayer.h:89
Definition: DhcpLayer.h:343
Definition: DhcpLayer.h:155
Definition: DhcpLayer.h:311
DhcpOptionTypes
Definition: DhcpLayer.h:97
Definition: DhcpLayer.h:247
Definition: DhcpLayer.h:127
Definition: DhcpLayer.h:317
Definition: DhcpLayer.h:363
Definition: DhcpLayer.h:79
Definition: DhcpLayer.h:217
size_t getTotalSize() const
Definition: DhcpLayer.h:470
Definition: DhcpLayer.h:225
Definition: DhcpLayer.h:85
Definition: DhcpLayer.h:203
Definition: DhcpLayer.h:379
Definition: DhcpLayer.h:333
Definition: DhcpLayer.h:385
void setYourIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:361
Definition: DhcpLayer.h:319
Definition: DhcpLayer.h:117
Definition: DhcpLayer.h:381
Definition: DhcpLayer.h:243
DhcpOptionBuilder(DhcpOptionTypes optionType, const uint8_t *optionValue, uint8_t optionValueLen)
Definition: DhcpLayer.h:504
Definition: DhcpLayer.h:285
Definition: DhcpLayer.h:123
Definition: DhcpLayer.h:157
Definition: DhcpLayer.h:265
Definition: DhcpLayer.h:389
Definition: DhcpLayer.h:145
Definition: DhcpLayer.h:493
size_t getHeaderLen() const
Definition: DhcpLayer.h:755
Definition: DhcpLayer.h:241
size_t getOptionsCount() const
Definition: DhcpLayer.h:257
dhcp_header * getDhcpHeader() const
Definition: DhcpLayer.h:607
Definition: MacAddress.h:27
BootpOpCodes
Definition: DhcpLayer.h:62
Definition: DhcpLayer.h:351
Definition: DhcpLayer.h:231
Definition: DhcpLayer.h:281
void parseNextLayer()
Definition: DhcpLayer.h:750
Definition: DhcpLayer.h:179
Definition: DhcpLayer.h:267
Definition: DhcpLayer.h:205
Definition: DhcpLayer.h:75
Definition: DhcpLayer.h:199
Definition: DhcpLayer.h:151
Definition: DhcpLayer.h:149
Definition: DhcpLayer.h:201
Definition: DhcpLayer.h:173
Definition: DhcpLayer.h:269
DhcpOption(uint8_t *optionRawData)
Definition: DhcpLayer.h:406
Definition: DhcpLayer.h:103
Definition: DhcpLayer.h:353
Definition: DhcpLayer.h:121
DhcpOptionBuilder(DhcpOptionTypes optionType, uint32_t optionValue)
Definition: DhcpLayer.h:531
IPv4Address getValueAsIpAddr() const
Definition: DhcpLayer.h:417
Definition: DhcpLayer.h:295
Definition: DhcpLayer.h:111
DhcpOption getOptionData(DhcpOptionTypes option) const
Definition: DhcpLayer.h:139
Definition: DhcpLayer.h:195
Definition: DhcpLayer.h:373
std::string toString() const
DhcpMessageType
Definition: DhcpLayer.h:73
Definition: DhcpLayer.h:255
Definition: DhcpLayer.h:291
void setServerIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:371
Definition: DhcpLayer.h:235
Definition: DhcpLayer.h:159
void setClientIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:309
DhcpOptionBuilder(DhcpOptionTypes optionType, const IPv4Address &optionValue)
Definition: DhcpLayer.h:540
Definition: DhcpLayer.h:223
Definition: DhcpLayer.h:369
Definition: DhcpLayer.h:325
Definition: DhcpLayer.h:135
BootpOpCodes getOpCode() const
Definition: DhcpLayer.h:612
Definition: DhcpLayer.h:221
Definition: DhcpLayer.h:387
Definition: DhcpLayer.h:101
MacAddress getClientHardwareAddress() const
The main namespace for the PcapPlusPlus lib.
Definition: DhcpLayer.h:105
Definition: DhcpLayer.h:211
Definition: DhcpLayer.h:137
Definition: DhcpLayer.h:129
DhcpOptionBuilder(DhcpOptionTypes optionType, const std::string &optionValue)
Definition: DhcpLayer.h:549
Definition: TLVData.h:351
Definition: DhcpLayer.h:239
Definition: DhcpLayer.h:119
std::string getValueAsString(int valueOffset=0) const
Definition: DhcpLayer.h:442
Definition: DhcpLayer.h:349
Definition: DhcpLayer.h:197
virtual ~DhcpOption()
Definition: DhcpLayer.h:411
size_t getDataSize() const
Definition: DhcpLayer.h:478
Definition: DhcpLayer.h:185
Definition: DhcpLayer.h:181
Definition: DhcpLayer.h:209
Definition: DhcpLayer.h:83
DhcpOption addOptionAfter(const DhcpOptionBuilder &optionBuilder, DhcpOptionTypes prevOption)
Definition: DhcpLayer.h:249
Definition: DhcpLayer.h:65
Definition: DhcpLayer.h:572
Definition: DhcpLayer.h:345
Definition: DhcpLayer.h:287
Definition: DhcpLayer.h:229
void setValueString(const std::string &stringValue, int valueOffset=0)
Definition: DhcpLayer.h:458
Definition: DhcpLayer.h:307
Definition: DhcpLayer.h:245
bool setMesageType(DhcpMessageType msgType)
Definition: DhcpLayer.h:377
Definition: DhcpLayer.h:109
Definition: DhcpLayer.h:303
Definition: DhcpLayer.h:177
Definition: DhcpLayer.h:313
Definition: DhcpLayer.h:133
Definition: DhcpLayer.h:175
Definition: DhcpLayer.h:189
Definition: DhcpLayer.h:337
Definition: DhcpLayer.h:321
IPv4Address getClientIpAddress() const
Definition: DhcpLayer.h:131
uint8_t recordValue[]
Definition: TLVData.h:35
Definition: DhcpLayer.h:293
Definition: DhcpLayer.h:275
Definition: DhcpLayer.h:187
Definition: DhcpLayer.h:237
Definition: DhcpLayer.h:115
Definition: DhcpLayer.h:87
Definition: DhcpLayer.h:365
Definition: DhcpLayer.h:125
bool removeOption(DhcpOptionTypes optionType)
Definition: DhcpLayer.h:301
Definition: DhcpLayer.h:113
DhcpOptionBuilder(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:556
Definition: DhcpLayer.h:165
Definition: DhcpLayer.h:193
Definition: DhcpLayer.h:233
Definition: DhcpLayer.h:253
Definition: DhcpLayer.h:259
Definition: DhcpLayer.h:183
OsiModelLayer getOsiModelLayer() const
Definition: DhcpLayer.h:770
Definition: DhcpLayer.h:283
Definition: DhcpLayer.h:215
Definition: DhcpLayer.h:99
uint8_t recordLen
Definition: TLVData.h:33
Definition: DhcpLayer.h:163
Definition: DhcpLayer.h:91
void setValueIpAddr(const IPv4Address &addr, int valueOffset=0)
Definition: DhcpLayer.h:430
DhcpOptionBuilder(DhcpOptionTypes optionType, uint8_t optionValue)
Definition: DhcpLayer.h:513
Definition: DhcpLayer.h:167
Definition: DhcpLayer.h:191
Definition: DhcpLayer.h:219
Definition: DhcpLayer.h:153
Definition: DhcpLayer.h:273
void setGatewayIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:251
Definition: DhcpLayer.h:171
Definition: DhcpLayer.h:77
DhcpMessageType getMesageType() const
Definition: DhcpLayer.h:161
Definition: DhcpLayer.h:331
Definition: DhcpLayer.h:289
Definition: DhcpLayer.h:323