A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::Ipv4InterfaceAddress Class Reference

a class to store IPv4 address information on an interface More...

#include <ipv4-interface-address.h>

Public Types

enum  InterfaceAddressScope_e { HOST, LINK, GLOBAL }
 

Public Member Functions

 Ipv4InterfaceAddress (Ipv4Address local, Ipv4Mask mask)
 
 Ipv4InterfaceAddress (const Ipv4InterfaceAddress &o)
 
Ipv4Address GetBroadcast (void) const
 
Ipv4Address GetLocal (void) const
 
Ipv4Mask GetMask (void) const
 
Ipv4InterfaceAddress::InterfaceAddressScope_e GetScope (void) const
 
bool IsSecondary (void) const
 
void SetBroadcast (Ipv4Address broadcast)
 
void SetLocal (Ipv4Address local)
 
void SetMask (Ipv4Mask mask)
 
void SetPrimary (void)
 
void SetScope (Ipv4InterfaceAddress::InterfaceAddressScope_e scope)
 
void SetSecondary (void)
 

Private Attributes

Ipv4Address m_broadcast
 
Ipv4Address m_local
 
Ipv4Mask m_mask
 
InterfaceAddressScope_e m_scope
 
bool m_secondary
 

Friends

bool operator!= (Ipv4InterfaceAddress const &a, Ipv4InterfaceAddress const &b)
 
bool operator== (Ipv4InterfaceAddress const &a, Ipv4InterfaceAddress const &b)
 

Detailed Description

a class to store IPv4 address information on an interface

Corresponds to Linux struct in_ifaddr. A list of these addresses is stored in Ipv4Interface. This class is modelled after how current Linux handles IP aliasing for IPv4. Notably, aliasing of IPv4 interfaces (e.g., "eth0:1") is not used, and instead an interface is assigned possibly multiple addresses, with each address being classified as being primary and secondary. See the iproute2 documentation for this distinction.

Definition at line 42 of file ipv4-interface-address.h.


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