16#include "ns3/application.h"
17#include "ns3/ipv6-address.h"
18#include "ns3/net-device-container.h"
27class Inet6SocketAddress;
95 typedef std::unordered_multimap<Duid, std::pair<Ipv6Address, Time>,
Duid::DuidHash>
233 std::multimap<Duid, std::pair<Options::OptionType, uint32_t>>
m_iaBindings;
The base class for all ns3 applications.
Implements the DHCPv6 server.
void SendAdvertise(Ptr< NetDevice > iDev, Dhcp6Header header, Inet6SocketAddress client)
Sends DHCPv6 Advertise after receiving DHCPv6 Solicit.
std::unordered_map< uint32_t, Ptr< Socket > > m_sendSockets
Map of NetDevice - Corresponding socket used to send packets.
void DoDispose() override
Destructor implementation.
void SendReply(Ptr< NetDevice > iDev, Dhcp6Header header, Inet6SocketAddress client)
Sends Reply after receiving Request.
void TimerHandler()
Modifies the remaining lease time of addresses.
void StartApplication() override
Application specific startup code.
void AddSubnet(Ipv6Address pool, Ipv6Prefix prefix, Ipv6Address minAddress, Ipv6Address maxAddress)
Add a managed address pool.
std::multimap< Duid, std::pair< Options::OptionType, uint32_t > > m_iaBindings
Store IA bindings. Map of DUID + IA Type / IAID.
Duid m_serverDuid
Server DUID.
EventId m_leaseCleanupEvent
Event ID for lease cleanup.
void NetHandler(Ptr< Socket > socket)
Handles incoming packets from the network.
static TypeId GetTypeId()
Get the type ID.
Dhcp6Server()
Default constructor.
Ptr< Socket > m_recvSocket
Socket bound to port 547.
Time m_validLifetime
Default valid lifetime.
Time m_prefLifetime
Default preferred lifetime for an address.
Time m_renew
The default renew timer.
std::vector< LeaseInfo > m_subnets
List of managed subnets.
void SetDhcp6ServerNetDevice(NetDeviceContainer netDevices)
Set the list of net devices that the DHCPv6 server will use.
void CleanLeases()
Clean up stale lease info.
void ProcessSolicit(Ptr< NetDevice > iDev, Dhcp6Header header, Inet6SocketAddress client)
Sends DHCPv6 Advertise after receiving DHCPv6 Solicit.
void StopApplication() override
Application specific shutdown code.
Time m_leaseCleanup
Lease cleanup time.
void ReceiveMflag(uint32_t recvInterface)
Callback for when an M flag is received.
void UpdateBindings(Ptr< NetDevice > iDev, Dhcp6Header header, Inet6SocketAddress client)
Sends Reply after receiving Request.
void RenewRebindLeases(Ptr< NetDevice > iDev, Dhcp6Header header, Inet6SocketAddress client)
Sends Reply after receiving Request.
Time m_rebind
The default rebind timer.
Class providing a hash for DUIDs.
Implements the unique identifier for DHCPv6.
An identifier for simulation events.
Describes an IPv6 address.
Describes an IPv6 prefix.
Includes information about available subnets and corresponding leases.
std::unordered_multimap< Duid, std::pair< Ipv6Address, Time >, Duid::DuidHash > LeasedAddresses
Leased Addresses Client DUID + Ipv6Address / Lease time.
Ipv6Address GetMinAddress() const
Get the minimum address in the pool.
DeclinedAddresses m_declinedAddresses
Declined addresses.
uint32_t GetNumAddresses() const
Get the number of addresses leased.
Ipv6Address m_maxAddress
Maximum address in the pool.
Ipv6Prefix GetPrefix() const
Get the prefix of the address pool.
Ipv6Prefix m_prefix
Prefix of the address pool.
Ipv6Address GetMaxAddress() const
Get the maximum address in the pool.
Ipv6Address m_maxOfferedAddress
Maximum address offered so far.
ExpiredAddresses m_expiredAddresses
Expired addresses.
LeasedAddresses m_leasedAddresses
Leased addresses.
Ipv6Address m_addressPool
Address pool.
Ipv6Address GetAddressPool() const
Get the address pool.
std::multimap< Time, std::pair< Duid, Ipv6Address > > ExpiredAddresses
Expired Addresses (Section 6.2 of RFC 8415) Expired time / Ipv6Address.
std::unordered_map< Ipv6Address, Duid, Ipv6AddressHash > DeclinedAddresses
Declined Addresses Ipv6Address + Client DUID.
Ipv6Address m_minAddress
Minimum address in the pool.
uint32_t m_numAddresses
Number of addresses leased.
LeaseInfo(Ipv6Address addressPool, Ipv6Prefix prefix, Ipv6Address minAddress, Ipv6Address maxAddress)
Constructor.
holds a vector of ns3::NetDevice pointers
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.