mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 21:45:37 +00:00
[2898] pair<a,b> replaced with make_pair
This commit is contained in:
@@ -1699,7 +1699,7 @@ TEST_F(Dhcpv6SrvTest, selectSubnetRelayInterfaceId) {
|
|||||||
relay.linkaddr_ = IOAddress("2001:db8:2::1234");
|
relay.linkaddr_ = IOAddress("2001:db8:2::1234");
|
||||||
relay.peeraddr_ = IOAddress("fe80::1");
|
relay.peeraddr_ = IOAddress("fe80::1");
|
||||||
OptionPtr opt = generateInterfaceId("relay2");
|
OptionPtr opt = generateInterfaceId("relay2");
|
||||||
relay.options_.insert(pair<int, OptionPtr>(opt->getType(), opt));
|
relay.options_.insert(make_pair(opt->getType(), opt));
|
||||||
pkt->relay_info_.push_back(relay);
|
pkt->relay_info_.push_back(relay);
|
||||||
|
|
||||||
// There is only one subnet configured and we are outside of that subnet
|
// There is only one subnet configured and we are outside of that subnet
|
||||||
|
@@ -265,11 +265,11 @@ TEST_F(LibDhcpTest, packOptions6) {
|
|||||||
OptionPtr opt4(new Option(Option::V6, 6, buf.begin() + 8, buf.begin() + 12));
|
OptionPtr opt4(new Option(Option::V6, 6, buf.begin() + 8, buf.begin() + 12));
|
||||||
OptionPtr opt5(new Option(Option::V6, 8, buf.begin() + 12, buf.begin() + 14));
|
OptionPtr opt5(new Option(Option::V6, 8, buf.begin() + 12, buf.begin() + 14));
|
||||||
|
|
||||||
opts.insert(pair<int, OptionPtr >(opt1->getType(), opt1));
|
opts.insert(make_pair(opt1->getType(), opt1));
|
||||||
opts.insert(pair<int, OptionPtr >(opt1->getType(), opt2));
|
opts.insert(make_pair(opt1->getType(), opt2));
|
||||||
opts.insert(pair<int, OptionPtr >(opt1->getType(), opt3));
|
opts.insert(make_pair(opt1->getType(), opt3));
|
||||||
opts.insert(pair<int, OptionPtr >(opt1->getType(), opt4));
|
opts.insert(make_pair(opt1->getType(), opt4));
|
||||||
opts.insert(pair<int, OptionPtr >(opt1->getType(), opt5));
|
opts.insert(make_pair(opt1->getType(), opt5));
|
||||||
|
|
||||||
OutputBuffer assembled(512);
|
OutputBuffer assembled(512);
|
||||||
|
|
||||||
|
@@ -507,7 +507,7 @@ TEST_F(Pkt6Test, relayPack) {
|
|||||||
|
|
||||||
OptionPtr optRelay1(new Option(Option::V6, 200, relay_data));
|
OptionPtr optRelay1(new Option(Option::V6, 200, relay_data));
|
||||||
|
|
||||||
relay1.options_.insert(pair<int, boost::shared_ptr<Option> >(optRelay1->getType(), optRelay1));
|
relay1.options_.insert(make_pair(optRelay1->getType(), optRelay1));
|
||||||
|
|
||||||
OptionPtr opt1(new Option(Option::V6, 100));
|
OptionPtr opt1(new Option(Option::V6, 100));
|
||||||
OptionPtr opt2(new Option(Option::V6, 101));
|
OptionPtr opt2(new Option(Option::V6, 101));
|
||||||
@@ -581,9 +581,9 @@ TEST_F(Pkt6Test, getAnyRelayOption) {
|
|||||||
OptionPtr relay1_opt2(generateRandomOption(201));
|
OptionPtr relay1_opt2(generateRandomOption(201));
|
||||||
OptionPtr relay1_opt3(generateRandomOption(202));
|
OptionPtr relay1_opt3(generateRandomOption(202));
|
||||||
|
|
||||||
relay1.options_.insert(pair<int, boost::shared_ptr<Option> >(200, relay1_opt1));
|
relay1.options_.insert(make_pair(200, relay1_opt1));
|
||||||
relay1.options_.insert(pair<int, boost::shared_ptr<Option> >(201, relay1_opt2));
|
relay1.options_.insert(make_pair(201, relay1_opt2));
|
||||||
relay1.options_.insert(pair<int, boost::shared_ptr<Option> >(202, relay1_opt3));
|
relay1.options_.insert(make_pair(202, relay1_opt3));
|
||||||
msg->addRelayInfo(relay1);
|
msg->addRelayInfo(relay1);
|
||||||
|
|
||||||
// generate options for relay2
|
// generate options for relay2
|
||||||
@@ -592,16 +592,16 @@ TEST_F(Pkt6Test, getAnyRelayOption) {
|
|||||||
OptionPtr relay2_opt2(new Option(Option::V6, 101));
|
OptionPtr relay2_opt2(new Option(Option::V6, 101));
|
||||||
OptionPtr relay2_opt3(new Option(Option::V6, 102));
|
OptionPtr relay2_opt3(new Option(Option::V6, 102));
|
||||||
OptionPtr relay2_opt4(new Option(Option::V6, 200)); // the same code as relay1_opt3
|
OptionPtr relay2_opt4(new Option(Option::V6, 200)); // the same code as relay1_opt3
|
||||||
relay2.options_.insert(pair<int, boost::shared_ptr<Option> >(100, relay2_opt1));
|
relay2.options_.insert(make_pair(100, relay2_opt1));
|
||||||
relay2.options_.insert(pair<int, boost::shared_ptr<Option> >(101, relay2_opt2));
|
relay2.options_.insert(make_pair(101, relay2_opt2));
|
||||||
relay2.options_.insert(pair<int, boost::shared_ptr<Option> >(102, relay2_opt3));
|
relay2.options_.insert(make_pair(102, relay2_opt3));
|
||||||
relay2.options_.insert(pair<int, boost::shared_ptr<Option> >(200, relay2_opt4));
|
relay2.options_.insert(make_pair(200, relay2_opt4));
|
||||||
msg->addRelayInfo(relay2);
|
msg->addRelayInfo(relay2);
|
||||||
|
|
||||||
// generate options for relay3
|
// generate options for relay3
|
||||||
Pkt6::RelayInfo relay3;
|
Pkt6::RelayInfo relay3;
|
||||||
OptionPtr relay3_opt1(generateRandomOption(200, 7));
|
OptionPtr relay3_opt1(generateRandomOption(200, 7));
|
||||||
relay3.options_.insert(pair<int, boost::shared_ptr<Option> >(200, relay3_opt1));
|
relay3.options_.insert(make_pair(200, relay3_opt1));
|
||||||
msg->addRelayInfo(relay3);
|
msg->addRelayInfo(relay3);
|
||||||
|
|
||||||
// Ok, so we now have a packet that traversed the following network:
|
// Ok, so we now have a packet that traversed the following network:
|
||||||
|
@@ -40,8 +40,7 @@ CfgMgr::addOptionSpace4(const OptionSpacePtr& space) {
|
|||||||
isc_throw(InvalidOptionSpace, "option space " << space->getName()
|
isc_throw(InvalidOptionSpace, "option space " << space->getName()
|
||||||
<< " already added.");
|
<< " already added.");
|
||||||
}
|
}
|
||||||
spaces4_.insert(std::pair<std::string,
|
spaces4_.insert(make_pair(space->getName(), space));
|
||||||
OptionSpacePtr>(space->getName(), space));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -55,8 +54,7 @@ CfgMgr::addOptionSpace6(const OptionSpacePtr& space) {
|
|||||||
isc_throw(InvalidOptionSpace, "option space " << space->getName()
|
isc_throw(InvalidOptionSpace, "option space " << space->getName()
|
||||||
<< " already added.");
|
<< " already added.");
|
||||||
}
|
}
|
||||||
spaces6_.insert(std::pair<std::string,
|
spaces6_.insert(make_pair(space->getName(), space));
|
||||||
OptionSpacePtr>(space->getName(), space));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user