Describes an IPv6 prefix. More...
#include "ipv6-address.h"
Public Member Functions | |
| Ipv6Prefix () | |
| Default constructor. More... | |
| Ipv6Prefix (uint8_t prefix[16]) | |
| Constructs an Ipv6Prefix by using the input 16 bytes. More... | |
| Ipv6Prefix (char const *prefix) | |
| Constructs an Ipv6Prefix by using the input string. More... | |
| Ipv6Prefix (uint8_t prefix[16], uint8_t prefixLength) | |
| Constructs an Ipv6Prefix by using the input 16 bytes. More... | |
| Ipv6Prefix (char const *prefix, uint8_t prefixLength) | |
| Constructs an Ipv6Prefix by using the input string. More... | |
| Ipv6Prefix (uint8_t prefix) | |
| Constructs an Ipv6Prefix by using the input number of bits. More... | |
| Ipv6Prefix (Ipv6Prefix const &prefix) | |
| Copy constructor. More... | |
| Ipv6Prefix (Ipv6Prefix const *prefix) | |
| Copy constructor. More... | |
| ~Ipv6Prefix () | |
| Destructor. More... | |
| Ipv6Address | ConvertToIpv6Address () const |
| Convert the Prefix into an IPv6 Address. More... | |
| void | GetBytes (uint8_t buf[16]) const |
| Get the bytes corresponding to the prefix. More... | |
| uint8_t | GetMinimumPrefixLength () const |
| Get the minimum prefix length, i.e., 128 - the length of the largest sequence trailing zeroes. More... | |
| uint8_t | GetPrefixLength () const |
| Get prefix length. More... | |
| NS_DEPRECATED_3_31 bool | IsEqual (const Ipv6Prefix &other) const |
| Comparison operation between two Ipv6Prefix. More... | |
| bool | IsMatch (Ipv6Address a, Ipv6Address b) const |
| If the Address match the type. More... | |
| void | Print (std::ostream &os) const |
| Print this address to the given output stream. More... | |
| void | SetPrefixLength (uint8_t prefixLength) |
| Set prefix length. More... | |
Static Public Member Functions | |
| static Ipv6Prefix | GetLoopback () |
| Get the loopback prefix ( /128). More... | |
| static Ipv6Prefix | GetOnes () |
| Get the "all-1" IPv6 mask (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff). More... | |
| static Ipv6Prefix | GetZero () |
| Get the zero prefix ( /0). More... | |
Private Attributes | |
| uint8_t | m_prefix [16] |
| The prefix representation. More... | |
| uint8_t | m_prefixLength |
| The prefix length. More... | |
Friends | |
| bool | operator!= (Ipv6Prefix const &a, Ipv6Prefix const &b) |
| Not equal to operator. More... | |
| bool | operator== (Ipv6Prefix const &a, Ipv6Prefix const &b) |
| Equal to operator. More... | |
Describes an IPv6 prefix.
It is just a bitmask like Ipv4Mask.
Definition at line 466 of file ipv6-address.h.
| ns3::Ipv6Prefix::Ipv6Prefix | ( | ) |
Default constructor.
Definition at line 958 of file ipv6-address.cc.
References m_prefix, m_prefixLength, and NS_LOG_FUNCTION.
| ns3::Ipv6Prefix::Ipv6Prefix | ( | uint8_t | prefix[16] | ) |
Constructs an Ipv6Prefix by using the input 16 bytes.
The prefix length is calculated as the minimum prefix length, i.e., 2001:db8:cafe:: will have a 47 bit prefix length.
| prefix | the 128-bit prefix |
Definition at line 972 of file ipv6-address.cc.
References GetMinimumPrefixLength(), m_prefix, m_prefixLength, and NS_LOG_FUNCTION.
Here is the call graph for this function:| ns3::Ipv6Prefix::Ipv6Prefix | ( | char const * | prefix | ) |
Constructs an Ipv6Prefix by using the input string.
The prefix length is calculated as the minimum prefix length, i.e., 2001:db8:cafe:: will have a 47 bit prefix length.
| prefix | the 128-bit prefix |
Definition at line 965 of file ipv6-address.cc.
References ns3::AsciiToIpv6Host(), GetMinimumPrefixLength(), m_prefix, m_prefixLength, and NS_LOG_FUNCTION.
Here is the call graph for this function:| ns3::Ipv6Prefix::Ipv6Prefix | ( | uint8_t | prefix[16], |
| uint8_t | prefixLength | ||
| ) |
Constructs an Ipv6Prefix by using the input 16 bytes.
| prefix | the 128-bit prefix |
| prefixLength | the prefix length |
Definition at line 990 of file ipv6-address.cc.
References GetMinimumPrefixLength(), m_prefix, m_prefixLength, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Here is the call graph for this function:| ns3::Ipv6Prefix::Ipv6Prefix | ( | char const * | prefix, |
| uint8_t | prefixLength | ||
| ) |
Constructs an Ipv6Prefix by using the input string.
| prefix | the 128-bit prefix |
| prefixLength | the prefix length |
Definition at line 979 of file ipv6-address.cc.
References ns3::AsciiToIpv6Host(), GetMinimumPrefixLength(), m_prefix, m_prefixLength, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Here is the call graph for this function:| ns3::Ipv6Prefix::Ipv6Prefix | ( | uint8_t | prefix | ) |
Constructs an Ipv6Prefix by using the input number of bits.
| prefix | number of bits of the prefix (0 - 128) |
Definition at line 1001 of file ipv6-address.cc.
References m_prefix, m_prefixLength, NS_ASSERT, and NS_LOG_FUNCTION.
| ns3::Ipv6Prefix::Ipv6Prefix | ( | Ipv6Prefix const & | prefix | ) |
Copy constructor.
| prefix | Ipv6Prefix object |
Definition at line 1037 of file ipv6-address.cc.
References m_prefix, and m_prefixLength.
| ns3::Ipv6Prefix::Ipv6Prefix | ( | Ipv6Prefix const * | prefix | ) |
Copy constructor.
| prefix | Ipv6Prefix pointer |
Definition at line 1043 of file ipv6-address.cc.
References m_prefix, and m_prefixLength.
| ns3::Ipv6Prefix::~Ipv6Prefix | ( | ) |
| Ipv6Address ns3::Ipv6Prefix::ConvertToIpv6Address | ( | ) | const |
Convert the Prefix into an IPv6 Address.
Definition at line 1110 of file ipv6-address.cc.
References m_prefix.
| void ns3::Ipv6Prefix::GetBytes | ( | uint8_t | buf[16] | ) | const |
Get the bytes corresponding to the prefix.
| buf | buffer to store the data |
Definition at line 1104 of file ipv6-address.cc.
References m_prefix, and NS_LOG_FUNCTION.
Referenced by ns3::SixLowPanNetDevice::FindMulticastCompressionContext(), ns3::Ipv6AddressGeneratorImpl::Init(), and ns3::Ipv6AddressGeneratorImpl::PrefixToIndex().
Here is the caller graph for this function:
|
static |
Get the loopback prefix ( /128).
Definition at line 1083 of file ipv6-address.cc.
References NS_LOG_FUNCTION_NOARGS.
| uint8_t ns3::Ipv6Prefix::GetMinimumPrefixLength | ( | ) | const |
Get the minimum prefix length, i.e., 128 - the length of the largest sequence trailing zeroes.
Definition at line 1131 of file ipv6-address.cc.
References m_prefix, and NS_LOG_FUNCTION.
Referenced by Ipv6Prefix().
Here is the caller graph for this function:
|
static |
Get the "all-1" IPv6 mask (ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff).
Definition at line 1090 of file ipv6-address.cc.
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::Ipv6StaticRouting::AddHostRouteTo(), ns3::Ipv6RoutingTableEntry::CreateHostRouteTo(), and ns3::Ipv6RoutingTableEntry::IsHost().
Here is the caller graph for this function:| uint8_t ns3::Ipv6Prefix::GetPrefixLength | ( | void | ) | const |
Get prefix length.
Definition at line 1119 of file ipv6-address.cc.
References m_prefixLength, and NS_LOG_FUNCTION.
Referenced by ns3::SixLowPanNetDevice::CleanPrefix(), ns3::SixLowPanNetDevice::FindMulticastCompressionContext(), ns3::Ipv6StaticRouting::GetDefaultRoute(), ns3::RipNg::Lookup(), ns3::Ipv6StaticRouting::LookupStatic(), ns3::Ipv6AddressHelper::NewNetwork(), ns3::operator<<(), Print(), ns3::RipNg::PrintRoutingTable(), and ns3::Ipv6StaticRouting::PrintRoutingTable().
Here is the caller graph for this function:
|
static |
Get the zero prefix ( /0).
Definition at line 1097 of file ipv6-address.cc.
References NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::RipNg::AddDefaultRouteTo(), ns3::RipNg::DoSendRouteUpdate(), ns3::RipNg::HandleRequests(), and ns3::Ipv6StaticRouting::SetDefaultRoute().
Here is the caller graph for this function:| bool ns3::Ipv6Prefix::IsEqual | ( | const Ipv6Prefix & | other | ) | const |
Comparison operation between two Ipv6Prefix.
| other | the IPv6 prefix to which to compare this prefix |
Definition at line 1159 of file ipv6-address.cc.
References m_prefix.
| bool ns3::Ipv6Prefix::IsMatch | ( | Ipv6Address | a, |
| Ipv6Address | b | ||
| ) | const |
If the Address match the type.
| a | a first address |
| b | a second address |
Definition at line 1055 of file ipv6-address.cc.
References ns3::Ipv6Address::GetBytes(), m_prefix, and NS_LOG_FUNCTION.
Referenced by ns3::Ipv6Interface::GetAddressMatchingDestination(), ns3::Ipv6StaticRouting::HasNetworkDest(), ns3::RipNg::Lookup(), and ns3::Ipv6StaticRouting::LookupStatic().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::Ipv6Prefix::Print | ( | std::ostream & | os | ) | const |
Print this address to the given output stream.
The print format is in the typical "2001:660:4701::1".
| os | the output stream to which this Ipv6Address is printed |
Definition at line 1076 of file ipv6-address.cc.
References GetPrefixLength(), and NS_LOG_FUNCTION.
Referenced by ns3::operator<<().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::Ipv6Prefix::SetPrefixLength | ( | uint8_t | prefixLength | ) |
Set prefix length.
| prefixLength | the prefix length |
Definition at line 1125 of file ipv6-address.cc.
References m_prefixLength, and NS_LOG_FUNCTION.
|
friend |
Not equal to operator.
| a | the first operand |
| b | the first operand |
Definition at line 696 of file ipv6-address.h.
|
friend |
Equal to operator.
| a | the first operand |
| b | the first operand |
Definition at line 691 of file ipv6-address.h.
|
private |
The prefix representation.
Definition at line 611 of file ipv6-address.h.
Referenced by ConvertToIpv6Address(), GetBytes(), GetMinimumPrefixLength(), Ipv6Prefix(), IsEqual(), IsMatch(), ns3::operator!=(), and ns3::operator==().
|
private |
The prefix length.
Definition at line 616 of file ipv6-address.h.
Referenced by GetPrefixLength(), Ipv6Prefix(), and SetPrefixLength().