try {
switch (query->getType()) {
case DHCPV6_SOLICIT:
- rsp = processSolicit(query, ctx);
+ rsp = processSolicit(ctx);
break;
case DHCPV6_REQUEST:
- rsp = processRequest(query, ctx);
+ rsp = processRequest(ctx);
break;
case DHCPV6_RENEW:
- rsp = processRenew(query, ctx);
+ rsp = processRenew(ctx);
break;
case DHCPV6_REBIND:
- rsp = processRebind(query, ctx);
+ rsp = processRebind(ctx);
break;
case DHCPV6_CONFIRM:
- rsp = processConfirm(query, ctx);
+ rsp = processConfirm(ctx);
break;
case DHCPV6_RELEASE:
- rsp = processRelease(query, ctx);
+ rsp = processRelease(ctx);
break;
case DHCPV6_DECLINE:
- rsp = processDecline(query, ctx);
+ rsp = processDecline(ctx);
break;
case DHCPV6_INFORMATION_REQUEST:
- rsp = processInfRequest(query, ctx);
+ rsp = processInfRequest(ctx);
break;
default:
Pkt6Ptr
-Dhcpv6Srv::processSolicit(const Pkt6Ptr& solicit,
- AllocEngine::ClientContext6& ctx) {
+Dhcpv6Srv::processSolicit(AllocEngine::ClientContext6& ctx) {
+ Pkt6Ptr solicit = ctx.query_;
Pkt6Ptr response(new Pkt6(DHCPV6_ADVERTISE, solicit->getTransid()));
// Handle Rapid Commit option, if present.
}
Pkt6Ptr
-Dhcpv6Srv::processRequest(const Pkt6Ptr& request,
- AllocEngine::ClientContext6& ctx) {
+Dhcpv6Srv::processRequest(AllocEngine::ClientContext6& ctx) {
+ Pkt6Ptr request = ctx.query_;
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, request->getTransid()));
processClientFqdn(request, reply, ctx);
}
Pkt6Ptr
-Dhcpv6Srv::processRenew(const Pkt6Ptr& renew,
- AllocEngine::ClientContext6& ctx) {
+Dhcpv6Srv::processRenew(AllocEngine::ClientContext6& ctx) {
+ Pkt6Ptr renew = ctx.query_;
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, renew->getTransid()));
processClientFqdn(renew, reply, ctx);
}
Pkt6Ptr
-Dhcpv6Srv::processRebind(const Pkt6Ptr& rebind,
- AllocEngine::ClientContext6& ctx) {
+Dhcpv6Srv::processRebind(AllocEngine::ClientContext6& ctx) {
+ Pkt6Ptr rebind = ctx.query_;
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, rebind->getTransid()));
processClientFqdn(rebind, reply, ctx);
}
Pkt6Ptr
-Dhcpv6Srv::processConfirm(const Pkt6Ptr& confirm,
- AllocEngine::ClientContext6& ctx) {
+Dhcpv6Srv::processConfirm(AllocEngine::ClientContext6& ctx) {
+ Pkt6Ptr confirm = ctx.query_;
setReservedClientClasses(confirm, ctx);
requiredClassify(confirm, ctx);
}
Pkt6Ptr
-Dhcpv6Srv::processRelease(const Pkt6Ptr& release,
- AllocEngine::ClientContext6& ctx) {
+Dhcpv6Srv::processRelease(AllocEngine::ClientContext6& ctx) {
+ Pkt6Ptr release = ctx.query_;
setReservedClientClasses(release, ctx);
requiredClassify(release, ctx);
}
Pkt6Ptr
-Dhcpv6Srv::processDecline(const Pkt6Ptr& decline,
- AllocEngine::ClientContext6& ctx) {
+Dhcpv6Srv::processDecline(AllocEngine::ClientContext6& ctx) {
+ Pkt6Ptr decline = ctx.query_;
setReservedClientClasses(decline, ctx);
requiredClassify(decline, ctx);
}
Pkt6Ptr
-Dhcpv6Srv::processInfRequest(const Pkt6Ptr& inf_request,
- AllocEngine::ClientContext6& ctx) {
+Dhcpv6Srv::processInfRequest(AllocEngine::ClientContext6& ctx) {
+ Pkt6Ptr inf_request = ctx.query_;
setReservedClientClasses(inf_request, ctx);
requiredClassify(inf_request, ctx);
/// instead of Advertise and requested leases will be assigned
/// immediately.
///
- /// @param solicit Solicit message received from client
/// @param ctx Reference to client context
///
/// @return Advertise, Reply message or NULL.
- Pkt6Ptr processSolicit(const Pkt6Ptr& solicit,
- AllocEngine::ClientContext6& ctx);
+ Pkt6Ptr processSolicit(AllocEngine::ClientContext6& ctx);
/// @brief Processes incoming Request and returns Reply response.
///
/// prefixes, respectively. Uses LeaseMgr to allocate or update existing
/// leases.
///
- /// @param request a message received from client
/// @param ctx Reference to client context
///
/// @return REPLY message or NULL
- Pkt6Ptr processRequest(const Pkt6Ptr& request,
- AllocEngine::ClientContext6& ctx);
+ Pkt6Ptr processRequest(AllocEngine::ClientContext6& ctx);
/// @brief Processes incoming Renew message.
///
- /// @param renew message received from the client
/// @param ctx Reference to client context
///
/// @return Reply message to be sent to the client.
- Pkt6Ptr processRenew(const Pkt6Ptr& renew,
- AllocEngine::ClientContext6& ctx);
+ Pkt6Ptr processRenew(AllocEngine::ClientContext6& ctx);
/// @brief Processes incoming Rebind message.
///
/// client is on the appropriate link or not. We don't seem to do it
/// now.
///
- /// @param rebind message received from the client.
/// @param ctx Reference to client context
///
/// @return Reply message to be sent to the client.
- Pkt6Ptr processRebind(const Pkt6Ptr& rebind,
- AllocEngine::ClientContext6& ctx);
+ Pkt6Ptr processRebind(AllocEngine::ClientContext6& ctx);
/// @brief Processes incoming Confirm message and returns Reply.
///
/// code NotOnLink is returned. Otherwise, the Reply message with the
/// status code Success is returned.
///
- /// @param confirm Confirm message sent by a client.
/// @param ctx Reference to client context
///
/// @return Reply message from the server or NULL pointer if Confirm
/// message should be discarded by the server.
- Pkt6Ptr processConfirm(const Pkt6Ptr& confirm,
- AllocEngine::ClientContext6& ctx);
+ Pkt6Ptr processConfirm(AllocEngine::ClientContext6& ctx);
/// @brief Process incoming Release message.
///
- /// @param release message received from client
/// @param ctx Reference to client context
///
/// @return Reply message to be sent to the client.
- Pkt6Ptr processRelease(const Pkt6Ptr& release,
- AllocEngine::ClientContext6& ctx);
+ Pkt6Ptr processRelease(AllocEngine::ClientContext6& ctx);
/// @brief Process incoming Decline message.
///
/// the client's message. Finally, it calls @ref declineLeases, where
/// the actual address processing takes place.
///
- /// @param decline message received from client
/// @param ctx Reference to client context
///
/// @return Reply message to be sent to the client.
- Pkt6Ptr processDecline(const Pkt6Ptr& decline,
- AllocEngine::ClientContext6& ctx);
+ Pkt6Ptr processDecline(AllocEngine::ClientContext6& ctx);
/// @brief Processes incoming Information-request message.
///
- /// @param inf_request message received from client
/// @param ctx Reference to client context
///
/// @return Reply message to be sent to the client.
- Pkt6Ptr processInfRequest(const Pkt6Ptr& inf_request,
- AllocEngine::ClientContext6& ctx);
+ Pkt6Ptr processInfRequest(AllocEngine::ClientContext6& ctx);
/// @brief Processes incoming DHCPv4-query message.
///
bool drop = false;
srv.initContext(query1, ctx1, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response1 = srv.processSolicit(query1, ctx1);
+ Pkt6Ptr response1 = srv.processSolicit(ctx1);
AllocEngine::ClientContext6 ctx2;
srv.initContext(query2, ctx2, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response2 = srv.processSolicit(query2, ctx2);
+ Pkt6Ptr response2 = srv.processSolicit(ctx2);
AllocEngine::ClientContext6 ctx3;
srv.initContext(query3, ctx3, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response3 = srv.processSolicit(query3, ctx3);
+ Pkt6Ptr response3 = srv.processSolicit(ctx3);
// Classification processing should add an ip-forwarding option
OptionPtr opt1 = response1->getOption(2345);
bool drop = false;
srv.initContext(query1, ctx1, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response1 = srv.processSolicit(query1, ctx1);
+ Pkt6Ptr response1 = srv.processSolicit(ctx1);
AllocEngine::ClientContext6 ctx2;
srv.initContext(query2, ctx2, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response2 = srv.processSolicit(query2, ctx2);
+ Pkt6Ptr response2 = srv.processSolicit(ctx2);
AllocEngine::ClientContext6 ctx3;
srv.initContext(query3, ctx3, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response3 = srv.processSolicit(query3, ctx3);
+ Pkt6Ptr response3 = srv.processSolicit(ctx3);
// Classification processing should do nothing
OptionPtr opt1 = response1->getOption(2345);
bool drop = false;
srv.initContext(query1, ctx1, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response1 = srv.processSolicit(query1, ctx1);
+ Pkt6Ptr response1 = srv.processSolicit(ctx1);
AllocEngine::ClientContext6 ctx2;
srv.initContext(query2, ctx2, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response2 = srv.processSolicit(query2, ctx2);
+ Pkt6Ptr response2 = srv.processSolicit(ctx2);
AllocEngine::ClientContext6 ctx3;
srv.initContext(query3, ctx3, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response3 = srv.processSolicit(query3, ctx3);
+ Pkt6Ptr response3 = srv.processSolicit(ctx3);
// Classification processing should add an ip-forwarding option
OptionPtr opt1 = response1->getOption(2345);
bool drop = false;
srv.initContext(query, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response = srv.processSolicit(query, ctx);
+ Pkt6Ptr response = srv.processSolicit(ctx);
// Processing should add an ip-forwarding option
OptionPtr opt = response->getOption(2345);
bool drop = false;
srv.initContext(query, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response = srv.processSolicit(query, ctx);
+ Pkt6Ptr response = srv.processSolicit(ctx);
// Processing should add an ip-forwarding option
OptionPtr opt = response->getOption(2345);
bool drop = false;
srv.initContext(query, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response = srv.processSolicit(query, ctx);
+ Pkt6Ptr response = srv.processSolicit(ctx);
// Processing should add an ip-forwarding option
OptionPtr opt = response->getOption(2345);
bool drop = false;
srv.initContext(query, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response = srv.processSolicit(query, ctx);
+ Pkt6Ptr response = srv.processSolicit(ctx);
// Processing should add an ip-forwarding option
OptionPtr opt = response->getOption(2345);
bool drop = false;
srv.initContext(query1, ctx1, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response1 = srv.processSolicit(query1, ctx1);
+ Pkt6Ptr response1 = srv.processSolicit(ctx1);
ASSERT_TRUE(response1);
OptionPtr ia_na1 = response1->getOption(D6O_IA_NA);
ASSERT_TRUE(ia_na1);
AllocEngine::ClientContext6 ctx2;
srv.initContext(query2, ctx2, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response2 = srv.processSolicit(query2, ctx2);
+ Pkt6Ptr response2 = srv.processSolicit(ctx2);
ASSERT_TRUE(response2);
OptionPtr ia_na2 = response2->getOption(D6O_IA_NA);
ASSERT_TRUE(ia_na2);
AllocEngine::ClientContext6 ctx3;
srv.initContext(query3, ctx3, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response3 = srv.processSolicit(query3, ctx3);
+ Pkt6Ptr response3 = srv.processSolicit(ctx3);
ASSERT_TRUE(response3);
OptionPtr ia_na3 = response3->getOption(D6O_IA_NA);
ASSERT_TRUE(ia_na3);
bool drop = false;
srv.initContext(query1, ctx1, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response1 = srv.processSolicit(query1, ctx1);
+ Pkt6Ptr response1 = srv.processSolicit(ctx1);
AllocEngine::ClientContext6 ctx2;
srv.initContext(query2, ctx2, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response2 = srv.processSolicit(query2, ctx2);
+ Pkt6Ptr response2 = srv.processSolicit(ctx2);
AllocEngine::ClientContext6 ctx3;
srv.initContext(query3, ctx3, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response3 = srv.processSolicit(query3, ctx3);
+ Pkt6Ptr response3 = srv.processSolicit(ctx3);
// Classification processing should add an ip-forwarding option
OptionPtr opt1 = response1->getOption(2345);
bool drop = false;
srv.initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr reply = srv.processSolicit(sol, ctx);
+ Pkt6Ptr reply = srv.processSolicit(ctx);
// check that we get the right NAK
checkNakResponse(reply, DHCPV6_ADVERTISE, 1234, STATUS_NoAddrsAvail,
bool drop = false;
srv_.initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr adv = srv_.processSolicit(sol, ctx);
+ Pkt6Ptr adv = srv_.processSolicit(ctx);
// check if we get response at all
ASSERT_TRUE(adv);
AllocEngine::ClientContext6 ctx2;
srv_.initContext(sol, ctx2, drop);
ASSERT_FALSE(drop);
- adv = srv_.processSolicit(sol, ctx2);
+ adv = srv_.processSolicit(ctx2);
ASSERT_TRUE(adv);
OptionPtr tmp = adv->getOption(D6O_NAME_SERVERS);
bool drop = false;
srv.initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr reply = srv.processSolicit(sol, ctx);
+ Pkt6Ptr reply = srv.processSolicit(ctx);
// check if we get response at all
checkResponse(reply, DHCPV6_ADVERTISE, 1234);
bool drop = false;
srv.initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr reply = srv.processSolicit(sol, ctx);
+ Pkt6Ptr reply = srv.processSolicit(ctx);
// check if we get response at all
checkResponse(reply, DHCPV6_ADVERTISE, 1234);
bool drop = false;
srv.initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr reply = srv.processSolicit(sol, ctx);
+ Pkt6Ptr reply = srv.processSolicit(ctx);
// check if we get response at all
checkResponse(reply, DHCPV6_ADVERTISE, 1234);
bool drop = false;
srv.initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr reply = srv.processSolicit(sol, ctx);
+ Pkt6Ptr reply = srv.processSolicit(ctx);
// check if we get response at all
checkResponse(reply, DHCPV6_ADVERTISE, 1234);
bool drop = false;
srv.initContext(sol1, ctx1, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr reply1 = srv.processSolicit(sol1, ctx1);
+ Pkt6Ptr reply1 = srv.processSolicit(ctx1);
AllocEngine::ClientContext6 ctx2;
srv.initContext(sol2, ctx2, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr reply2 = srv.processSolicit(sol2, ctx2);
+ Pkt6Ptr reply2 = srv.processSolicit(ctx2);
AllocEngine::ClientContext6 ctx3;
srv.initContext(sol3, ctx3, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr reply3 = srv.processSolicit(sol3, ctx3);
+ Pkt6Ptr reply3 = srv.processSolicit(ctx3);
// check if we get response at all
checkResponse(reply1, DHCPV6_ADVERTISE, 1234);
bool drop = false;
srv_.initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr response = srv_.processSolicit(sol, ctx);
+ Pkt6Ptr response = srv_.processSolicit(ctx);
// The server should add a subscriber-id option
ASSERT_TRUE(response->getOption(D6O_SUBSCRIBER_ID));
AllocEngine::ClientContext6 ctx2;
srv_.initContext(sol, ctx2, drop);
ASSERT_FALSE(drop);
- response = srv_.processSolicit(sol, ctx2);
+ response = srv_.processSolicit(ctx2);
// Processing should add a subscriber-id option
ASSERT_TRUE(response->getOption(D6O_SUBSCRIBER_ID));
bool drop = false;
srv_.initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr adv = srv_.processSolicit(sol, ctx);
+ Pkt6Ptr adv = srv_.processSolicit(ctx);
// check if we get response at all
ASSERT_TRUE(adv);
AllocEngine::ClientContext6 ctx2;
srv_.initContext(sol, ctx2, drop);
ASSERT_FALSE(drop);
- adv = srv_.processSolicit(sol, ctx2);
+ adv = srv_.processSolicit(ctx2);
ASSERT_TRUE(adv);
// Check if there is vendor option response
bool drop = false;
srv_.initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr adv = srv_.processSolicit(sol, ctx);
+ Pkt6Ptr adv = srv_.processSolicit(ctx);
// check if we get response at all
ASSERT_TRUE(adv);
if (drop) {
return (Pkt6Ptr());
}
- return (processRequest(request, ctx));
+ return (processRequest(ctx));
}
/// @brief Processes incoming Renew message.
if (drop) {
return (Pkt6Ptr());
}
- return (processRenew(renew, ctx));
+ return (processRenew(ctx));
}
/// @brief Processes incoming Rebind message.
if (drop) {
return (Pkt6Ptr());
}
- return (processRebind(rebind, ctx));
+ return (processRebind(ctx));
}
/// @brief Processes incoming Release message.
if (drop) {
return (Pkt6Ptr());
}
- return (processRelease(release, ctx));
+ return (processRelease(ctx));
}
/// @brief Processes incoming Decline message.
if (drop) {
return (Pkt6Ptr());
}
- return (processDecline(decline, ctx));
+ return (processDecline(ctx));
}
using Dhcpv6Srv::processSolicit;
srv_->initContext(req, ctx, drop);
ASSERT_FALSE(drop);
if (msg_type == DHCPV6_SOLICIT) {
- ASSERT_NO_THROW(reply = srv_->processSolicit(req, ctx));
+ ASSERT_NO_THROW(reply = srv_->processSolicit(ctx));
} else if (msg_type == DHCPV6_REQUEST) {
- ASSERT_NO_THROW(reply = srv_->processRequest(req, ctx));
+ ASSERT_NO_THROW(reply = srv_->processRequest(ctx));
} else if (msg_type == DHCPV6_RENEW) {
- ASSERT_NO_THROW(reply = srv_->processRenew(req, ctx));
+ ASSERT_NO_THROW(reply = srv_->processRenew(ctx));
} else if (msg_type == DHCPV6_RELEASE) {
// For Release no lease will be acquired so we have to leave
// function here.
- ASSERT_NO_THROW(reply = srv_->processRelease(req, ctx));
+ ASSERT_NO_THROW(reply = srv_->processRelease(ctx));
return;
} else {
// We are not interested in testing other message types.
bool drop = false;
srv_->initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr adv = srv_->processSolicit(sol, ctx);
+ Pkt6Ptr adv = srv_->processSolicit(ctx);
// Check if we get response at all
ASSERT_TRUE(adv);
bool drop = false;
srv_->initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr adv = srv_->processSolicit(sol, ctx);
+ Pkt6Ptr adv = srv_->processSolicit(ctx);
// Check if we get response at all
ASSERT_TRUE(adv);
bool drop = false;
srv_->initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr adv = srv_->processSolicit(sol, ctx);
+ Pkt6Ptr adv = srv_->processSolicit(ctx);
// Check if we get response at all
ASSERT_TRUE(adv);
bool drop = false;
srv_->initContext(sol, ctx, drop);
ASSERT_FALSE(drop);
- Pkt6Ptr adv = srv_->processSolicit(sol, ctx);
+ Pkt6Ptr adv = srv_->processSolicit(ctx);
// Check if we get response at all
ASSERT_TRUE(adv);