}
}
+ processDhcp4Query(query, rsp, allow_packet_park);
+}
+
+void
+Dhcpv4Srv::processDhcp4QueryAndSendResponse(Pkt4Ptr& query, Pkt4Ptr& rsp,
+ bool allow_packet_park) {
+ try {
+ processDhcp4Query(query, rsp, allow_packet_park);
+ if (!rsp) {
+ return;
+ }
+
+ CalloutHandlePtr callout_handle = getCalloutHandle(query);
+ processPacketBufferSend(callout_handle, rsp);
+ } catch (const std::exception& e) {
+ LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_STD_EXCEPTION)
+ .arg(e.what());
+ } catch (...) {
+ LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_EXCEPTION);
+ }
+}
+
+void
+Dhcpv4Srv::processDhcp4Query(Pkt4Ptr& query, Pkt4Ptr& rsp,
+ bool allow_packet_park) {
AllocEngine::ClientContext4Ptr ctx;
try {
/// @brief Process a single incoming DHCPv4 packet and sends the response.
///
- /// It verifies correctness of the passed packet, call per-type processXXX
+ /// It verifies correctness of the passed packet, calls per-type processXXX
/// methods, generates appropriate answer, sends the answer to the client.
///
/// @param query A pointer to the packet to be processed.
/// @brief Process a single incoming DHCPv4 packet and sends the response.
///
- /// It verifies correctness of the passed packet, call per-type processXXX
+ /// It verifies correctness of the passed packet, calls per-type processXXX
/// methods, generates appropriate answer, sends the answer to the client.
///
/// @param query A pointer to the packet to be processed.
///
/// @param callout_handle pointer to the callout handle.
/// @param query A pointer to the packet to be processed.
- /// @param rsp A pointer to the response
+ /// @param rsp A pointer to the response.
void sendResponseNoThrow(hooks::CalloutHandlePtr& callout_handle,
Pkt4Ptr& query, Pkt4Ptr& rsp);
/// @brief Process a single incoming DHCPv4 packet.
///
- /// It verifies correctness of the passed packet, call per-type processXXX
+ /// It verifies correctness of the passed packet, calls per-type processXXX
/// methods, generates appropriate answer.
///
/// @param query A pointer to the packet to be processed.
- /// @param rsp A pointer to the response
+ /// @param rsp A pointer to the response.
/// @param allow_packet_park Indicates if parking a packet is allowed.
void processPacket(Pkt4Ptr& query, Pkt4Ptr& rsp,
bool allow_packet_park = true);
+ /// @brief Process a single incoming DHCPv4 query.
+ ///
+ /// It calls per-type processXXX methods, generates appropriate answer.
+ ///
+ /// @param query A pointer to the packet to be processed.
+ /// @param rsp A pointer to the response.
+ /// @param allow_packet_park Indicates if parking a packet is allowed.
+ void processDhcp4Query(Pkt4Ptr& query, Pkt4Ptr& rsp,
+ bool allow_packet_park);
+
+ /// @brief Process a single incoming DHCPv4 query.
+ ///
+ /// It calls per-type processXXX methods, generates appropriate answer,
+ /// sends the answer to the client.
+ ///
+ /// @param query A pointer to the packet to be processed.
+ /// @param rsp A pointer to the response.
+ /// @param allow_packet_park Indicates if parking a packet is allowed.
+ void processDhcp4QueryAndSendResponse(Pkt4Ptr& query, Pkt4Ptr& rsp,
+ bool allow_packet_park);
+
/// @brief Instructs the server to shut down.
void shutdown();
return;
}
+ processDhcp6Query(query, rsp);
+}
+
+void
+Dhcpv6Srv::processDhcp6QueryAndSendResponse(Pkt6Ptr& query, Pkt6Ptr& rsp) {
+ try {
+ processDhcp6Query(query, rsp);
+ if (!rsp) {
+ return;
+ }
+
+ CalloutHandlePtr callout_handle = getCalloutHandle(query);
+ processPacketBufferSend(callout_handle, rsp);
+ } catch (const std::exception& e) {
+ LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_STD_EXCEPTION)
+ .arg(e.what());
+ } catch (...) {
+ LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_EXCEPTION);
+ }
+}
+
+void
+Dhcpv6Srv::processDhcp6Query(Pkt6Ptr& query, Pkt6Ptr& rsp) {
// Create a client race avoidance RAII handler.
ClientHandler client_handler;
bool drop = false;
/// @brief Process a single incoming DHCPv6 packet and sends the response.
///
- /// It verifies correctness of the passed packet, call per-type processXXX
+ /// It verifies correctness of the passed packet, calls per-type processXXX
/// methods, generates appropriate answer, sends the answer to the client.
///
/// @param query A pointer to the packet to be processed.
/// @brief Process a single incoming DHCPv6 packet and sends the response.
///
- /// It verifies correctness of the passed packet, call per-type processXXX
+ /// It verifies correctness of the passed packet, calls per-type processXXX
/// methods, generates appropriate answer, sends the answer to the client.
///
/// @param query A pointer to the packet to be processed.
///
/// @param callout_handle pointer to the callout handle.
/// @param query A pointer to the packet to be processed.
- /// @param rsp A pointer to the response
+ /// @param rsp A pointer to the response.
void sendResponseNoThrow(hooks::CalloutHandlePtr& callout_handle,
Pkt6Ptr& query, Pkt6Ptr& rsp);
/// @brief Process a single incoming DHCPv6 packet.
///
- /// It verifies correctness of the passed packet, call per-type processXXX
+ /// It verifies correctness of the passed packet, calls per-type processXXX
/// methods, generates appropriate answer.
///
/// @param query A pointer to the packet to be processed.
- /// @param rsp A pointer to the response
+ /// @param rsp A pointer to the response.
void processPacket(Pkt6Ptr& query, Pkt6Ptr& rsp);
+ /// @brief Process a single incoming DHCPv6 query.
+ ///
+ /// It calls per-type processXXX methods, generates appropriate answer.
+ ///
+ /// @param query A pointer to the packet to be processed.
+ /// @param rsp A pointer to the response.
+ void processDhcp6Query(Pkt6Ptr& query, Pkt6Ptr& rsp);
+
+ /// @brief Process a single incoming DHCPv6 query.
+ ///
+ /// It calls per-type processXXX methods, generates appropriate answer,
+ /// sends the answer to the client.
+ ///
+ /// @param query A pointer to the packet to be processed.
+ /// @param rsp A pointer to the response.
+ void processDhcp6QueryAndSendResponse(Pkt6Ptr& query, Pkt6Ptr& rsp);
+
/// @brief Instructs the server to shut down.
void shutdown();