PcapPlusPlus  24.09
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  virtual ~DhcpOption()
412  {}
413 
419  {
420  return getValueAs<uint32_t>();
421  }
422 
430  void setValueIpAddr(const IPv4Address& addr, int valueOffset = 0)
431  {
432  setValue<uint32_t>(addr.toInt(), valueOffset);
433  }
434 
442  std::string getValueAsString(int valueOffset = 0) const
443  {
444  if (m_Data == nullptr || m_Data->recordLen - valueOffset < 1)
445  return "";
446 
447  return std::string((const char*)m_Data->recordValue + valueOffset, (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 = (size_t)m_Data->recordLen - (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 = (TLVRawData*)recordRawData;
479  if (data == nullptr)
480  return false;
481 
482  if (tlvDataLen < sizeof(TLVRawData::recordType))
483  return false;
484 
485  if (data->recordType == (uint8_t)DHCPOPT_END || data->recordType == (uint8_t)DHCPOPT_PAD)
486  return true;
487 
488  return TLVRecord<uint8_t, uint8_t>::canAssign(recordRawData, tlvDataLen);
489  }
490 
491  // implement abstract methods
492 
493  size_t getTotalSize() const
494  {
495  if (m_Data == nullptr)
496  return 0;
497 
498  if (m_Data->recordType == (uint8_t)DHCPOPT_END || m_Data->recordType == (uint8_t)DHCPOPT_PAD)
499  return sizeof(uint8_t);
500 
501  return sizeof(uint8_t) * 2 + (size_t)m_Data->recordLen;
502  }
503 
504  size_t getDataSize() const
505  {
506  if (m_Data == nullptr)
507  return 0;
508 
509  if (m_Data->recordType == (uint8_t)DHCPOPT_END || m_Data->recordType == (uint8_t)DHCPOPT_PAD)
510  return 0;
511 
512  return m_Data->recordLen;
513  }
514  };
515 
522  {
523  public:
532  DhcpOptionBuilder(DhcpOptionTypes optionType, const uint8_t* optionValue, uint8_t optionValueLen)
533  : TLVRecordBuilder((uint8_t)optionType, optionValue, optionValueLen)
534  {}
535 
542  DhcpOptionBuilder(DhcpOptionTypes optionType, uint8_t optionValue)
543  : TLVRecordBuilder((uint8_t)optionType, optionValue)
544  {}
545 
552  DhcpOptionBuilder(DhcpOptionTypes optionType, uint16_t optionValue)
553  : TLVRecordBuilder((uint8_t)optionType, optionValue)
554  {}
555 
562  DhcpOptionBuilder(DhcpOptionTypes optionType, uint32_t optionValue)
563  : TLVRecordBuilder((uint8_t)optionType, optionValue)
564  {}
565 
572  DhcpOptionBuilder(DhcpOptionTypes optionType, const IPv4Address& optionValue)
573  : TLVRecordBuilder((uint8_t)optionType, optionValue)
574  {}
575 
582  DhcpOptionBuilder(DhcpOptionTypes optionType, const std::string& optionValue)
583  : TLVRecordBuilder((uint8_t)optionType, optionValue)
584  {}
585 
591  {}
592 
599  {
600  TLVRecordBuilder::operator=(other);
601  return *this;
602  }
603 
608  DhcpOption build() const;
609  };
610 
615  class DhcpLayer : public Layer
616  {
617  public:
625  DhcpLayer(uint8_t* data, size_t dataLen, Layer* prevLayer, Packet* packet);
626 
633  DhcpLayer(DhcpMessageType msgType, const MacAddress& clientMacAddr);
634 
639 
643  virtual ~DhcpLayer()
644  {}
645 
652  {
653  return (dhcp_header*)m_Data;
654  }
655 
660  {
661  return (BootpOpCodes)getDhcpHeader()->opCode;
662  }
663 
669  {
670  return getDhcpHeader()->clientIpAddress;
671  }
672 
677  void setClientIpAddress(const IPv4Address& addr)
678  {
679  getDhcpHeader()->clientIpAddress = addr.toInt();
680  }
681 
687  {
688  return getDhcpHeader()->serverIpAddress;
689  }
690 
695  void setServerIpAddress(const IPv4Address& addr)
696  {
697  getDhcpHeader()->serverIpAddress = addr.toInt();
698  }
699 
704  {
705  return getDhcpHeader()->yourIpAddress;
706  }
707 
712  void setYourIpAddress(const IPv4Address& addr)
713  {
714  getDhcpHeader()->yourIpAddress = addr.toInt();
715  }
716 
721  {
723  }
724 
730  {
732  }
733 
740 
747 
754 
765 
771 
780 
788 
792  size_t getOptionsCount() const;
793 
800  DhcpOption addOption(const DhcpOptionBuilder& optionBuilder);
801 
809  DhcpOption addOptionAfter(const DhcpOptionBuilder& optionBuilder, DhcpOptionTypes prevOption);
810 
816  bool removeOption(DhcpOptionTypes optionType);
817 
823 
830  static inline bool isDhcpPorts(uint16_t portSrc, uint16_t portDst);
831 
832  // implement abstract methods
833 
838  {}
839 
843  size_t getHeaderLen() const
844  {
845  return m_DataLen;
846  }
847 
859 
860  std::string toString() const;
861 
863  {
865  }
866 
867  private:
868  uint8_t* getOptionsBasePtr() const
869  {
870  return m_Data + sizeof(dhcp_header);
871  }
872 
873  TLVRecordReader<DhcpOption> m_OptionReader;
874 
875  void initDhcpLayer(size_t numOfBytesToAllocate);
876 
877  DhcpOption addOptionAt(const DhcpOptionBuilder& optionBuilder, int offset);
878  };
879 
880  // implementation of inline methods
881 
882  bool DhcpLayer::isDhcpPorts(uint16_t portSrc, uint16_t portDst)
883  {
884  return ((portSrc == 68 && portDst == 67) || (portSrc == 67 && portDst == 68) ||
885  (portSrc == 67 && portDst == 67));
886  }
887 
888 } // namespace pcpp
Definition: DhcpLayer.h:616
void computeCalculateFields()
bool removeAllOptions()
DhcpLayer(DhcpMessageType msgType, const MacAddress &clientMacAddr)
void parseNextLayer()
Definition: DhcpLayer.h:837
void setClientHardwareAddress(const MacAddress &addr)
static bool isDhcpPorts(uint16_t portSrc, uint16_t portDst)
Definition: DhcpLayer.h:882
void setServerIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:695
BootpOpCodes getOpCode() const
Definition: DhcpLayer.h:659
size_t getHeaderLen() const
Definition: DhcpLayer.h:843
dhcp_header * getDhcpHeader() const
Definition: DhcpLayer.h:651
virtual ~DhcpLayer()
Definition: DhcpLayer.h:643
DhcpOption addOptionAfter(const DhcpOptionBuilder &optionBuilder, DhcpOptionTypes prevOption)
IPv4Address getYourIpAddress() const
Definition: DhcpLayer.h:703
IPv4Address getClientIpAddress() const
Definition: DhcpLayer.h:668
DhcpOption getFirstOptionData() const
OsiModelLayer getOsiModelLayer() const
Definition: DhcpLayer.h:862
void setClientIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:677
std::string toString() const
void setGatewayIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:729
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:720
bool setMessageType(DhcpMessageType msgType)
size_t getOptionsCount() const
void setYourIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:712
DhcpOption addOption(const DhcpOptionBuilder &optionBuilder)
DhcpOption getOptionData(DhcpOptionTypes option) const
IPv4Address getServerIpAddress() const
Definition: DhcpLayer.h:686
bool removeOption(DhcpOptionTypes optionType)
DhcpMessageType getMessageType() const
Definition: DhcpLayer.h:522
DhcpOptionBuilder(DhcpOptionTypes optionType, uint32_t optionValue)
Definition: DhcpLayer.h:562
DhcpOption build() const
DhcpOptionBuilder(DhcpOptionTypes optionType, const uint8_t *optionValue, uint8_t optionValueLen)
Definition: DhcpLayer.h:532
DhcpOptionBuilder(DhcpOptionTypes optionType, const IPv4Address &optionValue)
Definition: DhcpLayer.h:572
DhcpOptionBuilder & operator=(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:598
DhcpOptionBuilder(DhcpOptionTypes optionType, uint8_t optionValue)
Definition: DhcpLayer.h:542
DhcpOptionBuilder(DhcpOptionTypes optionType, const std::string &optionValue)
Definition: DhcpLayer.h:582
DhcpOptionBuilder(DhcpOptionTypes optionType, uint16_t optionValue)
Definition: DhcpLayer.h:552
DhcpOptionBuilder(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:590
Definition: DhcpLayer.h:399
void setValueString(const std::string &stringValue, int valueOffset=0)
Definition: DhcpLayer.h:458
virtual ~DhcpOption()
Definition: DhcpLayer.h:411
std::string getValueAsString(int valueOffset=0) const
Definition: DhcpLayer.h:442
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:430
DhcpOption(uint8_t *optionRawData)
Definition: DhcpLayer.h:405
IPv4Address getValueAsIpAddr() const
Definition: DhcpLayer.h:418
size_t getDataSize() const
Definition: DhcpLayer.h:504
size_t getTotalSize() const
Definition: DhcpLayer.h:493
Definition: IpAddress.h:32
uint32_t toInt() const
Definition: IpAddress.h:187
Definition: Layer.h:70
Definition: MacAddress.h:25
Definition: Packet.h:27
Definition: TLVData.h:413
Definition: TLVData.h:23
static bool canAssign(const uint8_t *recordRawData, size_t tlvDataLen)
Definition: TLVData.h:79
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:354
@ OsiModelApplicationLayer
Definition: ProtocolType.h:368
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