A Discrete-Event Network Simulator
API
ns3::DhcpHeader Class Reference

BOOTP header with DHCP messages supports the following options: Subnet Mask (1), Address Request (50), Refresh Lease Time (51), DHCP Message Type (53), DHCP Server ID (54), Renew Time (58), Rebind Time (59) and End (255) of BOOTP. More...

#include "dhcp-header.h"

+ Inheritance diagram for ns3::DhcpHeader:
+ Collaboration diagram for ns3::DhcpHeader:

Public Types

enum  Messages {
  DHCPDISCOVER = 0 , DHCPOFFER = 1 , DHCPREQ = 2 , DHCPACK = 4 ,
  DHCPNACK = 5
}
 DHCP messages. More...
 
enum  Options {
  OP_MASK = 1 , OP_ROUTE = 3 , OP_ADDREQ = 50 , OP_LEASE = 51 ,
  OP_MSGTYPE = 53 , OP_SERVID = 54 , OP_RENEW = 58 , OP_REBIND = 59 ,
  OP_END = 255
}
 BOOTP options. More...
 

Public Member Functions

 DhcpHeader ()
 Constructor. More...
 
 ~DhcpHeader () override
 Destructor. More...
 
Address GetChaddr ()
 Get the Address of the client. More...
 
Ipv4Address GetDhcps () const
 Get the information about the DHCP server. More...
 
uint32_t GetLease () const
 Return the lease time of the IPv4Address. More...
 
uint32_t GetMask () const
 Return the mask of the network. More...
 
uint32_t GetRebind () const
 Return the Rebind time of the address. More...
 
uint32_t GetRenew () const
 Return the Renewal time of the address. More...
 
Ipv4Address GetReq () const
 Get the IPv4Address requested by the client. More...
 
Ipv4Address GetRouter () const
 Return the Ipv4Address of gateway to be used. More...
 
uint32_t GetTran () const
 Get the transaction id. More...
 
uint8_t GetType () const
 Return the type of DHCP message. More...
 
Ipv4Address GetYiaddr () const
 Get the IPv4Address of the client. More...
 
void ResetOpt ()
 Reset the BOOTP options. More...
 
void SetChaddr (Address addr)
 Set the Address of the device. More...
 
void SetChaddr (uint8_t *addr, uint8_t len)
 Set the Address of the device. More...
 
void SetDhcps (Ipv4Address addr)
 Set the DHCP server information. More...
 
void SetHWType (uint8_t htype, uint8_t hlen)
 Set the hardware information. More...
 
void SetLease (uint32_t time)
 Set the lease time of the IPv4Address. More...
 
void SetMask (uint32_t addr)
 Set the mask of the IPv4Address. More...
 
void SetRebind (uint32_t time)
 Set the Rebind time of the IPv4Address. More...
 
void SetRenew (uint32_t time)
 Set the Renewal time of the IPv4Address. More...
 
void SetReq (Ipv4Address addr)
 Set the Ipv4Address requested by the client. More...
 
void SetRouter (Ipv4Address addr)
 Set the Ipv4Address of gateway to be used. More...
 
void SetTime ()
 Set the time when message is sent. More...
 
void SetTran (uint32_t tran)
 Set the transaction ID. More...
 
void SetType (uint8_t type)
 Set the type of BOOTP and DHCP messages. More...
 
void SetYiaddr (Ipv4Address addr)
 Set the IPv4Address of the client. More...
 
- Public Member Functions inherited from ns3::Header
 ~Header () override
 
virtual uint32_t Deserialize (Buffer::Iterator start)=0
 Deserialize the object from a buffer iterator. More...
 
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator. More...
 
- Public Member Functions inherited from ns3::Chunk
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Header
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Chunk
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Private Member Functions

uint32_t Deserialize (Buffer::Iterator start) override
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object. More...
 
uint32_t GetSerializedSize () const override
 
void Print (std::ostream &os) const override
 
void Serialize (Buffer::Iterator start) const override
 

Private Attributes

uint8_t m_bootp
 The BOOTP Message type. More...
 
uint8_t m_chaddr [16]
 The address identifier. More...
 
Ipv4Address m_ciAddr
 The IP address of the client. More...
 
Ipv4Address m_dhcps
 DHCP server IP address. More...
 
uint8_t m_file [128]
 File name (Padded for now) More...
 
uint16_t m_flags
 BOOTP flags. More...
 
Ipv4Address m_giAddr
 Relay Agent IP address. More...
 
uint8_t m_hLen
 The hardware length. More...
 
uint8_t m_hops
 The number of hops covered by the message. More...
 
uint8_t m_hType
 The hardware type. More...
 
uint32_t m_lease
 The lease time of the address. More...
 
uint32_t m_len
 The length of the header. More...
 
uint8_t m_magic_cookie [4]
 DHCP Magic Cookie. More...
 
uint32_t m_mask
 The mask of the network. More...
 
uint8_t m_op
 The DHCP Message type. More...
 
bool m_opt [255]
 BOOTP option list. More...
 
uint32_t m_rebind
 The rebinding time for the client. More...
 
uint32_t m_renew
 The renewal time for the client. More...
 
Ipv4Address m_req
 Requested Address. More...
 
Ipv4Address m_route
 Router Option Address. More...
 
uint16_t m_secs
 Seconds elapsed. More...
 
Ipv4Address m_siAddr
 Next Server IP address. More...
 
uint8_t m_sname [64]
 Server name (Padded for now) More...
 
uint32_t m_xid
 The transaction number. More...
 
Ipv4Address m_yiAddr
 Your (client) IP address. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

BOOTP header with DHCP messages supports the following options: Subnet Mask (1), Address Request (50), Refresh Lease Time (51), DHCP Message Type (53), DHCP Server ID (54), Renew Time (58), Rebind Time (59) and End (255) of BOOTP.

  0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |     op (1)    |   htype (1)   |   hlen (1)    |   hops (1)    |
 +---------------+---------------+---------------+---------------+
 |                            xid (4)                            |
 +-------------------------------+-------------------------------+
 |           secs (2)            |           flags (2)           |
 +-------------------------------+-------------------------------+
 |                          ciaddr  (4)                          |
 +---------------------------------------------------------------+
 |                          yiaddr  (4)                          |
 +---------------------------------------------------------------+
 |                          siaddr  (4)                          |
 +---------------------------------------------------------------+
 |                          giaddr  (4)                          |
 +---------------------------------------------------------------+
 |                                                               |
 |                          chaddr  (16)                         |
 |                                                               |
 |                                                               |
 +---------------------------------------------------------------+
 |                                                               |
 |                          sname   (64)                         |
 +---------------------------------------------------------------+
 |                                                               |
 |                          file    (128)                        |
 +---------------------------------------------------------------+
 |                                                               |
 |                          options (variable)                   |
 +---------------------------------------------------------------+

Definition at line 84 of file dhcp-header.h.

Member Enumeration Documentation

◆ Messages

DHCP messages.

Enumerator
DHCPDISCOVER 

Code for DHCP Discover.

DHCPOFFER 

Code for DHCP Offer.

DHCPREQ 

Code for DHCP Request.

DHCPACK 

Code for DHCP ACK.

DHCPNACK 

Code for DHCP NACK.

Definition at line 118 of file dhcp-header.h.

◆ Options

BOOTP options.

Enumerator
OP_MASK 

BOOTP Option 1: Address Mask.

OP_ROUTE 

BOOTP Option 3: Router Option.

OP_ADDREQ 

BOOTP Option 50: Requested Address.

OP_LEASE 

BOOTP Option 51: Address Lease Time.

OP_MSGTYPE 

BOOTP Option 53: DHCP Message Type.

OP_SERVID 

BOOTP Option 54: Server Identifier.

OP_RENEW 

BOOTP Option 58: Address Renewal Time.

OP_REBIND 

BOOTP Option 59: Address Rebind Time.

OP_END 

BOOTP Option 255: END.

Definition at line 104 of file dhcp-header.h.

Constructor & Destructor Documentation

◆ DhcpHeader()

ns3::DhcpHeader::DhcpHeader ( )

Constructor.

Definition at line 37 of file dhcp-header.cc.

References m_ciAddr, m_dhcps, m_file, m_flags, m_giAddr, m_hLen, m_hops, m_hType, m_len, m_magic_cookie, m_req, m_route, m_secs, m_siAddr, m_sname, m_xid, and m_yiAddr.

◆ ~DhcpHeader()

ns3::DhcpHeader::~DhcpHeader ( )
override

Destructor.

Definition at line 71 of file dhcp-header.cc.

Member Function Documentation

◆ Deserialize()

uint32_t ns3::DhcpHeader::Deserialize ( Buffer::Iterator  start)
overrideprivatevirtual
Parameters
startan iterator which points to where the header should read from.
Returns
the number of bytes read.

This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.

Note that data is not actually removed from the buffer to which the iterator points. Both Packet::RemoveHeader() and Packet::PeekHeader() call Deserialize(), but only the RemoveHeader() has additional statements to remove the header bytes from the underlying buffer and associated metadata.

Implements ns3::Header.

Definition at line 383 of file dhcp-header.cc.

References m_bootp, m_chaddr, m_ciAddr, m_dhcps, m_file, m_flags, m_giAddr, m_hLen, m_hops, m_hType, m_lease, m_len, m_magic_cookie, m_mask, m_op, m_rebind, m_renew, m_req, m_route, m_secs, m_siAddr, m_sname, m_xid, m_yiAddr, NS_LOG_WARN, OP_ADDREQ, OP_END, OP_LEASE, OP_MASK, OP_MSGTYPE, OP_REBIND, OP_RENEW, OP_ROUTE, OP_SERVID, ns3::Buffer::Iterator::Read(), ns3::ReadFrom(), ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadNtohU32(), ns3::Buffer::Iterator::ReadU16(), ns3::Buffer::Iterator::ReadU32(), ns3::Buffer::Iterator::ReadU8(), and two-ray-to-three-gpp-ch-calibration::start.

+ Here is the call graph for this function:

◆ GetChaddr()

Address ns3::DhcpHeader::GetChaddr ( )

Get the Address of the client.

Note: the address is always 16-bytes long.

Returns
Address of the client

Definition at line 135 of file dhcp-header.cc.

References ns3::Address::CopyFrom(), and m_chaddr.

Referenced by ns3::DhcpClient::NetHandler(), ns3::DhcpServer::SendAck(), and ns3::DhcpServer::SendOffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDhcps()

Ipv4Address ns3::DhcpHeader::GetDhcps ( ) const

Get the information about the DHCP server.

Returns
IPv4Address of DHCP server

Definition at line 166 of file dhcp-header.cc.

References m_dhcps.

Referenced by ns3::DhcpClient::Select().

+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::DhcpHeader::GetInstanceTypeId ( ) const
overrideprivatevirtual

Get the most derived TypeId for this Object.

This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.

Returns
The TypeId associated to the most-derived type of this instance.

Implements ns3::ObjectBase.

Definition at line 301 of file dhcp-header.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetLease()

uint32_t ns3::DhcpHeader::GetLease ( ) const

Return the lease time of the IPv4Address.

Returns
32 bit time

Definition at line 234 of file dhcp-header.cc.

References m_lease.

Referenced by ns3::DhcpClient::Select().

+ Here is the caller graph for this function:

◆ GetMask()

uint32_t ns3::DhcpHeader::GetMask ( ) const

Return the mask of the network.

Returns
32 bit mask

Definition at line 200 of file dhcp-header.cc.

References m_mask.

Referenced by ns3::DhcpClient::Select().

+ Here is the caller graph for this function:

◆ GetRebind()

uint32_t ns3::DhcpHeader::GetRebind ( ) const

Return the Rebind time of the address.

Returns
32 bit time

Definition at line 268 of file dhcp-header.cc.

References m_rebind.

Referenced by ns3::DhcpClient::Select().

+ Here is the caller graph for this function:

◆ GetRenew()

uint32_t ns3::DhcpHeader::GetRenew ( ) const

Return the Renewal time of the address.

Returns
32 bit time

Definition at line 251 of file dhcp-header.cc.

References m_renew.

Referenced by ns3::DhcpClient::Select().

+ Here is the caller graph for this function:

◆ GetReq()

Ipv4Address ns3::DhcpHeader::GetReq ( ) const

Get the IPv4Address requested by the client.

Returns
IPv4Address requested by the client

Definition at line 183 of file dhcp-header.cc.

References m_req.

Referenced by ns3::DhcpServer::NetHandler(), and ns3::DhcpServer::SendAck().

+ Here is the caller graph for this function:

◆ GetRouter()

Ipv4Address ns3::DhcpHeader::GetRouter ( ) const

Return the Ipv4Address of gateway to be used.

Returns
The Ipv4Address of the gateway

Definition at line 217 of file dhcp-header.cc.

References m_route.

Referenced by ns3::DhcpClient::Select().

+ Here is the caller graph for this function:

◆ GetSerializedSize()

uint32_t ns3::DhcpHeader::GetSerializedSize ( ) const
overrideprivatevirtual
Returns
the expected size of the header.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. This method should return the number of bytes which are needed to store the full header data by Serialize.

Implements ns3::Header.

Definition at line 285 of file dhcp-header.cc.

References m_len.

◆ GetTran()

uint32_t ns3::DhcpHeader::GetTran ( ) const

Get the transaction id.

Returns
The transaction id

Definition at line 107 of file dhcp-header.cc.

References m_xid.

Referenced by ns3::DhcpServer::SendAck(), and ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

◆ GetType()

uint8_t ns3::DhcpHeader::GetType ( ) const

Return the type of DHCP message.

Returns
The type of message

Definition at line 88 of file dhcp-header.cc.

References m_op.

Referenced by ns3::DhcpClient::NetHandler(), and ns3::DhcpServer::NetHandler().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::DhcpHeader::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 291 of file dhcp-header.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetYiaddr()

Ipv4Address ns3::DhcpHeader::GetYiaddr ( ) const

Get the IPv4Address of the client.

Returns
IPv4Address of the client

Definition at line 149 of file dhcp-header.cc.

References m_yiAddr.

Referenced by ns3::DhcpClient::Select().

+ Here is the caller graph for this function:

◆ Print()

void ns3::DhcpHeader::Print ( std::ostream &  os) const
overrideprivatevirtual
Parameters
osoutput stream This method is used by Packet::Print to print the content of a header as ascii data to a c++ output stream. Although the header is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace. i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5

Implements ns3::Header.

Definition at line 307 of file dhcp-header.cc.

References m_op.

◆ ResetOpt()

void ns3::DhcpHeader::ResetOpt ( )

Reset the BOOTP options.

Definition at line 274 of file dhcp-header.cc.

References m_len, m_opt, and OP_END.

Referenced by ns3::DhcpClient::Boot(), ns3::DhcpClient::Request(), ns3::DhcpServer::SendAck(), and ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

◆ Serialize()

void ns3::DhcpHeader::Serialize ( Buffer::Iterator  start) const
overrideprivatevirtual
Parameters
startan iterator which points to where the header should be written.

This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. The data written is expected to match bit-for-bit the representation of this header in a real network.

Implements ns3::Header.

Definition at line 313 of file dhcp-header.cc.

References m_bootp, m_chaddr, m_ciAddr, m_dhcps, m_file, m_flags, m_giAddr, m_hLen, m_hops, m_hType, m_lease, m_magic_cookie, m_mask, m_op, m_opt, m_rebind, m_renew, m_req, m_route, m_secs, m_siAddr, m_sname, m_xid, m_yiAddr, OP_ADDREQ, OP_END, OP_LEASE, OP_MASK, OP_MSGTYPE, OP_REBIND, OP_RENEW, OP_ROUTE, OP_SERVID, two-ray-to-three-gpp-ch-calibration::start, ns3::Buffer::Iterator::Write(), ns3::Buffer::Iterator::WriteHtonU16(), ns3::Buffer::Iterator::WriteHtonU32(), ns3::WriteTo(), ns3::Buffer::Iterator::WriteU16(), ns3::Buffer::Iterator::WriteU32(), and ns3::Buffer::Iterator::WriteU8().

+ Here is the call graph for this function:

◆ SetChaddr() [1/2]

void ns3::DhcpHeader::SetChaddr ( Address  addr)

Set the Address of the device.

Only the relevant bits are considered (i.e., not the type and length)

Parameters
addrAddress of the device

Definition at line 119 of file dhcp-header.cc.

References ns3::Address::CopyTo(), ns3::Address::GetLength(), m_chaddr, and NS_ASSERT_MSG.

Referenced by ns3::DhcpClient::Boot(), ns3::DhcpClient::Request(), ns3::DhcpServer::SendAck(), and ns3::DhcpServer::SendOffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetChaddr() [2/2]

void ns3::DhcpHeader::SetChaddr ( uint8_t *  addr,
uint8_t  len 
)

Set the Address of the device.

Parameters
addrAddress of the device
lenAddress length

Definition at line 127 of file dhcp-header.cc.

References m_chaddr, and NS_ASSERT_MSG.

◆ SetDhcps()

void ns3::DhcpHeader::SetDhcps ( Ipv4Address  addr)

Set the DHCP server information.

Parameters
addrIPv4Address of the server

Definition at line 155 of file dhcp-header.cc.

References m_dhcps, m_len, m_opt, and OP_SERVID.

Referenced by ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

◆ SetHWType()

void ns3::DhcpHeader::SetHWType ( uint8_t  htype,
uint8_t  hlen 
)

Set the hardware information.

Parameters
htypeHardware type
hlenHardware length

Definition at line 94 of file dhcp-header.cc.

References m_hLen, and m_hType.

◆ SetLease()

void ns3::DhcpHeader::SetLease ( uint32_t  time)

Set the lease time of the IPv4Address.

Parameters
time32 bit time

Definition at line 223 of file dhcp-header.cc.

References m_lease, m_len, m_opt, and OP_LEASE.

Referenced by ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

◆ SetMask()

void ns3::DhcpHeader::SetMask ( uint32_t  addr)

Set the mask of the IPv4Address.

Parameters
addr32 bit mask

Definition at line 189 of file dhcp-header.cc.

References m_len, m_mask, m_opt, and OP_MASK.

Referenced by ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

◆ SetRebind()

void ns3::DhcpHeader::SetRebind ( uint32_t  time)

Set the Rebind time of the IPv4Address.

Parameters
time32 bit time

Definition at line 257 of file dhcp-header.cc.

References m_len, m_opt, m_rebind, and OP_REBIND.

Referenced by ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

◆ SetRenew()

void ns3::DhcpHeader::SetRenew ( uint32_t  time)

Set the Renewal time of the IPv4Address.

Parameters
time32 bit time

Definition at line 240 of file dhcp-header.cc.

References m_len, m_opt, m_renew, and OP_RENEW.

Referenced by ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

◆ SetReq()

void ns3::DhcpHeader::SetReq ( Ipv4Address  addr)

Set the Ipv4Address requested by the client.

Parameters
addrIpv4Address requested by the client

Definition at line 172 of file dhcp-header.cc.

References m_len, m_opt, m_req, and OP_ADDREQ.

Referenced by ns3::DhcpClient::Request().

+ Here is the caller graph for this function:

◆ SetRouter()

void ns3::DhcpHeader::SetRouter ( Ipv4Address  addr)

Set the Ipv4Address of gateway to be used.

Parameters
addrThe Ipv4Address of the gateway

Definition at line 206 of file dhcp-header.cc.

References m_len, m_opt, m_route, and OP_ROUTE.

Referenced by ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

◆ SetTime()

void ns3::DhcpHeader::SetTime ( )

Set the time when message is sent.

Definition at line 113 of file dhcp-header.cc.

References ns3::Time::GetSeconds(), m_secs, and ns3::Simulator::Now().

Referenced by ns3::DhcpClient::Boot(), ns3::DhcpClient::Request(), ns3::DhcpServer::SendAck(), and ns3::DhcpServer::SendOffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetTran()

void ns3::DhcpHeader::SetTran ( uint32_t  tran)

Set the transaction ID.

Parameters
tranThe transaction number

Definition at line 101 of file dhcp-header.cc.

References m_xid.

Referenced by ns3::DhcpClient::Boot(), ns3::DhcpClient::Request(), ns3::DhcpServer::SendAck(), and ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

◆ SetType()

void ns3::DhcpHeader::SetType ( uint8_t  type)

Set the type of BOOTP and DHCP messages.

Parameters
typeThe type of message

Definition at line 76 of file dhcp-header.cc.

References m_bootp, m_len, m_op, m_opt, OP_MSGTYPE, and check-style-clang-format::type.

Referenced by ns3::DhcpClient::Boot(), ns3::DhcpClient::Request(), ns3::DhcpServer::SendAck(), and ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

◆ SetYiaddr()

void ns3::DhcpHeader::SetYiaddr ( Ipv4Address  addr)

Set the IPv4Address of the client.

Parameters
addrThe client Ipv4Address

Definition at line 143 of file dhcp-header.cc.

References m_yiAddr.

Referenced by ns3::DhcpServer::SendAck(), and ns3::DhcpServer::SendOffer().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_bootp

uint8_t ns3::DhcpHeader::m_bootp
private

The BOOTP Message type.

Definition at line 297 of file dhcp-header.h.

Referenced by Deserialize(), Serialize(), and SetType().

◆ m_chaddr

uint8_t ns3::DhcpHeader::m_chaddr[16]
private

The address identifier.

Definition at line 306 of file dhcp-header.h.

Referenced by Deserialize(), GetChaddr(), Serialize(), and SetChaddr().

◆ m_ciAddr

Ipv4Address ns3::DhcpHeader::m_ciAddr
private

The IP address of the client.

Definition at line 308 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), and Serialize().

◆ m_dhcps

Ipv4Address ns3::DhcpHeader::m_dhcps
private

DHCP server IP address.

Definition at line 311 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), GetDhcps(), Serialize(), and SetDhcps().

◆ m_file

uint8_t ns3::DhcpHeader::m_file[128]
private

File name (Padded for now)

Definition at line 315 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), and Serialize().

◆ m_flags

uint16_t ns3::DhcpHeader::m_flags
private

BOOTP flags.

Definition at line 305 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), and Serialize().

◆ m_giAddr

Ipv4Address ns3::DhcpHeader::m_giAddr
private

Relay Agent IP address.

Definition at line 310 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), and Serialize().

◆ m_hLen

uint8_t ns3::DhcpHeader::m_hLen
private

The hardware length.

Definition at line 299 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), Serialize(), and SetHWType().

◆ m_hops

uint8_t ns3::DhcpHeader::m_hops
private

The number of hops covered by the message.

Definition at line 300 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), and Serialize().

◆ m_hType

uint8_t ns3::DhcpHeader::m_hType
private

The hardware type.

Definition at line 298 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), Serialize(), and SetHWType().

◆ m_lease

uint32_t ns3::DhcpHeader::m_lease
private

The lease time of the address.

Definition at line 317 of file dhcp-header.h.

Referenced by Deserialize(), GetLease(), Serialize(), and SetLease().

◆ m_len

uint32_t ns3::DhcpHeader::m_len
private

The length of the header.

Definition at line 303 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), GetSerializedSize(), ResetOpt(), SetDhcps(), SetLease(), SetMask(), SetRebind(), SetRenew(), SetReq(), SetRouter(), and SetType().

◆ m_magic_cookie

uint8_t ns3::DhcpHeader::m_magic_cookie[4]
private

DHCP Magic Cookie.

Definition at line 316 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), and Serialize().

◆ m_mask

uint32_t ns3::DhcpHeader::m_mask
private

The mask of the network.

Definition at line 302 of file dhcp-header.h.

Referenced by Deserialize(), GetMask(), Serialize(), and SetMask().

◆ m_op

uint8_t ns3::DhcpHeader::m_op
private

The DHCP Message type.

Definition at line 296 of file dhcp-header.h.

Referenced by Deserialize(), GetType(), Print(), Serialize(), and SetType().

◆ m_opt

bool ns3::DhcpHeader::m_opt[255]
private

BOOTP option list.

Definition at line 320 of file dhcp-header.h.

Referenced by ResetOpt(), Serialize(), SetDhcps(), SetLease(), SetMask(), SetRebind(), SetRenew(), SetReq(), SetRouter(), and SetType().

◆ m_rebind

uint32_t ns3::DhcpHeader::m_rebind
private

The rebinding time for the client.

Definition at line 319 of file dhcp-header.h.

Referenced by Deserialize(), GetRebind(), Serialize(), and SetRebind().

◆ m_renew

uint32_t ns3::DhcpHeader::m_renew
private

The renewal time for the client.

Definition at line 318 of file dhcp-header.h.

Referenced by Deserialize(), GetRenew(), Serialize(), and SetRenew().

◆ m_req

Ipv4Address ns3::DhcpHeader::m_req
private

Requested Address.

Definition at line 312 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), GetReq(), Serialize(), and SetReq().

◆ m_route

Ipv4Address ns3::DhcpHeader::m_route
private

Router Option Address.

Definition at line 313 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), GetRouter(), Serialize(), and SetRouter().

◆ m_secs

uint16_t ns3::DhcpHeader::m_secs
private

Seconds elapsed.

Definition at line 304 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), Serialize(), and SetTime().

◆ m_siAddr

Ipv4Address ns3::DhcpHeader::m_siAddr
private

Next Server IP address.

Definition at line 309 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), and Serialize().

◆ m_sname

uint8_t ns3::DhcpHeader::m_sname[64]
private

Server name (Padded for now)

Definition at line 314 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), and Serialize().

◆ m_xid

uint32_t ns3::DhcpHeader::m_xid
private

The transaction number.

Definition at line 301 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), GetTran(), Serialize(), and SetTran().

◆ m_yiAddr

Ipv4Address ns3::DhcpHeader::m_yiAddr
private

Your (client) IP address.

Definition at line 307 of file dhcp-header.h.

Referenced by DhcpHeader(), Deserialize(), GetYiaddr(), Serialize(), and SetYiaddr().


The documentation for this class was generated from the following files: