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