|
PcapPlusPlus
20.08
|
Go to the documentation of this file. 1 #ifndef PACKETPP_DHCP_LAYER
2 #define PACKETPP_DHCP_LAYER
419 return getValueAs<uint32_t>();
431 setValue<uint32_t>(addr.
toInt(), valueOffset);
446 return std::string((
const char*)m_Data->
recordValue + valueOffset, (
int)m_Data->
recordLen - valueOffset);
460 size_t len = (size_t)m_Data->
recordLen - (
size_t)valueOffset;
463 if (stringValue.length() < len)
464 len = stringValue.length();
466 memcpy(m_Data->
recordValue + valueOffset, stringValue.data(), len);
475 return sizeof(uint8_t);
477 return sizeof(uint8_t) * 2 + (
size_t)m_Data->
recordLen;
567 TLVRecordBuilder::operator=(other);
786 uint8_t* getOptionsBasePtr()
const {
return m_Data +
sizeof(
dhcp_header); }
788 TLVRecordReader<DhcpOption> m_OptionReader;
790 void initDhcpLayer(
size_t numOfBytesToAllocate);
792 DhcpOption addOptionAt(
const DhcpOptionBuilder& optionBuilder,
int offset);
@ DHCPOPT_TRAILER_ENCAPSULATION
Definition: DhcpLayer.h:169
@ DHCPOPT_BCMCS_CONTROLLER_IPV4_ADDRESS
Definition: DhcpLayer.h:277
IPv4Address getServerIpAddress() const
Definition: DhcpLayer.h:640
@ DHCPOPT_OPTION_IPV4_ADDRESS_ANDSF
Definition: DhcpLayer.h:339
OsiModelLayer
Definition: ProtocolType.h:233
@ DHCPOPT_NDS_TREE_NAME
Definition: DhcpLayer.h:271
DhcpOption getFirstOptionData() const
@ DHCPOPT_URL
Definition: DhcpLayer.h:305
@ DHCPOPT_STATUS_CODE
Definition: DhcpLayer.h:347
Definition: IpAddress.h:26
@ DHCPOPT_RAPID_COMMIT
Definition: DhcpLayer.h:261
@ DHCPOPT_OPTION_PANA_AGENT
Definition: DhcpLayer.h:327
@ DHCPOPT_TCODE
Definition: DhcpLayer.h:299
@ DHCPOPT_DHCP_MESSAGE_TYPE
Definition: DhcpLayer.h:207
@ DHCPOPT_FQDN
Definition: DhcpLayer.h:263
@ DHCPOPT_DATA_SOURCE
Definition: DhcpLayer.h:359
IPv4Address getGatewayIpAddress() const
Definition: DhcpLayer.h:662
@ DHCPOPT_OPTION_MUD_URL_V4
Definition: DhcpLayer.h:367
@ DHCP_REQUEST
Definition: DhcpLayer.h:81
DhcpOption getNextOptionData(DhcpOption dhcpOption) const
@ OsiModelApplicationLayer
Definition: ProtocolType.h:248
@ DHCPOPT_PCODE
Definition: DhcpLayer.h:297
@ DHCPOPT_OPTION_V4_LOST
Definition: DhcpLayer.h:329
@ DHCPOPT_AUTHENTICATION
Definition: DhcpLayer.h:279
@ DHCPOPT_NWIP_SUBOPTIONS
Definition: DhcpLayer.h:227
@ DHCP_BOOTREPLY
Definition: DhcpLayer.h:67
virtual ~DhcpLayer()
Definition: DhcpLayer.h:613
@ DHCPOPT_DHCP_MESSAGE
Definition: DhcpLayer.h:213
@ DHCPOPT_POLICY_FILTER
Definition: DhcpLayer.h:143
uint8_t recordType
Definition: TLVData.h:31
@ DHCPOPT_OPTION_IPV4_FQDN_MOS
Definition: DhcpLayer.h:335
@ DHCPOPT_ROUTERS
Definition: DhcpLayer.h:107
@ DHCPOPT_DHCP_STATE
Definition: DhcpLayer.h:357
@ DHCPOPT_SIP_SERVERS
Definition: DhcpLayer.h:315
@ DHCPOPT_QUERY_END_TIME
Definition: DhcpLayer.h:355
@ DHCPOPT_NON_LOCAL_SOURCE_ROUTING
Definition: DhcpLayer.h:141
DhcpOption addOption(const DhcpOptionBuilder &optionBuilder)
void computeCalculateFields()
void setClientHardwareAddress(const MacAddress &addr)
@ DEFAULT_IP_TTL
Definition: DhcpLayer.h:147
@ DHCPOPT_CONFIGURATION_FILE
Definition: DhcpLayer.h:375
@ DHCPOPT_GEOLOC
Definition: DhcpLayer.h:341
@ DHCPOPT_OPTION_V4_ACCESS_DOMAIN
Definition: DhcpLayer.h:383
DhcpOptionBuilder(DhcpOptionTypes optionType, uint16_t optionValue)
Definition: DhcpLayer.h:524
IPv4Address getYourIpAddress() const
Definition: DhcpLayer.h:651
Definition: DhcpLayer.h:398
@ DHCP_RELEASE
Definition: DhcpLayer.h:89
@ DHCPOPT_FORCERENEW_NONCE_CAPABLE
Definition: DhcpLayer.h:343
@ DHCPOPT_ALL_SUBNETS_LOCAL
Definition: DhcpLayer.h:155
@ DHCPOPT_SUBNET_SELECTION
Definition: DhcpLayer.h:311
DhcpOptionTypes
Definition: DhcpLayer.h:97
@ DHCPOPT_FINGER_SERVER
Definition: DhcpLayer.h:247
@ DHCPOPT_BOOT_SIZE
Definition: DhcpLayer.h:127
@ DHCPOPT_CLASSLESS_STATIC_ROUTE
Definition: DhcpLayer.h:317
@ DHCPOPT_OPTION_V4_PORTPARAMS
Definition: DhcpLayer.h:363
@ DHCP_OFFER
Definition: DhcpLayer.h:79
@ DHCPOPT_DHCP_RENEWAL_TIME
Definition: DhcpLayer.h:217
size_t getTotalSize() const
Definition: DhcpLayer.h:472
@ DHCPOPT_NWIP_DOMAIN_NAME
Definition: DhcpLayer.h:225
@ DHCP_ACK
Definition: DhcpLayer.h:85
@ DHCPOPT_DHCP_LEASE_TIME
Definition: DhcpLayer.h:203
@ DHCPOPT_REBOOT_TIME
Definition: DhcpLayer.h:379
@ DHCPOPT_OPTION_IPV4_ADDRESS_MOS
Definition: DhcpLayer.h:333
@ DHCPOPT_SUBNET_ALLOCATION
Definition: DhcpLayer.h:385
void setYourIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:657
@ DHCPOPT_OPTION_V4_PCP_SERVER
Definition: DhcpLayer.h:361
@ DHCPOPT_CCC
Definition: DhcpLayer.h:319
@ DHCPOPT_QUOTES_SERVERS
Definition: DhcpLayer.h:117
@ DHCPOPT_OPTION_6RD
Definition: DhcpLayer.h:381
@ DHCPOPT_NNTP_SERVER
Definition: DhcpLayer.h:243
DhcpOptionBuilder(DhcpOptionTypes optionType, const uint8_t *optionValue, uint8_t optionValueLen)
Definition: DhcpLayer.h:506
@ DHCPOPT_CLIENT_SYSTEM
Definition: DhcpLayer.h:285
@ DHCPOPT_RESOURCE_LOCATION_SERVERS
Definition: DhcpLayer.h:123
@ DHCPOPT_BROADCAST_ADDRESS
Definition: DhcpLayer.h:157
@ DHCPOPT_DHCP_AGENT_OPTIONS
Definition: DhcpLayer.h:265
@ DHCPOPT_END
Definition: DhcpLayer.h:389
@ DHCPOPT_MAX_DGRAM_REASSEMBLY
Definition: DhcpLayer.h:145
Definition: DhcpLayer.h:495
size_t getHeaderLen() const
Definition: DhcpLayer.h:767
@ DHCPOPT_POP3_SERVER
Definition: DhcpLayer.h:241
size_t getOptionsCount() const
@ DHCPOPT_DIRECTORY_AGENT
Definition: DhcpLayer.h:257
dhcp_header * getDhcpHeader() const
Definition: DhcpLayer.h:619
Definition: MacAddress.h:27
BootpOpCodes
Definition: DhcpLayer.h:62
@ DHCPOPT_START_TIME_OF_STATE
Definition: DhcpLayer.h:351
@ DHCPOPT_NIS_SERVER_ADDRESS
Definition: DhcpLayer.h:231
@ DHCPOPT_CLIENT_LAST_TXN_TIME
Definition: DhcpLayer.h:281
void parseNextLayer()
Definition: DhcpLayer.h:762
@ DHCPOPT_TCP_KEEPALIVE_GARBAGE
Definition: DhcpLayer.h:179
@ DHCPOPT_ISNS
Definition: DhcpLayer.h:267
@ DHCPOPT_DHCP_OPTION_OVERLOAD
Definition: DhcpLayer.h:205
@ DHCP_UNKNOWN_MSG_TYPE
Definition: DhcpLayer.h:75
@ DHCPOPT_X_DISPLAY_MANAGER
Definition: DhcpLayer.h:199
@ PATH_MTU_PLATEAU_TABLE
Definition: DhcpLayer.h:151
@ DHCPOPT_PATH_MTU_AGING_TIMEOUT
Definition: DhcpLayer.h:149
@ DHCPOPT_DHCP_REQUESTED_ADDRESS
Definition: DhcpLayer.h:201
@ DHCPOPT_IEEE802_3_ENCAPSULATION
Definition: DhcpLayer.h:173
@ DHCPOPT_NDS_SERVERS
Definition: DhcpLayer.h:269
DhcpOption(uint8_t *optionRawData)
Definition: DhcpLayer.h:406
@ DHCPOPT_SUBNET_MASK
Definition: DhcpLayer.h:103
@ DHCPOPT_QUERY_START_TIME
Definition: DhcpLayer.h:353
@ DHCPOPT_IMPRESS_SERVERS
Definition: DhcpLayer.h:121
DhcpOptionBuilder(DhcpOptionTypes optionType, uint32_t optionValue)
Definition: DhcpLayer.h:533
IPv4Address getValueAsIpAddr() const
Definition: DhcpLayer.h:417
@ DHCPOPT_GEOCONF_CIVIC
Definition: DhcpLayer.h:295
@ DHCPOPT_NAME_SERVERS
Definition: DhcpLayer.h:111
DhcpOption getOptionData(DhcpOptionTypes option) const
@ DHCPOPT_IP_FORWARDING
Definition: DhcpLayer.h:139
@ DHCPOPT_NETBIOS_SCOPE
Definition: DhcpLayer.h:195
@ DHCPOPT_PXELINUX_MAGIC
Definition: DhcpLayer.h:373
uint32_t toInt() const
Definition: IpAddress.h:125
std::string toString() const
DhcpMessageType
Definition: DhcpLayer.h:73
@ DHCPOPT_USER_CLASS
Definition: DhcpLayer.h:255
@ DHCPOPT_UUID_GUID
Definition: DhcpLayer.h:291
void setServerIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:646
@ DHCPOPT_IP_TELEPHONE
Definition: DhcpLayer.h:371
@ DHCPOPT_BOOTFILE_NAME
Definition: DhcpLayer.h:235
@ DHCPOPT_PERFORM_MASK_DISCOVERY
Definition: DhcpLayer.h:159
void setClientIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:635
@ DHCPOPT_NAME_SERVICE_SEARCH
Definition: DhcpLayer.h:309
DhcpOptionBuilder(DhcpOptionTypes optionType, const IPv4Address &optionValue)
Definition: DhcpLayer.h:542
@ DHCPOPT_DHCP_CLIENT_IDENTIFIER
Definition: DhcpLayer.h:223
@ DHCPOPT_ETHERBOOT
Definition: DhcpLayer.h:369
@ DHCPOPT_V_I_VENDOR_OPTS
Definition: DhcpLayer.h:325
@ DHCPOPT_ROOT_PATH
Definition: DhcpLayer.h:135
BootpOpCodes getOpCode() const
Definition: DhcpLayer.h:624
@ DHCPOPT_VENDOR_CLASS_IDENTIFIER
Definition: DhcpLayer.h:221
@ DHCPOPT_VIRTUAL_SUBNET_SELECTION
Definition: DhcpLayer.h:387
@ DHCPOPT_PAD
Definition: DhcpLayer.h:101
MacAddress getClientHardwareAddress() const
The main namespace for the PcapPlusPlus lib.
@ DHCPOPT_TIME_OFFSET
Definition: DhcpLayer.h:105
@ DHCPOPT_DHCP_PARAMETER_REQUEST_LIST
Definition: DhcpLayer.h:211
@ DHCPOPT_EXTENSIONS_PATH
Definition: DhcpLayer.h:137
@ DHCPOPT_MERIT_DUMP
Definition: DhcpLayer.h:129
DhcpOptionBuilder(DhcpOptionTypes optionType, const std::string &optionValue)
Definition: DhcpLayer.h:551
Definition: TLVData.h:351
@ DHCPOPT_SMTP_SERVER
Definition: DhcpLayer.h:239
@ DHCPOPT_LPR_SERVERS
Definition: DhcpLayer.h:119
std::string getValueAsString(int valueOffset=0) const
Definition: DhcpLayer.h:441
@ DHCPOPT_BASE_TIME
Definition: DhcpLayer.h:349
@ DHCPOPT_FONT_SERVERS
Definition: DhcpLayer.h:197
virtual ~DhcpOption()
Definition: DhcpLayer.h:411
size_t getDataSize() const
Definition: DhcpLayer.h:480
@ DHCPOPT_NTP_SERVERS
Definition: DhcpLayer.h:185
@ DHCPOPT_NIS_DOMAIN
Definition: DhcpLayer.h:181
@ DHCPOPT_DHCP_SERVER_IDENTIFIER
Definition: DhcpLayer.h:209
@ DHCP_DECLINE
Definition: DhcpLayer.h:83
DhcpOption addOptionAfter(const DhcpOptionBuilder &optionBuilder, DhcpOptionTypes prevOption)
@ DHCPOPT_IRC_SERVER
Definition: DhcpLayer.h:249
@ DHCP_BOOTREQUEST
Definition: DhcpLayer.h:65
Definition: DhcpLayer.h:584
@ DHCPOPT_RDNSS_SELECTION
Definition: DhcpLayer.h:345
@ DHCPOPT_CLIENT_NDI
Definition: DhcpLayer.h:287
DhcpOptionBuilder & operator=(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:565
@ DHCPOPT_NIS_DOMAIN_NAME
Definition: DhcpLayer.h:229
void setValueString(const std::string &stringValue, int valueOffset=0)
Definition: DhcpLayer.h:457
@ DHCPOPT_AUTO_CONFIG
Definition: DhcpLayer.h:307
@ DHCPOPT_WWW_SERVER
Definition: DhcpLayer.h:245
bool setMesageType(DhcpMessageType msgType)
@ DHCPOPT_PATH_PREFIX
Definition: DhcpLayer.h:377
@ DHCPOPT_TIME_SERVERS
Definition: DhcpLayer.h:109
@ DHCPOPT_NETINFO_TAG
Definition: DhcpLayer.h:303
@ DHCPOPT_TCP_KEEPALIVE_INTERVAL
Definition: DhcpLayer.h:177
@ DHCPOPT_DOMAIN_SEARCH
Definition: DhcpLayer.h:313
@ DHCPOPT_SWAP_SERVER
Definition: DhcpLayer.h:133
@ DHCPOPT_DEFAULT_TCP_TTL
Definition: DhcpLayer.h:175
@ DHCPOPT_NETBIOS_NAME_SERVERS
Definition: DhcpLayer.h:189
@ DHCPOPT_SIP_UA_CONFIG
Definition: DhcpLayer.h:337
@ DHCPOPT_GEOCONF
Definition: DhcpLayer.h:321
IPv4Address getClientIpAddress() const
Definition: DhcpLayer.h:629
@ DHCPOPT_DOMAIN_NAME
Definition: DhcpLayer.h:131
uint8_t recordValue[]
Definition: TLVData.h:35
@ DHCPOPT_USER_AUTH
Definition: DhcpLayer.h:293
@ DHCPOPT_BCMCS_CONTROLLER_DOMAIN_NAME_LIST
Definition: DhcpLayer.h:275
@ DHCPOPT_VENDOR_ENCAPSULATED_OPTIONS
Definition: DhcpLayer.h:187
@ DHCPOPT_HOME_AGENT_ADDRESS
Definition: DhcpLayer.h:237
@ DHCPOPT_LOG_SERVERS
Definition: DhcpLayer.h:115
@ DHCP_NAK
Definition: DhcpLayer.h:87
@ DHCPOPT_CAPTIVE_PORTAL
Definition: DhcpLayer.h:365
@ DHCPOPT_HOST_NAME
Definition: DhcpLayer.h:125
bool removeOption(DhcpOptionTypes optionType)
@ DHCPOPT_NETINFO_ADDRESS
Definition: DhcpLayer.h:301
@ DHCPOPT_DOMAIN_NAME_SERVERS
Definition: DhcpLayer.h:113
DhcpOptionBuilder(const DhcpOptionBuilder &other)
Definition: DhcpLayer.h:558
@ DHCPOPT_ROUTER_SOLICITATION_ADDRESS
Definition: DhcpLayer.h:165
@ DHCPOPT_NETBIOS_NODE_TYPE
Definition: DhcpLayer.h:193
@ DHCPOPT_TFTP_SERVER_NAME
Definition: DhcpLayer.h:233
@ DHCPOPT_STDA_SERVER
Definition: DhcpLayer.h:253
@ DHCPOPT_SERVICE_SCOPE
Definition: DhcpLayer.h:259
@ DHCPOPT_NIS_SERVERS
Definition: DhcpLayer.h:183
OsiModelLayer getOsiModelLayer() const
Definition: DhcpLayer.h:782
@ DHCPOPT_ASSOCIATED_IP
Definition: DhcpLayer.h:283
@ DHCPOPT_DHCP_MAX_MESSAGE_SIZE
Definition: DhcpLayer.h:215
@ DHCPOPT_UNKNOWN
Definition: DhcpLayer.h:99
uint8_t recordLen
Definition: TLVData.h:33
@ DHCPOPT_ROUTER_DISCOVERY
Definition: DhcpLayer.h:163
@ DHCP_INFORM
Definition: DhcpLayer.h:91
void setValueIpAddr(const IPv4Address &addr, int valueOffset=0)
Definition: DhcpLayer.h:429
DhcpOptionBuilder(DhcpOptionTypes optionType, uint8_t optionValue)
Definition: DhcpLayer.h:515
@ DHCPOPT_STATIC_ROUTES
Definition: DhcpLayer.h:167
@ DHCPOPT_NETBIOS_DD_SERVER
Definition: DhcpLayer.h:191
@ DHCPOPT_DHCP_REBINDING_TIME
Definition: DhcpLayer.h:219
@ DHCPOPT_INTERFACE_MTU
Definition: DhcpLayer.h:153
@ DHCPOPT_NDS_CONTEXT
Definition: DhcpLayer.h:273
void setGatewayIpAddress(const IPv4Address &addr)
Definition: DhcpLayer.h:668
@ DHCPOPT_STREETTALK_SERVER
Definition: DhcpLayer.h:251
@ DHCPOPT_ARP_CACHE_TIMEOUT
Definition: DhcpLayer.h:171
@ DHCP_DISCOVER
Definition: DhcpLayer.h:77
DhcpMessageType getMesageType() const
@ DHCPOPT_MASK_SUPPLIER
Definition: DhcpLayer.h:161
@ DHCPOPT_OPTION_CAPWAP_AC_V4
Definition: DhcpLayer.h:331
@ DHCPOPT_LDAP
Definition: DhcpLayer.h:289
@ DHCPOPT_V_I_VENDOR_CLASS
Definition: DhcpLayer.h:323