拓扑助手Ipv4AddressHelper
允许设置基地址,如示例所示。
Ipv4AddressHelper address;
address.SetBase ("10.1.1.0", "255.255.255.0");
例如,我想存储任意数量的动态创建的地址。
...
for( uint32_t subnetC = 0; subnetC < nSubnets; subnetC++ )
{
string ip = "10.1." + lexical_cast< string >( subnetC + 1 ) +".0";
ipList.push_back( ip );
}
...
vIpv4AddressHelper[ someIndex ].SetBase(ipList[ someIndex ], "255.255.255.0" );
...
但是,我得到了错误
error: no matching function for call to ‘ns3::Ipv4AddressHelper::SetBase(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const char [14])’
note: candidates are: void ns3::Ipv4AddressHelper::SetBase(ns3::Ipv4Address, ns3::Ipv4Mask, ns3::Ipv4Address)
如何将字符串传递给SetBase
?