PcapPlusPlus  Next
DhcpLayer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Layer.h"
4 #include "TLVData.h"
5 #include "IpAddress.h"
6 #include "MacAddress.h"
7 #include <string.h>
8 
10 
15 namespace pcpp
16 {
17 
22 #pragma pack(push, 1)
23  struct dhcp_header
24  {
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 
62  {
66  DHCP_BOOTREPLY = 2
67  };
68 
73  {
85  DHCP_ACK = 5,
87  DHCP_NAK = 6,
91  DHCP_INFORM = 8
92  };
93 
98  {
306  DHCPOPT_URL = 114,
320  DHCPOPT_CCC = 122,
390  DHCPOPT_END = 255
391  };
392 
398  class DhcpOption : public TLVRecord<uint8_t, uint8_t>
399  {
400  public:
405  explicit DhcpOption(uint8_t* optionRawData) : TLVRecord(optionRawData)
406  {}
407 
411  ~DhcpOption() override = default;
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 == nullptr || m_Data->recordLen - valueOffset < 1)
444  return "";
445 
446  return std::string(reinterpret_cast<const char*>(m_Data->recordValue) + valueOffset,
447  static_cast<int>(m_Data->recordLen) - valueOffset);
448  }
449 
458  void setValueString(const std::string& stringValue, int valueOffset = 0)
459  {
460  // calculate the maximum length of the destination buffer
461  size_t len = static_cast<size_t>(m_Data->recordLen) - static_cast<size_t>(valueOffset);
462 
463  // use the length of input string if a buffer is large enough for whole string
464  if (stringValue.length() < len)
465  len = stringValue.length();
466 
467  memcpy(m_Data->recordValue + valueOffset, stringValue.data(), len);
468  }
469 
476  static bool canAssign(const uint8_t* recordRawData, size_t tlvDataLen)
477  {
478  auto data = reinterpret_cast<TLVRawData const*>(recordRawData);
479  if (data == nullptr)
480  return false;
481 
482  if (tlvDataLen < sizeof(TLVRawData::recordType))
483  return false;
484 
485  if (data->recordType == static_cast<uint8_t>(DHCPOPT_END) ||
486  data->recordType == static_cast<uint8_t>(DHCPOPT_PAD))
487  return true;
488 
489  return TLVRecord<uint8_t, uint8_t>::canAssign(recordRawData, tlvDataLen);
490  }
491 
492  // implement abstract methods
493 
494  size_t getTotalSize() const override
495  {
496  if (m_Data == nullptr)
497  return 0;
498 
499  if (m_Data->recordType == static_cast<uint8_t>(DHCPOPT_END) ||
500  m_Data->recordType == static_cast<uint8_t>(DHCPOPT_PAD))
501  return sizeof(uint8_t);
502 
503  return sizeof(uint8_t) * 2 + static_cast<size_t>(m_Data->recordLen);
504  }
505 
506  size_t getDataSize() const override
507  {
508  if (m_Data == nullptr)
509  return 0;
510 
511  if (m_Data->recordType == static_cast<uint8_t>(DHCPOPT_END) ||
512  m_Data->recordType == static_cast<uint8_t>(DHCPOPT_PAD))
513  return 0;
514 
515  return m_Data->recordLen;
516  }
517  };
518 
525  {
526  public:
535  DhcpOptionBuilder(DhcpOptionTypes optionType, const uint8_t* optionValue, uint8_t optionValueLen)
536  : TLVRecordBuilder(static_cast<uint8_t>(optionType), optionValue, optionValueLen)
537  {}
538 
545  DhcpOptionBuilder(DhcpOptionTypes optionType, uint8_t optionValue)
546  : TLVRecordBuilder(static_cast<uint8_t>(optionType), optionValue)
547  {}
548 
555  DhcpOptionBuilder(DhcpOptionTypes optionType, uint16_t optionValue)
556  : TLVRecordBuilder(static_cast<uint8_t>(optionType), optionValue)
557  {}
558 
565  DhcpOptionBuilder(DhcpOptionTypes optionType, uint32_t optionValue)
566  : TLVRecordBuilder(static_cast<uint8_t>(optionType), optionValue)
567  {}
568 
575  DhcpOptionBuilder(DhcpOptionTypes optionType, const IPv4Address& optionValue)
576  : TLVRecordBuilder(static_cast<uint8_t>(optionType), optionValue)
577  {}
578 
585  DhcpOptionBuilder(DhcpOptionTypes optionType, const std::string& optionValue)
586  : TLVRecordBuilder(static_cast<uint8_t>(optionType), optionValue)
587  {}
588 
594  {}
595 
602  {
603  TLVRecordBuilder::operator=(other);
604  return *this;
605  }
606 
611  DhcpOption build() const;
612  };
613 
618  class DhcpLayer : public Layer
619  {
620  public:
628  DhcpLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet);
629 
636  DhcpLayer(DhcpMessageType msgType, const MacAddress& clientMacAddr);
637 
642 
646  ~DhcpLayer() override = default;
647 
654  {
655  return reinterpret_cast<dhcp_header*>(m_Data);
656  }
657 
662  {
663  return static_cast<BootpOpCodes>(getDhcpHeader()->opCode);
664  }
665 
671  {
672  return getDhcpHeader()->clientIpAddress;
673  }
674 
679  void setClientIpAddress(const IPv4Address& addr)
680  {
681  getDhcpHeader()->clientIpAddress = addr.toInt();
682  }
683 
689  {
690  return getDhcpHeader()->serverIpAddress;
691  }
692 
697  void setServerIpAddress(const IPv4Address& addr)
698  {
699  getDhcpHeader()->serverIpAddress = addr.toInt();
700  }
701 
706  {
707  return getDhcpHeader()->yourIpAddress;
708  }
709 
714  void setYourIpAddress(const IPv4Address& addr)
715  {
716  getDhcpHeader()->yourIpAddress = addr.toInt();
717  }
718 
723  {
725  }
726 
732  {
734  }
735 
742 
749 
756 
767 
773 
782 
790 
794  size_t getOptionsCount() const;
795 
802  DhcpOption addOption(const DhcpOptionBuilder& optionBuilder);
803 
811  DhcpOption addOptionAfter(const DhcpOptionBuilder& optionBuilder, DhcpOptionTypes prevOption);
812 
818  bool removeOption(DhcpOptionTypes optionType);
819 
825 
832  static inline bool isDhcpPorts(uint16_t portSrc, uint16_t portDst);
833 
834  // implement abstract methods
835 
839  void parseNextLayer() override
840  {}
841 
845  size_t getHeaderLen() const override
846  {
847  return m_DataLen;
848  }
849 
860  void computeCalculateFields() override;
861 
862  std::string toString() const override;
863 
865  {
867  }
868 
869  private:
870  uint8_t* getOptionsBasePtr() const
871  {
872  return m_Data + sizeof(dhcp_header);
873  }
874 
875  TLVRecordReader<DhcpOption> m_OptionReader;
876 
877  void initDhcpLayer(size_t numOfBytesToAllocate);
878 
879  DhcpOption addOptionAt(const DhcpOptionBuilder& optionBuilder, int offset);
880  };
881 
882  // implementation of inline methods
883 
884  bool DhcpLayer::isDhcpPorts(uint16_t portSrc, uint16_t portDst)
885  {
886  return ((portSrc == 68 && portDst == 67) || (portSrc == 67 && portDst == 68) ||
887  (portSrc == 67 && portDst == 67));
888  }
889 
890 } // namespace pcpp
Definition: DhcpLayer.h:619
void parseNextLayer() override
Definition: DhcpLayer.h:839
bool removeAllOptions()
DhcpLayer(DhcpMessageType msgType, const MacAddress &clientMacAddr)
void setClientHardwareAddress(const MacAddress &addr)
static bool isDhcpPorts(uint16_t portSrc, uint16_t portDst)
Definition: DhcpLayer.h:884
void setServerIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:697
BootpOpCodes getOpCode() const
Definition: DhcpLayer.h:661
dhcp_header * getDhcpHeader() const
Definition: DhcpLayer.h:653
~DhcpLayer() override=default
DhcpOption addOptionAfter(const DhcpOptionBuilder &optionBuilder, DhcpOptionTypes prevOption)
IPv4Address getYourIpAddress() const
Definition: DhcpLayer.h:705
IPv4Address getClientIpAddress() const
Definition: DhcpLayer.h:670
DhcpOption getFirstOptionData() const
void setClientIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:679
size_t getHeaderLen() const override
Definition: DhcpLayer.h:845
std::string toString() const override
void setGatewayIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:731
DhcpOption getNextOptionData(DhcpOption dhcpOption) const
MacAddress getClientHardwareAddress() const
DhcpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
IPv4Address getGatewayIpAddress() const
Definition: DhcpLayer.h:722
bool setMessageType(DhcpMessageType msgType)
size_t getOptionsCount() const
void setYourIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:714
DhcpOption addOption(const DhcpOptionBuilder &optionBuilder)
DhcpOption getOptionData(DhcpOptionTypes option) const
IPv4Address getServerIpAddress() const
Definition: DhcpLayer.h:688
OsiModelLayer getOsiModelLayer() const override
Definition: DhcpLayer.h:864
bool removeOption(DhcpOptionTypes optionType)
void computeCalculateFields() override
DhcpMessageType getMessageType() const
Definition: DhcpLayer.h:525
DhcpOptionBuilder(DhcpOptionTypes optionType, uint32_t optionValue)
Definition: DhcpLayer.h:565
DhcpOption build() const
DhcpOptionBuilder(DhcpOptionTypes optionType, const uint8_t *optionValue, uint8_t optionValueLen)
Definition: DhcpLayer.h:535
DhcpOptionBuilder(DhcpOptionTypes optionType, const IPv4Address &optionValue)
Definition: DhcpLayer.h:575
DhcpOptionBuilder & operator=(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:601
DhcpOptionBuilder(DhcpOptionTypes optionType, uint8_t optionValue)
Definition: DhcpLayer.h:545
DhcpOptionBuilder(DhcpOptionTypes optionType, const std::string &optionValue)
Definition: DhcpLayer.h:585
DhcpOptionBuilder(DhcpOptionTypes optionType, uint16_t optionValue)
Definition: DhcpLayer.h:555
DhcpOptionBuilder(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:593
Definition: DhcpLayer.h:399
~DhcpOption() override=default
void setValueString(const std::string &stringValue, int valueOffset=0)
Definition: DhcpLayer.h:458
std::string getValueAsString(int valueOffset=0) const
Definition: DhcpLayer.h:441
size_t getDataSize() const override
Definition: DhcpLayer.h:506
static bool canAssign(const uint8_t *recordRawData, size_t tlvDataLen)
Definition: DhcpLayer.h:476
void setValueIpAddr(const IPv4Address &addr, int valueOffset=0)
Definition: DhcpLayer.h:429
size_t getTotalSize() const override
Definition: DhcpLayer.h:494
DhcpOption(uint8_t *optionRawData)
Definition: DhcpLayer.h:405
IPv4Address getValueAsIpAddr() const
Definition: DhcpLayer.h:417
Definition: IpAddress.h:32
uint32_t toInt() const
Definition: IpAddress.h:187
Definition: Layer.h:69
Definition: MacAddress.h:25
Definition: Packet.h:27
Definition: TLVData.h:419
Definition: TLVData.h:23
static bool canAssign(const uint8_t *recordRawData, size_t tlvDataLen)
Definition: TLVData.h:80
The main namespace for the PcapPlusPlus lib.
DhcpOptionTypes
Definition: DhcpLayer.h:98
@ DHCPOPT_INTERFACE_MTU
Definition: DhcpLayer.h:154
@ DHCPOPT_CCC
Definition: DhcpLayer.h:320
@ DHCPOPT_FINGER_SERVER
Definition: DhcpLayer.h:248
@ DHCPOPT_OPTION_IPV4_ADDRESS_MOS
Definition: DhcpLayer.h:334
@ DHCPOPT_SMTP_SERVER
Definition: DhcpLayer.h:240
@ DHCPOPT_RAPID_COMMIT
Definition: DhcpLayer.h:262
@ DHCPOPT_START_TIME_OF_STATE
Definition: DhcpLayer.h:352
@ DHCPOPT_QUERY_END_TIME
Definition: DhcpLayer.h:356
@ DHCPOPT_ROUTER_SOLICITATION_ADDRESS
Definition: DhcpLayer.h:166
@ DHCPOPT_DHCP_MAX_MESSAGE_SIZE
Definition: DhcpLayer.h:216
@ DHCPOPT_DOMAIN_NAME
Definition: DhcpLayer.h:132
@ DHCPOPT_IP_FORWARDING
Definition: DhcpLayer.h:140
@ DHCPOPT_TRAILER_ENCAPSULATION
Definition: DhcpLayer.h:170
@ DHCPOPT_OPTION_V4_ACCESS_DOMAIN
Definition: DhcpLayer.h:384
@ DHCPOPT_SWAP_SERVER
Definition: DhcpLayer.h:134
@ DHCPOPT_SERVICE_SCOPE
Definition: DhcpLayer.h:260
@ DHCPOPT_DHCP_CLIENT_IDENTIFIER
Definition: DhcpLayer.h:224
@ DHCPOPT_NIS_SERVERS
Definition: DhcpLayer.h:184
@ DHCPOPT_DIRECTORY_AGENT
Definition: DhcpLayer.h:258
@ DHCPOPT_QUERY_START_TIME
Definition: DhcpLayer.h:354
@ DHCPOPT_TCP_KEEPALIVE_INTERVAL
Definition: DhcpLayer.h:178
@ DHCPOPT_GEOCONF
Definition: DhcpLayer.h:322
@ DHCPOPT_NAME_SERVICE_SEARCH
Definition: DhcpLayer.h:310
@ DHCPOPT_DHCP_OPTION_OVERLOAD
Definition: DhcpLayer.h:206
@ DHCPOPT_NETBIOS_NODE_TYPE
Definition: DhcpLayer.h:194
@ DHCPOPT_POP3_SERVER
Definition: DhcpLayer.h:242
@ DHCPOPT_UNKNOWN
Definition: DhcpLayer.h:100
@ DHCPOPT_SUBNET_MASK
Definition: DhcpLayer.h:104
@ DHCPOPT_DHCP_SERVER_IDENTIFIER
Definition: DhcpLayer.h:210
@ DHCPOPT_BOOT_SIZE
Definition: DhcpLayer.h:128
@ DHCPOPT_TIME_SERVERS
Definition: DhcpLayer.h:110
@ DHCPOPT_URL
Definition: DhcpLayer.h:306
@ DHCPOPT_SIP_UA_CONFIG
Definition: DhcpLayer.h:338
@ DHCPOPT_BASE_TIME
Definition: DhcpLayer.h:350
@ DHCPOPT_NDS_SERVERS
Definition: DhcpLayer.h:270
@ DHCPOPT_HOST_NAME
Definition: DhcpLayer.h:126
@ DHCPOPT_STATIC_ROUTES
Definition: DhcpLayer.h:168
@ DHCPOPT_QUOTES_SERVERS
Definition: DhcpLayer.h:118
@ DHCPOPT_REBOOT_TIME
Definition: DhcpLayer.h:380
@ DHCPOPT_GEOLOC
Definition: DhcpLayer.h:342
@ DHCPOPT_CAPTIVE_PORTAL
Definition: DhcpLayer.h:366
@ DHCPOPT_OPTION_MUD_URL_V4
Definition: DhcpLayer.h:368
@ DHCPOPT_IRC_SERVER
Definition: DhcpLayer.h:250
@ DHCPOPT_DHCP_MESSAGE_TYPE
Definition: DhcpLayer.h:208
@ DHCPOPT_OPTION_IPV4_FQDN_MOS
Definition: DhcpLayer.h:336
@ DEFAULT_IP_TTL
Definition: DhcpLayer.h:148
@ DHCPOPT_X_DISPLAY_MANAGER
Definition: DhcpLayer.h:200
@ DHCPOPT_DHCP_REBINDING_TIME
Definition: DhcpLayer.h:220
@ DHCPOPT_SIP_SERVERS
Definition: DhcpLayer.h:316
@ DHCPOPT_WWW_SERVER
Definition: DhcpLayer.h:246
@ DHCPOPT_OPTION_V4_PORTPARAMS
Definition: DhcpLayer.h:364
@ DHCPOPT_OPTION_6RD
Definition: DhcpLayer.h:382
@ DHCPOPT_CONFIGURATION_FILE
Definition: DhcpLayer.h:376
@ DHCPOPT_OPTION_CAPWAP_AC_V4
Definition: DhcpLayer.h:332
@ DHCPOPT_NON_LOCAL_SOURCE_ROUTING
Definition: DhcpLayer.h:142
@ DHCPOPT_MERIT_DUMP
Definition: DhcpLayer.h:130
@ DHCPOPT_FONT_SERVERS
Definition: DhcpLayer.h:198
@ DHCPOPT_RESOURCE_LOCATION_SERVERS
Definition: DhcpLayer.h:124
@ DHCPOPT_DATA_SOURCE
Definition: DhcpLayer.h:360
@ DHCPOPT_SUBNET_ALLOCATION
Definition: DhcpLayer.h:386
@ DHCPOPT_TIME_OFFSET
Definition: DhcpLayer.h:106
@ DHCPOPT_ALL_SUBNETS_LOCAL
Definition: DhcpLayer.h:156
@ DHCPOPT_TCODE
Definition: DhcpLayer.h:300
@ DHCPOPT_LOG_SERVERS
Definition: DhcpLayer.h:116
@ DHCPOPT_NWIP_SUBOPTIONS
Definition: DhcpLayer.h:228
@ DHCPOPT_STREETTALK_SERVER
Definition: DhcpLayer.h:252
@ DHCPOPT_GEOCONF_CIVIC
Definition: DhcpLayer.h:296
@ DHCPOPT_NWIP_DOMAIN_NAME
Definition: DhcpLayer.h:226
@ DHCPOPT_PXELINUX_MAGIC
Definition: DhcpLayer.h:374
@ DHCPOPT_IMPRESS_SERVERS
Definition: DhcpLayer.h:122
@ DHCPOPT_ROUTERS
Definition: DhcpLayer.h:108
@ DHCPOPT_V_I_VENDOR_CLASS
Definition: DhcpLayer.h:324
@ DHCPOPT_STATUS_CODE
Definition: DhcpLayer.h:348
@ DHCPOPT_DHCP_PARAMETER_REQUEST_LIST
Definition: DhcpLayer.h:212
@ DHCPOPT_BOOTFILE_NAME
Definition: DhcpLayer.h:236
@ DHCPOPT_NDS_TREE_NAME
Definition: DhcpLayer.h:272
@ DHCPOPT_CLIENT_LAST_TXN_TIME
Definition: DhcpLayer.h:282
@ DHCPOPT_FQDN
Definition: DhcpLayer.h:264
@ DHCPOPT_PATH_PREFIX
Definition: DhcpLayer.h:378
@ DHCPOPT_POLICY_FILTER
Definition: DhcpLayer.h:144
@ DHCPOPT_DHCP_STATE
Definition: DhcpLayer.h:358
@ DHCPOPT_PATH_MTU_AGING_TIMEOUT
Definition: DhcpLayer.h:150
@ DHCPOPT_NIS_DOMAIN_NAME
Definition: DhcpLayer.h:230
@ DHCPOPT_PAD
Definition: DhcpLayer.h:102
@ DHCPOPT_NDS_CONTEXT
Definition: DhcpLayer.h:274
@ DHCPOPT_SUBNET_SELECTION
Definition: DhcpLayer.h:312
@ DHCPOPT_NNTP_SERVER
Definition: DhcpLayer.h:244
@ DHCPOPT_DEFAULT_TCP_TTL
Definition: DhcpLayer.h:176
@ DHCPOPT_NETBIOS_SCOPE
Definition: DhcpLayer.h:196
@ DHCPOPT_OPTION_V4_PCP_SERVER
Definition: DhcpLayer.h:362
@ DHCPOPT_NETINFO_ADDRESS
Definition: DhcpLayer.h:302
@ DHCPOPT_PCODE
Definition: DhcpLayer.h:298
@ DHCPOPT_NTP_SERVERS
Definition: DhcpLayer.h:186
@ DHCPOPT_DHCP_REQUESTED_ADDRESS
Definition: DhcpLayer.h:202
@ DHCPOPT_FORCERENEW_NONCE_CAPABLE
Definition: DhcpLayer.h:344
@ DHCPOPT_ASSOCIATED_IP
Definition: DhcpLayer.h:284
@ DHCPOPT_NETBIOS_DD_SERVER
Definition: DhcpLayer.h:192
@ DHCPOPT_ARP_CACHE_TIMEOUT
Definition: DhcpLayer.h:172
@ DHCPOPT_MAX_DGRAM_REASSEMBLY
Definition: DhcpLayer.h:146
@ DHCPOPT_BROADCAST_ADDRESS
Definition: DhcpLayer.h:158
@ DHCPOPT_V_I_VENDOR_OPTS
Definition: DhcpLayer.h:326
@ DHCPOPT_ROUTER_DISCOVERY
Definition: DhcpLayer.h:164
@ DHCPOPT_NETBIOS_NAME_SERVERS
Definition: DhcpLayer.h:190
@ DHCPOPT_NAME_SERVERS
Definition: DhcpLayer.h:112
@ DHCPOPT_EXTENSIONS_PATH
Definition: DhcpLayer.h:138
@ DHCPOPT_IEEE802_3_ENCAPSULATION
Definition: DhcpLayer.h:174
@ DHCPOPT_ISNS
Definition: DhcpLayer.h:268
@ DHCPOPT_USER_AUTH
Definition: DhcpLayer.h:294
@ DHCPOPT_DHCP_MESSAGE
Definition: DhcpLayer.h:214
@ DHCPOPT_DHCP_RENEWAL_TIME
Definition: DhcpLayer.h:218
@ DHCPOPT_BCMCS_CONTROLLER_DOMAIN_NAME_LIST
Definition: DhcpLayer.h:276
@ DHCPOPT_OPTION_PANA_AGENT
Definition: DhcpLayer.h:328
@ DHCPOPT_DOMAIN_NAME_SERVERS
Definition: DhcpLayer.h:114
@ DHCPOPT_NETINFO_TAG
Definition: DhcpLayer.h:304
@ DHCPOPT_NIS_DOMAIN
Definition: DhcpLayer.h:182
@ DHCPOPT_VENDOR_ENCAPSULATED_OPTIONS
Definition: DhcpLayer.h:188
@ DHCPOPT_OPTION_V4_LOST
Definition: DhcpLayer.h:330
@ DHCPOPT_HOME_AGENT_ADDRESS
Definition: DhcpLayer.h:238
@ DHCPOPT_END
Definition: DhcpLayer.h:390
@ DHCPOPT_TCP_KEEPALIVE_GARBAGE
Definition: DhcpLayer.h:180
@ DHCPOPT_USER_CLASS
Definition: DhcpLayer.h:256
@ DHCPOPT_ETHERBOOT
Definition: DhcpLayer.h:370
@ PATH_MTU_PLATEAU_TABLE
Definition: DhcpLayer.h:152
@ DHCPOPT_LDAP
Definition: DhcpLayer.h:290
@ DHCPOPT_IP_TELEPHONE
Definition: DhcpLayer.h:372
@ DHCPOPT_NIS_SERVER_ADDRESS
Definition: DhcpLayer.h:232
@ DHCPOPT_AUTHENTICATION
Definition: DhcpLayer.h:280
@ DHCPOPT_BCMCS_CONTROLLER_IPV4_ADDRESS
Definition: DhcpLayer.h:278
@ DHCPOPT_CLIENT_SYSTEM
Definition: DhcpLayer.h:286
@ DHCPOPT_OPTION_IPV4_ADDRESS_ANDSF
Definition: DhcpLayer.h:340
@ DHCPOPT_DHCP_LEASE_TIME
Definition: DhcpLayer.h:204
@ DHCPOPT_DHCP_AGENT_OPTIONS
Definition: DhcpLayer.h:266
@ DHCPOPT_CLASSLESS_STATIC_ROUTE
Definition: DhcpLayer.h:318
@ DHCPOPT_TFTP_SERVER_NAME
Definition: DhcpLayer.h:234
@ DHCPOPT_RDNSS_SELECTION
Definition: DhcpLayer.h:346
@ DHCPOPT_CLIENT_NDI
Definition: DhcpLayer.h:288
@ DHCPOPT_ROOT_PATH
Definition: DhcpLayer.h:136
@ DHCPOPT_VIRTUAL_SUBNET_SELECTION
Definition: DhcpLayer.h:388
@ DHCPOPT_LPR_SERVERS
Definition: DhcpLayer.h:120
@ DHCPOPT_PERFORM_MASK_DISCOVERY
Definition: DhcpLayer.h:160
@ DHCPOPT_DOMAIN_SEARCH
Definition: DhcpLayer.h:314
@ DHCPOPT_STDA_SERVER
Definition: DhcpLayer.h:254
@ DHCPOPT_VENDOR_CLASS_IDENTIFIER
Definition: DhcpLayer.h:222
@ DHCPOPT_MASK_SUPPLIER
Definition: DhcpLayer.h:162
@ DHCPOPT_UUID_GUID
Definition: DhcpLayer.h:292
@ DHCPOPT_AUTO_CONFIG
Definition: DhcpLayer.h:308
OsiModelLayer
Definition: ProtocolType.h:364
@ OsiModelApplicationLayer
Definition: ProtocolType.h:378
DhcpMessageType
Definition: DhcpLayer.h:73
@ DHCP_UNKNOWN_MSG_TYPE
Definition: DhcpLayer.h:75
@ DHCP_NAK
Definition: DhcpLayer.h:87
@ DHCP_REQUEST
Definition: DhcpLayer.h:81
@ DHCP_OFFER
Definition: DhcpLayer.h:79
@ DHCP_DECLINE
Definition: DhcpLayer.h:83
@ DHCP_DISCOVER
Definition: DhcpLayer.h:77
@ DHCP_ACK
Definition: DhcpLayer.h:85
@ DHCP_RELEASE
Definition: DhcpLayer.h:89
@ DHCP_INFORM
Definition: DhcpLayer.h:91
BootpOpCodes
Definition: DhcpLayer.h:62
@ DHCP_BOOTREQUEST
Definition: DhcpLayer.h:64
@ DHCP_BOOTREPLY
Definition: DhcpLayer.h:66
Definition: DhcpLayer.h:24
uint16_t secondsElapsed
Definition: DhcpLayer.h:36
uint8_t hops
Definition: DhcpLayer.h:32
uint8_t clientHardwareAddress[16]
Definition: DhcpLayer.h:48
uint32_t yourIpAddress
Definition: DhcpLayer.h:42
uint32_t transactionID
Definition: DhcpLayer.h:34
uint8_t opCode
Definition: DhcpLayer.h:26
uint8_t bootFilename[128]
Definition: DhcpLayer.h:52
uint32_t clientIpAddress
Definition: DhcpLayer.h:40
uint32_t magicNumber
Definition: DhcpLayer.h:54
uint8_t hardwareAddressLength
Definition: DhcpLayer.h:30
uint16_t flags
Definition: DhcpLayer.h:38
uint8_t hardwareType
Definition: DhcpLayer.h:28
uint32_t serverIpAddress
Definition: DhcpLayer.h:44
uint32_t gatewayIpAddress
Definition: DhcpLayer.h:46
uint8_t serverName[64]
Definition: DhcpLayer.h:50