}
void
-Dhcpv6Srv::copyDefaultOptions(const Pkt6Ptr& question, Pkt6Ptr& answer) {
+Dhcpv6Srv::copyClientOptions(const Pkt6Ptr& question, Pkt6Ptr& answer) {
// Add client-id.
OptionPtr clientid = question->getOption(D6O_CLIENTID);
if (clientid) {
Pkt6Ptr advertise(new Pkt6(DHCPV6_ADVERTISE, solicit->getTransid()));
- copyDefaultOptions(solicit, advertise);
+ copyClientOptions(solicit, advertise);
appendDefaultOptions(solicit, advertise);
appendRequestedOptions(solicit, advertise);
appendRequestedVendorOptions(solicit, advertise);
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, request->getTransid()));
- copyDefaultOptions(request, reply);
+ copyClientOptions(request, reply);
appendDefaultOptions(request, reply);
appendRequestedOptions(request, reply);
appendRequestedVendorOptions(request, reply);
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, renew->getTransid()));
- copyDefaultOptions(renew, reply);
+ copyClientOptions(renew, reply);
appendDefaultOptions(renew, reply);
appendRequestedOptions(renew, reply);
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, rebind->getTransid()));
- copyDefaultOptions(rebind, reply);
+ copyClientOptions(rebind, reply);
appendDefaultOptions(rebind, reply);
appendRequestedOptions(rebind, reply);
// The server sends Reply message in response to Confirm.
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, confirm->getTransid()));
// Make sure that the necessary options are included.
- copyDefaultOptions(confirm, reply);
+ copyClientOptions(confirm, reply);
appendDefaultOptions(confirm, reply);
// Indicates if at least one address has been verified. If no addresses
// are verified it means that the client has sent no IA_NA options
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, release->getTransid()));
- copyDefaultOptions(release, reply);
+ copyClientOptions(release, reply);
appendDefaultOptions(release, reply);
releaseLeases(release, reply);
// Create a Reply packet, with the same trans-id as the client's.
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, infRequest->getTransid()));
- // Copy default options (client-id, also relay information if present)
- copyDefaultOptions(infRequest, reply);
+ // Copy client options (client-id, also relay information if present)
+ copyClientOptions(infRequest, reply);
- // Append default options (server-id for now, but possibly other options
- // once we start supporting authentication)
+ // Append default options, i.e. options that the server is supposed
+ // to put in all messages it sends (server-id for now, but possibly other
+ // options once we start supporting authentication)
appendDefaultOptions(infRequest, reply);
// Try to assign options that were requested by the client.
/// Copies options that must appear in any server response (ADVERTISE, REPLY)
/// to client's messages (SOLICIT, REQUEST, RENEW, REBIND, DECLINE, RELEASE).
/// One notable example is client-id. Other options may be copied as required.
+ /// Relay information details are also copied here.
///
/// @param question client's message (options will be copied from here)
/// @param answer server's message (options will be copied here)
- void copyDefaultOptions(const Pkt6Ptr& question, Pkt6Ptr& answer);
+ void copyClientOptions(const Pkt6Ptr& question, Pkt6Ptr& answer);
/// @brief Appends default options to server's answer.
///