Constructor
new DHCP()
PropertiesName | Type | Description |
---|---|---|
src | number | Source DHCP port. |
dst | number | Destination DHCP port. |
totalLength | number | This field specifies the length in bytes of the DHCP datagram (the header fields and Data field) in octets. |
checksum | number | The 16-bit checksum field is used for error-checking of the header and data. |
- Implements
- Source
Members
bootFilename :string
BootP boot file name.
Type:
- string
- Source
clientHardwareAddress :string
Usually the client MAC
Type:
- string
- Source
clientIpAddress :string
The destination IP address in human-readable format.
Type:
- string
- Source
gatewayIpAddress :string
The destination IP address in human-readable format.
Type:
- string
- Source
length :number
Number of bytes occupied by the layer.
Type:
- number
- Implements
- Source
options :Iterable.<TLVOption>
TLV options;
Type:
- Iterable.<TLVOption>
- Source
osi :OsiModelLayers
Respective protocol OSI layer.
Type:
- Implements
- Source
serverName :string
BootP server name.
Type:
- string
- Source
yourIpAddress :string
The destination IP address in human-readable format.
Type:
- string
- Source
Methods
calculateChecksum()
Calculates and updates the checksum for the DHCP layer. This method mutates the object by setting the `checksum` property based on the current state of the `buffer` and `prev` field.
- Source
toObject() → {Object}
Retrieves all fields of the DHCP layer.
- Implements
- Source
Returns:
The DHCP layer fields as an object.
- Type:
- Object
Example
udp.toObject();
// {
// src: 52622,
// dst: 24043,
// seq: 3994458414,
// totalLength: 2048,
// checksum: 3346,
// }