PcapPlusPlus  20.08
DhcpLayer.h
Go to the documentation of this file.
1 #ifndef PACKETPP_DHCP_LAYER
2 #define PACKETPP_DHCP_LAYER
3 
4 #include "Layer.h"
5 #include "TLVData.h"
6 #include "IpAddress.h"
7 #include "MacAddress.h"
8 #include <string.h>
9 
11 
16 namespace pcpp
17 {
18 
23  #pragma pack(push, 1)
24  struct dhcp_header {
26  uint8_t opCode;
28  uint8_t hardwareType;
32  uint8_t hops;
34  uint32_t transactionID;
36  uint16_t secondsElapsed;
38  uint16_t flags;
40  uint32_t clientIpAddress;
42  uint32_t yourIpAddress;
44  uint32_t serverIpAddress;
46  uint32_t gatewayIpAddress;
48  uint8_t clientHardwareAddress[16];
50  uint8_t serverName[64];
52  uint8_t bootFilename[128];
54  uint32_t magicNumber;
55  };
56  #pragma pack(pop)
57 
58 
63  {
68  };
69 
85  DHCP_ACK = 5,
87  DHCP_NAK = 6,
92  };
93 
305  DHCPOPT_URL = 114,
319  DHCPOPT_CCC = 122,
390  };
391 
392 
398  class DhcpOption : public TLVRecord
399  {
400  public:
401 
406  DhcpOption(uint8_t* optionRawData) : TLVRecord(optionRawData) { }
407 
411  virtual ~DhcpOption() { }
412 
418  {
419  return getValueAs<uint32_t>();
420  }
421 
429  void setValueIpAddr(const IPv4Address& addr, int valueOffset = 0)
430  {
431  setValue<uint32_t>(addr.toInt(), valueOffset);
432  }
433 
441  std::string getValueAsString(int valueOffset = 0) const
442  {
443  if (m_Data->recordLen - valueOffset < 1)
444  return "";
445 
446  return std::string((const char*)m_Data->recordValue + valueOffset, (int)m_Data->recordLen - valueOffset);
447  }
448 
457  void setValueString(const std::string& stringValue, int valueOffset = 0)
458  {
459  // calculate the maximum length of the destination buffer
460  size_t len = (size_t)m_Data->recordLen - (size_t)valueOffset;
461 
462  // use the length of input string if a buffer is large enough for whole string
463  if (stringValue.length() < len)
464  len = stringValue.length();
465 
466  memcpy(m_Data->recordValue + valueOffset, stringValue.data(), len);
467  }
468 
469 
470  // implement abstract methods
471 
472  size_t getTotalSize() const
473  {
474  if (m_Data->recordType == (uint8_t)DHCPOPT_END || m_Data->recordType == (uint8_t)DHCPOPT_PAD)
475  return sizeof(uint8_t);
476 
477  return sizeof(uint8_t) * 2 + (size_t)m_Data->recordLen;
478  }
479 
480  size_t getDataSize() const
481  {
482  if (m_Data->recordType == (uint8_t)DHCPOPT_END || m_Data->recordType == (uint8_t)DHCPOPT_PAD)
483  return 0;
484 
485  return m_Data->recordLen;
486  }
487  };
488 
489 
496  {
497  public:
498 
506  DhcpOptionBuilder(DhcpOptionTypes optionType, const uint8_t* optionValue, uint8_t optionValueLen) :
507  TLVRecordBuilder((uint8_t)optionType, optionValue, optionValueLen) { }
508 
515  DhcpOptionBuilder(DhcpOptionTypes optionType, uint8_t optionValue) :
516  TLVRecordBuilder((uint8_t)optionType, optionValue) { }
517 
524  DhcpOptionBuilder(DhcpOptionTypes optionType, uint16_t optionValue) :
525  TLVRecordBuilder((uint8_t)optionType, optionValue) { }
526 
533  DhcpOptionBuilder(DhcpOptionTypes optionType, uint32_t optionValue) :
534  TLVRecordBuilder((uint8_t)optionType, optionValue) { }
535 
542  DhcpOptionBuilder(DhcpOptionTypes optionType, const IPv4Address& optionValue) :
543  TLVRecordBuilder((uint8_t)optionType, optionValue) { }
544 
551  DhcpOptionBuilder(DhcpOptionTypes optionType, const std::string& optionValue) :
552  TLVRecordBuilder((uint8_t)optionType, optionValue) { }
553 
559  TLVRecordBuilder(other) { }
560 
566  {
567  TLVRecordBuilder::operator=(other);
568  return *this;
569  }
570 
575  DhcpOption build() const;
576  };
577 
578 
579 
584  class DhcpLayer : public Layer
585  {
586  public:
587 
595  DhcpLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet);
596 
603  DhcpLayer(DhcpMessageType msgType, const MacAddress& clientMacAddr);
604 
608  DhcpLayer();
609 
613  virtual ~DhcpLayer() {}
614 
619  dhcp_header* getDhcpHeader() const { return (dhcp_header*)m_Data; }
620 
625 
630 
636 
641 
647 
652 
657  void setYourIpAddress(const IPv4Address& addr) { getDhcpHeader()->yourIpAddress = addr.toInt(); }
658 
663 
669 
675 
681  void setClientHardwareAddress(const MacAddress& addr);
682 
688 
697  bool setMesageType(DhcpMessageType msgType);
698 
704 
712  DhcpOption getNextOptionData(DhcpOption dhcpOption) const;
713 
721 
725  size_t getOptionsCount() const;
726 
733  DhcpOption addOption(const DhcpOptionBuilder& optionBuilder);
734 
742  DhcpOption addOptionAfter(const DhcpOptionBuilder& optionBuilder, DhcpOptionTypes prevOption);
743 
749  bool removeOption(DhcpOptionTypes optionType);
750 
755  bool removeAllOptions();
756 
757  // implement abstract methods
758 
762  void parseNextLayer() {}
763 
767  size_t getHeaderLen() const { return m_DataLen; }
768 
778  void computeCalculateFields();
779 
780  std::string toString() const;
781 
783 
784  private:
785 
786  uint8_t* getOptionsBasePtr() const { return m_Data + sizeof(dhcp_header); }
787 
788  TLVRecordReader<DhcpOption> m_OptionReader;
789 
790  void initDhcpLayer(size_t numOfBytesToAllocate);
791 
792  DhcpOption addOptionAt(const DhcpOptionBuilder& optionBuilder, int offset);
793  };
794 }
795 
796 #endif /* PACKETPP_DHCP_LAYER */
pcpp::DHCPOPT_TRAILER_ENCAPSULATION
@ DHCPOPT_TRAILER_ENCAPSULATION
Definition: DhcpLayer.h:169
pcpp::DHCPOPT_BCMCS_CONTROLLER_IPV4_ADDRESS
@ DHCPOPT_BCMCS_CONTROLLER_IPV4_ADDRESS
Definition: DhcpLayer.h:277
pcpp::DhcpLayer::getServerIpAddress
IPv4Address getServerIpAddress() const
Definition: DhcpLayer.h:640
pcpp::DHCPOPT_OPTION_IPV4_ADDRESS_ANDSF
@ DHCPOPT_OPTION_IPV4_ADDRESS_ANDSF
Definition: DhcpLayer.h:339
pcpp::OsiModelLayer
OsiModelLayer
Definition: ProtocolType.h:233
pcpp::DHCPOPT_NDS_TREE_NAME
@ DHCPOPT_NDS_TREE_NAME
Definition: DhcpLayer.h:271
pcpp::TLVRecord
Definition: TLVData.h:23
pcpp::DhcpLayer::getFirstOptionData
DhcpOption getFirstOptionData() const
pcpp::DHCPOPT_URL
@ DHCPOPT_URL
Definition: DhcpLayer.h:305
pcpp::DHCPOPT_STATUS_CODE
@ DHCPOPT_STATUS_CODE
Definition: DhcpLayer.h:347
pcpp::IPv4Address
Definition: IpAddress.h:26
pcpp::DHCPOPT_RAPID_COMMIT
@ DHCPOPT_RAPID_COMMIT
Definition: DhcpLayer.h:261
pcpp::Packet
Definition: Packet.h:26
pcpp::DHCPOPT_OPTION_PANA_AGENT
@ DHCPOPT_OPTION_PANA_AGENT
Definition: DhcpLayer.h:327
pcpp::DHCPOPT_TCODE
@ DHCPOPT_TCODE
Definition: DhcpLayer.h:299
pcpp::DHCPOPT_DHCP_MESSAGE_TYPE
@ DHCPOPT_DHCP_MESSAGE_TYPE
Definition: DhcpLayer.h:207
pcpp::DHCPOPT_FQDN
@ DHCPOPT_FQDN
Definition: DhcpLayer.h:263
pcpp::DHCPOPT_DATA_SOURCE
@ DHCPOPT_DATA_SOURCE
Definition: DhcpLayer.h:359
pcpp::DhcpLayer::getGatewayIpAddress
IPv4Address getGatewayIpAddress() const
Definition: DhcpLayer.h:662
pcpp::dhcp_header::magicNumber
uint32_t magicNumber
Definition: DhcpLayer.h:54
pcpp::DHCPOPT_OPTION_MUD_URL_V4
@ DHCPOPT_OPTION_MUD_URL_V4
Definition: DhcpLayer.h:367
pcpp::DHCP_REQUEST
@ DHCP_REQUEST
Definition: DhcpLayer.h:81
pcpp::DhcpLayer::getNextOptionData
DhcpOption getNextOptionData(DhcpOption dhcpOption) const
pcpp::OsiModelApplicationLayer
@ OsiModelApplicationLayer
Definition: ProtocolType.h:248
pcpp::DHCPOPT_PCODE
@ DHCPOPT_PCODE
Definition: DhcpLayer.h:297
pcpp::DHCPOPT_OPTION_V4_LOST
@ DHCPOPT_OPTION_V4_LOST
Definition: DhcpLayer.h:329
pcpp::DHCPOPT_AUTHENTICATION
@ DHCPOPT_AUTHENTICATION
Definition: DhcpLayer.h:279
pcpp::DHCPOPT_NWIP_SUBOPTIONS
@ DHCPOPT_NWIP_SUBOPTIONS
Definition: DhcpLayer.h:227
pcpp::DHCP_BOOTREPLY
@ DHCP_BOOTREPLY
Definition: DhcpLayer.h:67
pcpp::DhcpLayer::~DhcpLayer
virtual ~DhcpLayer()
Definition: DhcpLayer.h:613
pcpp::DHCPOPT_DHCP_MESSAGE
@ DHCPOPT_DHCP_MESSAGE
Definition: DhcpLayer.h:213
pcpp::DHCPOPT_POLICY_FILTER
@ DHCPOPT_POLICY_FILTER
Definition: DhcpLayer.h:143
pcpp::dhcp_header::clientIpAddress
uint32_t clientIpAddress
Definition: DhcpLayer.h:40
Layer.h
pcpp::TLVRecord::TLVRawData::recordType
uint8_t recordType
Definition: TLVData.h:31
pcpp::DHCPOPT_OPTION_IPV4_FQDN_MOS
@ DHCPOPT_OPTION_IPV4_FQDN_MOS
Definition: DhcpLayer.h:335
pcpp::DHCPOPT_ROUTERS
@ DHCPOPT_ROUTERS
Definition: DhcpLayer.h:107
pcpp::DHCPOPT_DHCP_STATE
@ DHCPOPT_DHCP_STATE
Definition: DhcpLayer.h:357
pcpp::DHCPOPT_SIP_SERVERS
@ DHCPOPT_SIP_SERVERS
Definition: DhcpLayer.h:315
pcpp::dhcp_header::hardwareAddressLength
uint8_t hardwareAddressLength
Definition: DhcpLayer.h:30
pcpp::DHCPOPT_QUERY_END_TIME
@ DHCPOPT_QUERY_END_TIME
Definition: DhcpLayer.h:355
pcpp::DHCPOPT_NON_LOCAL_SOURCE_ROUTING
@ DHCPOPT_NON_LOCAL_SOURCE_ROUTING
Definition: DhcpLayer.h:141
pcpp::DhcpLayer::addOption
DhcpOption addOption(const DhcpOptionBuilder &optionBuilder)
pcpp::DhcpLayer::computeCalculateFields
void computeCalculateFields()
pcpp::DhcpLayer::setClientHardwareAddress
void setClientHardwareAddress(const MacAddress &addr)
pcpp::DEFAULT_IP_TTL
@ DEFAULT_IP_TTL
Definition: DhcpLayer.h:147
pcpp::DHCPOPT_CONFIGURATION_FILE
@ DHCPOPT_CONFIGURATION_FILE
Definition: DhcpLayer.h:375
pcpp::DHCPOPT_GEOLOC
@ DHCPOPT_GEOLOC
Definition: DhcpLayer.h:341
pcpp::DHCPOPT_OPTION_V4_ACCESS_DOMAIN
@ DHCPOPT_OPTION_V4_ACCESS_DOMAIN
Definition: DhcpLayer.h:383
pcpp::DhcpOptionBuilder::DhcpOptionBuilder
DhcpOptionBuilder(DhcpOptionTypes optionType, uint16_t optionValue)
Definition: DhcpLayer.h:524
pcpp::DhcpLayer::getYourIpAddress
IPv4Address getYourIpAddress() const
Definition: DhcpLayer.h:651
pcpp::DhcpOption
Definition: DhcpLayer.h:398
pcpp::DHCP_RELEASE
@ DHCP_RELEASE
Definition: DhcpLayer.h:89
pcpp::DHCPOPT_FORCERENEW_NONCE_CAPABLE
@ DHCPOPT_FORCERENEW_NONCE_CAPABLE
Definition: DhcpLayer.h:343
pcpp::DHCPOPT_ALL_SUBNETS_LOCAL
@ DHCPOPT_ALL_SUBNETS_LOCAL
Definition: DhcpLayer.h:155
pcpp::dhcp_header::gatewayIpAddress
uint32_t gatewayIpAddress
Definition: DhcpLayer.h:46
pcpp::DHCPOPT_SUBNET_SELECTION
@ DHCPOPT_SUBNET_SELECTION
Definition: DhcpLayer.h:311
pcpp::DhcpOptionTypes
DhcpOptionTypes
Definition: DhcpLayer.h:97
pcpp::DHCPOPT_FINGER_SERVER
@ DHCPOPT_FINGER_SERVER
Definition: DhcpLayer.h:247
pcpp::DHCPOPT_BOOT_SIZE
@ DHCPOPT_BOOT_SIZE
Definition: DhcpLayer.h:127
pcpp::DhcpLayer::removeAllOptions
bool removeAllOptions()
MacAddress.h
pcpp::DHCPOPT_CLASSLESS_STATIC_ROUTE
@ DHCPOPT_CLASSLESS_STATIC_ROUTE
Definition: DhcpLayer.h:317
pcpp::DHCPOPT_OPTION_V4_PORTPARAMS
@ DHCPOPT_OPTION_V4_PORTPARAMS
Definition: DhcpLayer.h:363
pcpp::DHCP_OFFER
@ DHCP_OFFER
Definition: DhcpLayer.h:79
pcpp::DHCPOPT_DHCP_RENEWAL_TIME
@ DHCPOPT_DHCP_RENEWAL_TIME
Definition: DhcpLayer.h:217
pcpp::DhcpOption::getTotalSize
size_t getTotalSize() const
Definition: DhcpLayer.h:472
pcpp::DHCPOPT_NWIP_DOMAIN_NAME
@ DHCPOPT_NWIP_DOMAIN_NAME
Definition: DhcpLayer.h:225
pcpp::DHCP_ACK
@ DHCP_ACK
Definition: DhcpLayer.h:85
pcpp::DHCPOPT_DHCP_LEASE_TIME
@ DHCPOPT_DHCP_LEASE_TIME
Definition: DhcpLayer.h:203
pcpp::DHCPOPT_REBOOT_TIME
@ DHCPOPT_REBOOT_TIME
Definition: DhcpLayer.h:379
pcpp::DHCPOPT_OPTION_IPV4_ADDRESS_MOS
@ DHCPOPT_OPTION_IPV4_ADDRESS_MOS
Definition: DhcpLayer.h:333
pcpp::DHCPOPT_SUBNET_ALLOCATION
@ DHCPOPT_SUBNET_ALLOCATION
Definition: DhcpLayer.h:385
pcpp::DhcpLayer::setYourIpAddress
void setYourIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:657
pcpp::DHCPOPT_OPTION_V4_PCP_SERVER
@ DHCPOPT_OPTION_V4_PCP_SERVER
Definition: DhcpLayer.h:361
pcpp::DHCPOPT_CCC
@ DHCPOPT_CCC
Definition: DhcpLayer.h:319
pcpp::DHCPOPT_QUOTES_SERVERS
@ DHCPOPT_QUOTES_SERVERS
Definition: DhcpLayer.h:117
pcpp::DHCPOPT_OPTION_6RD
@ DHCPOPT_OPTION_6RD
Definition: DhcpLayer.h:381
pcpp::DHCPOPT_NNTP_SERVER
@ DHCPOPT_NNTP_SERVER
Definition: DhcpLayer.h:243
pcpp::DhcpOptionBuilder::DhcpOptionBuilder
DhcpOptionBuilder(DhcpOptionTypes optionType, const uint8_t *optionValue, uint8_t optionValueLen)
Definition: DhcpLayer.h:506
pcpp::dhcp_header::secondsElapsed
uint16_t secondsElapsed
Definition: DhcpLayer.h:36
pcpp::dhcp_header
Definition: DhcpLayer.h:24
pcpp::DHCPOPT_CLIENT_SYSTEM
@ DHCPOPT_CLIENT_SYSTEM
Definition: DhcpLayer.h:285
pcpp::DHCPOPT_RESOURCE_LOCATION_SERVERS
@ DHCPOPT_RESOURCE_LOCATION_SERVERS
Definition: DhcpLayer.h:123
pcpp::DHCPOPT_BROADCAST_ADDRESS
@ DHCPOPT_BROADCAST_ADDRESS
Definition: DhcpLayer.h:157
pcpp::DHCPOPT_DHCP_AGENT_OPTIONS
@ DHCPOPT_DHCP_AGENT_OPTIONS
Definition: DhcpLayer.h:265
pcpp::DHCPOPT_END
@ DHCPOPT_END
Definition: DhcpLayer.h:389
pcpp::DHCPOPT_MAX_DGRAM_REASSEMBLY
@ DHCPOPT_MAX_DGRAM_REASSEMBLY
Definition: DhcpLayer.h:145
pcpp::DhcpOptionBuilder
Definition: DhcpLayer.h:495
pcpp::DhcpLayer::getHeaderLen
size_t getHeaderLen() const
Definition: DhcpLayer.h:767
pcpp::DHCPOPT_POP3_SERVER
@ DHCPOPT_POP3_SERVER
Definition: DhcpLayer.h:241
pcpp::DhcpLayer::getOptionsCount
size_t getOptionsCount() const
pcpp::DHCPOPT_DIRECTORY_AGENT
@ DHCPOPT_DIRECTORY_AGENT
Definition: DhcpLayer.h:257
pcpp::DhcpLayer::getDhcpHeader
dhcp_header * getDhcpHeader() const
Definition: DhcpLayer.h:619
pcpp::MacAddress
Definition: MacAddress.h:27
pcpp::BootpOpCodes
BootpOpCodes
Definition: DhcpLayer.h:62
pcpp::dhcp_header::transactionID
uint32_t transactionID
Definition: DhcpLayer.h:34
pcpp::DHCPOPT_START_TIME_OF_STATE
@ DHCPOPT_START_TIME_OF_STATE
Definition: DhcpLayer.h:351
TLVData.h
pcpp::dhcp_header::opCode
uint8_t opCode
Definition: DhcpLayer.h:26
pcpp::DHCPOPT_NIS_SERVER_ADDRESS
@ DHCPOPT_NIS_SERVER_ADDRESS
Definition: DhcpLayer.h:231
pcpp::DHCPOPT_CLIENT_LAST_TXN_TIME
@ DHCPOPT_CLIENT_LAST_TXN_TIME
Definition: DhcpLayer.h:281
pcpp::DhcpLayer::parseNextLayer
void parseNextLayer()
Definition: DhcpLayer.h:762
pcpp::dhcp_header::clientHardwareAddress
uint8_t clientHardwareAddress[16]
Definition: DhcpLayer.h:48
pcpp::DHCPOPT_TCP_KEEPALIVE_GARBAGE
@ DHCPOPT_TCP_KEEPALIVE_GARBAGE
Definition: DhcpLayer.h:179
pcpp::DHCPOPT_ISNS
@ DHCPOPT_ISNS
Definition: DhcpLayer.h:267
pcpp::DHCPOPT_DHCP_OPTION_OVERLOAD
@ DHCPOPT_DHCP_OPTION_OVERLOAD
Definition: DhcpLayer.h:205
pcpp::DHCP_UNKNOWN_MSG_TYPE
@ DHCP_UNKNOWN_MSG_TYPE
Definition: DhcpLayer.h:75
pcpp::DHCPOPT_X_DISPLAY_MANAGER
@ DHCPOPT_X_DISPLAY_MANAGER
Definition: DhcpLayer.h:199
pcpp::PATH_MTU_PLATEAU_TABLE
@ PATH_MTU_PLATEAU_TABLE
Definition: DhcpLayer.h:151
pcpp::DHCPOPT_PATH_MTU_AGING_TIMEOUT
@ DHCPOPT_PATH_MTU_AGING_TIMEOUT
Definition: DhcpLayer.h:149
pcpp::dhcp_header::flags
uint16_t flags
Definition: DhcpLayer.h:38
pcpp::DHCPOPT_DHCP_REQUESTED_ADDRESS
@ DHCPOPT_DHCP_REQUESTED_ADDRESS
Definition: DhcpLayer.h:201
pcpp::DHCPOPT_IEEE802_3_ENCAPSULATION
@ DHCPOPT_IEEE802_3_ENCAPSULATION
Definition: DhcpLayer.h:173
pcpp::dhcp_header::hops
uint8_t hops
Definition: DhcpLayer.h:32
pcpp::DHCPOPT_NDS_SERVERS
@ DHCPOPT_NDS_SERVERS
Definition: DhcpLayer.h:269
pcpp::DhcpOption::DhcpOption
DhcpOption(uint8_t *optionRawData)
Definition: DhcpLayer.h:406
pcpp::DHCPOPT_SUBNET_MASK
@ DHCPOPT_SUBNET_MASK
Definition: DhcpLayer.h:103
pcpp::DHCPOPT_QUERY_START_TIME
@ DHCPOPT_QUERY_START_TIME
Definition: DhcpLayer.h:353
pcpp::DHCPOPT_IMPRESS_SERVERS
@ DHCPOPT_IMPRESS_SERVERS
Definition: DhcpLayer.h:121
pcpp::DhcpOptionBuilder::DhcpOptionBuilder
DhcpOptionBuilder(DhcpOptionTypes optionType, uint32_t optionValue)
Definition: DhcpLayer.h:533
pcpp::DhcpOptionBuilder::build
DhcpOption build() const
pcpp::DhcpOption::getValueAsIpAddr
IPv4Address getValueAsIpAddr() const
Definition: DhcpLayer.h:417
pcpp::DHCPOPT_GEOCONF_CIVIC
@ DHCPOPT_GEOCONF_CIVIC
Definition: DhcpLayer.h:295
pcpp::DHCPOPT_NAME_SERVERS
@ DHCPOPT_NAME_SERVERS
Definition: DhcpLayer.h:111
pcpp::DhcpLayer::getOptionData
DhcpOption getOptionData(DhcpOptionTypes option) const
pcpp::DHCPOPT_IP_FORWARDING
@ DHCPOPT_IP_FORWARDING
Definition: DhcpLayer.h:139
pcpp::DHCPOPT_NETBIOS_SCOPE
@ DHCPOPT_NETBIOS_SCOPE
Definition: DhcpLayer.h:195
pcpp::DHCPOPT_PXELINUX_MAGIC
@ DHCPOPT_PXELINUX_MAGIC
Definition: DhcpLayer.h:373
pcpp::IPv4Address::toInt
uint32_t toInt() const
Definition: IpAddress.h:125
pcpp::DhcpLayer::toString
std::string toString() const
pcpp::DhcpMessageType
DhcpMessageType
Definition: DhcpLayer.h:73
pcpp::DHCPOPT_USER_CLASS
@ DHCPOPT_USER_CLASS
Definition: DhcpLayer.h:255
pcpp::DHCPOPT_UUID_GUID
@ DHCPOPT_UUID_GUID
Definition: DhcpLayer.h:291
pcpp::DhcpLayer::setServerIpAddress
void setServerIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:646
pcpp::DHCPOPT_IP_TELEPHONE
@ DHCPOPT_IP_TELEPHONE
Definition: DhcpLayer.h:371
pcpp::DHCPOPT_BOOTFILE_NAME
@ DHCPOPT_BOOTFILE_NAME
Definition: DhcpLayer.h:235
pcpp::DHCPOPT_PERFORM_MASK_DISCOVERY
@ DHCPOPT_PERFORM_MASK_DISCOVERY
Definition: DhcpLayer.h:159
pcpp::DhcpLayer::setClientIpAddress
void setClientIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:635
pcpp::DHCPOPT_NAME_SERVICE_SEARCH
@ DHCPOPT_NAME_SERVICE_SEARCH
Definition: DhcpLayer.h:309
pcpp::DhcpOptionBuilder::DhcpOptionBuilder
DhcpOptionBuilder(DhcpOptionTypes optionType, const IPv4Address &optionValue)
Definition: DhcpLayer.h:542
pcpp::dhcp_header::serverIpAddress
uint32_t serverIpAddress
Definition: DhcpLayer.h:44
pcpp::DHCPOPT_DHCP_CLIENT_IDENTIFIER
@ DHCPOPT_DHCP_CLIENT_IDENTIFIER
Definition: DhcpLayer.h:223
pcpp::DHCPOPT_ETHERBOOT
@ DHCPOPT_ETHERBOOT
Definition: DhcpLayer.h:369
pcpp::DHCPOPT_V_I_VENDOR_OPTS
@ DHCPOPT_V_I_VENDOR_OPTS
Definition: DhcpLayer.h:325
pcpp::DHCPOPT_ROOT_PATH
@ DHCPOPT_ROOT_PATH
Definition: DhcpLayer.h:135
pcpp::DhcpLayer::getOpCode
BootpOpCodes getOpCode() const
Definition: DhcpLayer.h:624
pcpp::DHCPOPT_VENDOR_CLASS_IDENTIFIER
@ DHCPOPT_VENDOR_CLASS_IDENTIFIER
Definition: DhcpLayer.h:221
pcpp::DHCPOPT_VIRTUAL_SUBNET_SELECTION
@ DHCPOPT_VIRTUAL_SUBNET_SELECTION
Definition: DhcpLayer.h:387
pcpp::DHCPOPT_PAD
@ DHCPOPT_PAD
Definition: DhcpLayer.h:101
pcpp::dhcp_header::bootFilename
uint8_t bootFilename[128]
Definition: DhcpLayer.h:52
IpAddress.h
pcpp::DhcpLayer::getClientHardwareAddress
MacAddress getClientHardwareAddress() const
pcpp
The main namespace for the PcapPlusPlus lib.
pcpp::DHCPOPT_TIME_OFFSET
@ DHCPOPT_TIME_OFFSET
Definition: DhcpLayer.h:105
pcpp::DHCPOPT_DHCP_PARAMETER_REQUEST_LIST
@ DHCPOPT_DHCP_PARAMETER_REQUEST_LIST
Definition: DhcpLayer.h:211
pcpp::DHCPOPT_EXTENSIONS_PATH
@ DHCPOPT_EXTENSIONS_PATH
Definition: DhcpLayer.h:137
pcpp::DHCPOPT_MERIT_DUMP
@ DHCPOPT_MERIT_DUMP
Definition: DhcpLayer.h:129
pcpp::DhcpOptionBuilder::DhcpOptionBuilder
DhcpOptionBuilder(DhcpOptionTypes optionType, const std::string &optionValue)
Definition: DhcpLayer.h:551
pcpp::TLVRecordBuilder
Definition: TLVData.h:351
pcpp::DHCPOPT_SMTP_SERVER
@ DHCPOPT_SMTP_SERVER
Definition: DhcpLayer.h:239
pcpp::DHCPOPT_LPR_SERVERS
@ DHCPOPT_LPR_SERVERS
Definition: DhcpLayer.h:119
pcpp::DhcpOption::getValueAsString
std::string getValueAsString(int valueOffset=0) const
Definition: DhcpLayer.h:441
pcpp::DHCPOPT_BASE_TIME
@ DHCPOPT_BASE_TIME
Definition: DhcpLayer.h:349
pcpp::DHCPOPT_FONT_SERVERS
@ DHCPOPT_FONT_SERVERS
Definition: DhcpLayer.h:197
pcpp::DhcpOption::~DhcpOption
virtual ~DhcpOption()
Definition: DhcpLayer.h:411
pcpp::DhcpOption::getDataSize
size_t getDataSize() const
Definition: DhcpLayer.h:480
pcpp::dhcp_header::serverName
uint8_t serverName[64]
Definition: DhcpLayer.h:50
pcpp::DHCPOPT_NTP_SERVERS
@ DHCPOPT_NTP_SERVERS
Definition: DhcpLayer.h:185
pcpp::DHCPOPT_NIS_DOMAIN
@ DHCPOPT_NIS_DOMAIN
Definition: DhcpLayer.h:181
pcpp::DHCPOPT_DHCP_SERVER_IDENTIFIER
@ DHCPOPT_DHCP_SERVER_IDENTIFIER
Definition: DhcpLayer.h:209
pcpp::DHCP_DECLINE
@ DHCP_DECLINE
Definition: DhcpLayer.h:83
pcpp::DhcpLayer::addOptionAfter
DhcpOption addOptionAfter(const DhcpOptionBuilder &optionBuilder, DhcpOptionTypes prevOption)
pcpp::DHCPOPT_IRC_SERVER
@ DHCPOPT_IRC_SERVER
Definition: DhcpLayer.h:249
pcpp::DHCP_BOOTREQUEST
@ DHCP_BOOTREQUEST
Definition: DhcpLayer.h:65
pcpp::DhcpLayer
Definition: DhcpLayer.h:584
pcpp::DHCPOPT_RDNSS_SELECTION
@ DHCPOPT_RDNSS_SELECTION
Definition: DhcpLayer.h:345
pcpp::Layer
Definition: Layer.h:70
pcpp::DHCPOPT_CLIENT_NDI
@ DHCPOPT_CLIENT_NDI
Definition: DhcpLayer.h:287
pcpp::DhcpOptionBuilder::operator=
DhcpOptionBuilder & operator=(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:565
pcpp::DHCPOPT_NIS_DOMAIN_NAME
@ DHCPOPT_NIS_DOMAIN_NAME
Definition: DhcpLayer.h:229
pcpp::dhcp_header::hardwareType
uint8_t hardwareType
Definition: DhcpLayer.h:28
pcpp::DhcpOption::setValueString
void setValueString(const std::string &stringValue, int valueOffset=0)
Definition: DhcpLayer.h:457
pcpp::DHCPOPT_AUTO_CONFIG
@ DHCPOPT_AUTO_CONFIG
Definition: DhcpLayer.h:307
pcpp::DHCPOPT_WWW_SERVER
@ DHCPOPT_WWW_SERVER
Definition: DhcpLayer.h:245
pcpp::DhcpLayer::setMesageType
bool setMesageType(DhcpMessageType msgType)
pcpp::DHCPOPT_PATH_PREFIX
@ DHCPOPT_PATH_PREFIX
Definition: DhcpLayer.h:377
pcpp::DHCPOPT_TIME_SERVERS
@ DHCPOPT_TIME_SERVERS
Definition: DhcpLayer.h:109
pcpp::DHCPOPT_NETINFO_TAG
@ DHCPOPT_NETINFO_TAG
Definition: DhcpLayer.h:303
pcpp::DHCPOPT_TCP_KEEPALIVE_INTERVAL
@ DHCPOPT_TCP_KEEPALIVE_INTERVAL
Definition: DhcpLayer.h:177
pcpp::DHCPOPT_DOMAIN_SEARCH
@ DHCPOPT_DOMAIN_SEARCH
Definition: DhcpLayer.h:313
pcpp::DHCPOPT_SWAP_SERVER
@ DHCPOPT_SWAP_SERVER
Definition: DhcpLayer.h:133
pcpp::DHCPOPT_DEFAULT_TCP_TTL
@ DHCPOPT_DEFAULT_TCP_TTL
Definition: DhcpLayer.h:175
pcpp::DHCPOPT_NETBIOS_NAME_SERVERS
@ DHCPOPT_NETBIOS_NAME_SERVERS
Definition: DhcpLayer.h:189
pcpp::DHCPOPT_SIP_UA_CONFIG
@ DHCPOPT_SIP_UA_CONFIG
Definition: DhcpLayer.h:337
pcpp::DHCPOPT_GEOCONF
@ DHCPOPT_GEOCONF
Definition: DhcpLayer.h:321
pcpp::DhcpLayer::getClientIpAddress
IPv4Address getClientIpAddress() const
Definition: DhcpLayer.h:629
pcpp::DHCPOPT_DOMAIN_NAME
@ DHCPOPT_DOMAIN_NAME
Definition: DhcpLayer.h:131
pcpp::TLVRecord::TLVRawData::recordValue
uint8_t recordValue[]
Definition: TLVData.h:35
pcpp::DHCPOPT_USER_AUTH
@ DHCPOPT_USER_AUTH
Definition: DhcpLayer.h:293
pcpp::DHCPOPT_BCMCS_CONTROLLER_DOMAIN_NAME_LIST
@ DHCPOPT_BCMCS_CONTROLLER_DOMAIN_NAME_LIST
Definition: DhcpLayer.h:275
pcpp::DHCPOPT_VENDOR_ENCAPSULATED_OPTIONS
@ DHCPOPT_VENDOR_ENCAPSULATED_OPTIONS
Definition: DhcpLayer.h:187
pcpp::DHCPOPT_HOME_AGENT_ADDRESS
@ DHCPOPT_HOME_AGENT_ADDRESS
Definition: DhcpLayer.h:237
pcpp::DHCPOPT_LOG_SERVERS
@ DHCPOPT_LOG_SERVERS
Definition: DhcpLayer.h:115
pcpp::DHCP_NAK
@ DHCP_NAK
Definition: DhcpLayer.h:87
pcpp::DHCPOPT_CAPTIVE_PORTAL
@ DHCPOPT_CAPTIVE_PORTAL
Definition: DhcpLayer.h:365
pcpp::DHCPOPT_HOST_NAME
@ DHCPOPT_HOST_NAME
Definition: DhcpLayer.h:125
pcpp::DhcpLayer::removeOption
bool removeOption(DhcpOptionTypes optionType)
pcpp::DHCPOPT_NETINFO_ADDRESS
@ DHCPOPT_NETINFO_ADDRESS
Definition: DhcpLayer.h:301
pcpp::DHCPOPT_DOMAIN_NAME_SERVERS
@ DHCPOPT_DOMAIN_NAME_SERVERS
Definition: DhcpLayer.h:113
pcpp::DhcpOptionBuilder::DhcpOptionBuilder
DhcpOptionBuilder(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:558
pcpp::DHCPOPT_ROUTER_SOLICITATION_ADDRESS
@ DHCPOPT_ROUTER_SOLICITATION_ADDRESS
Definition: DhcpLayer.h:165
pcpp::DHCPOPT_NETBIOS_NODE_TYPE
@ DHCPOPT_NETBIOS_NODE_TYPE
Definition: DhcpLayer.h:193
pcpp::DHCPOPT_TFTP_SERVER_NAME
@ DHCPOPT_TFTP_SERVER_NAME
Definition: DhcpLayer.h:233
pcpp::DHCPOPT_STDA_SERVER
@ DHCPOPT_STDA_SERVER
Definition: DhcpLayer.h:253
pcpp::DHCPOPT_SERVICE_SCOPE
@ DHCPOPT_SERVICE_SCOPE
Definition: DhcpLayer.h:259
pcpp::DHCPOPT_NIS_SERVERS
@ DHCPOPT_NIS_SERVERS
Definition: DhcpLayer.h:183
pcpp::DhcpLayer::getOsiModelLayer
OsiModelLayer getOsiModelLayer() const
Definition: DhcpLayer.h:782
pcpp::DHCPOPT_ASSOCIATED_IP
@ DHCPOPT_ASSOCIATED_IP
Definition: DhcpLayer.h:283
pcpp::DHCPOPT_DHCP_MAX_MESSAGE_SIZE
@ DHCPOPT_DHCP_MAX_MESSAGE_SIZE
Definition: DhcpLayer.h:215
pcpp::DHCPOPT_UNKNOWN
@ DHCPOPT_UNKNOWN
Definition: DhcpLayer.h:99
pcpp::TLVRecord::TLVRawData::recordLen
uint8_t recordLen
Definition: TLVData.h:33
pcpp::DHCPOPT_ROUTER_DISCOVERY
@ DHCPOPT_ROUTER_DISCOVERY
Definition: DhcpLayer.h:163
pcpp::DHCP_INFORM
@ DHCP_INFORM
Definition: DhcpLayer.h:91
pcpp::DhcpOption::setValueIpAddr
void setValueIpAddr(const IPv4Address &addr, int valueOffset=0)
Definition: DhcpLayer.h:429
pcpp::DhcpOptionBuilder::DhcpOptionBuilder
DhcpOptionBuilder(DhcpOptionTypes optionType, uint8_t optionValue)
Definition: DhcpLayer.h:515
pcpp::DHCPOPT_STATIC_ROUTES
@ DHCPOPT_STATIC_ROUTES
Definition: DhcpLayer.h:167
pcpp::DHCPOPT_NETBIOS_DD_SERVER
@ DHCPOPT_NETBIOS_DD_SERVER
Definition: DhcpLayer.h:191
pcpp::DHCPOPT_DHCP_REBINDING_TIME
@ DHCPOPT_DHCP_REBINDING_TIME
Definition: DhcpLayer.h:219
pcpp::DHCPOPT_INTERFACE_MTU
@ DHCPOPT_INTERFACE_MTU
Definition: DhcpLayer.h:153
pcpp::DhcpLayer::DhcpLayer
DhcpLayer()
pcpp::DHCPOPT_NDS_CONTEXT
@ DHCPOPT_NDS_CONTEXT
Definition: DhcpLayer.h:273
pcpp::DhcpLayer::setGatewayIpAddress
void setGatewayIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:668
pcpp::DHCPOPT_STREETTALK_SERVER
@ DHCPOPT_STREETTALK_SERVER
Definition: DhcpLayer.h:251
pcpp::DHCPOPT_ARP_CACHE_TIMEOUT
@ DHCPOPT_ARP_CACHE_TIMEOUT
Definition: DhcpLayer.h:171
pcpp::DHCP_DISCOVER
@ DHCP_DISCOVER
Definition: DhcpLayer.h:77
pcpp::DhcpLayer::getMesageType
DhcpMessageType getMesageType() const
pcpp::DHCPOPT_MASK_SUPPLIER
@ DHCPOPT_MASK_SUPPLIER
Definition: DhcpLayer.h:161
pcpp::DHCPOPT_OPTION_CAPWAP_AC_V4
@ DHCPOPT_OPTION_CAPWAP_AC_V4
Definition: DhcpLayer.h:331
pcpp::DHCPOPT_LDAP
@ DHCPOPT_LDAP
Definition: DhcpLayer.h:289
pcpp::dhcp_header::yourIpAddress
uint32_t yourIpAddress
Definition: DhcpLayer.h:42
pcpp::DHCPOPT_V_I_VENDOR_CLASS
@ DHCPOPT_V_I_VENDOR_CLASS
Definition: DhcpLayer.h:323